- Method and path
- POST
/api/v1/handoff - Authentication
- Server key
- Status codes
-
- 200
- 400
- 401
- 403
- 404
- 413
- 415
- 429
- 503
Authenticate with a server key in Authorization: Bearer <key>. Each hand-off code lives 60 seconds and works 1 time.
For middleware and redirect rules, read part 4 of the integration guide.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
code | string, 4,096 characters at most | yes | The value of the ns_handoff query parameter from the reader request. A code that expired or ran before returns 400 invalid_code. |
Response 200
| Field | Type | Always present | Description |
|---|---|---|---|
reader | string, 1 to 512 characters | yes | The reader token. Keep it as opaque text and set the reader cookie to this value. |
maxAge | integer, 0 to 2,592,000 | yes | Whole seconds until the hosted session ends, 2,592,000 at most. Use this value as Max-Age on the reader cookie. |
Example
Request
curl -sS https://konto.example.no/api/v1/handoff \
-H "Authorization: Bearer $SERVER_KEY" \
-H "Content-Type: application/json" \
-d '{"code": "5qyV3m0lLzVn0nIyl2m0pQm0r9m9Qn2o1iP7c5b3d1A"}' Response 200
{
"reader": "ns_rt_1_...",
"maxAge": 2591000
} Errors
| Status | code |
|---|---|
| 400 | invalid_request, invalid_code |
| 401 | unauthenticated, key_mode_mismatch |
| 403 | browser_request |
| 404 | no_site |
| 413 | too_large |
| 415 | unsupported_media_type |
| 429 | rate_limited |
| 503 | busy |
Read the cause and action for each code in the Errors reference.