Signing in
Redeem a sign-in code
A terminal trades the page's code and its own secret for a session.
/api/v1/sign-in/codeverifier is the secret whose SHA-256 the terminal sent when it asked for the link. It never left the terminal before this, so the code alone, read off someone's screen, is no use.
The code lasts 10 minutes from when the button was pressed. Case, spaces and the dash don't matter. After 5 wrong codes the sign-in is used up.
On success the session arrives in Set-Cookie, never in the body, the same way the first claim's does.
Authentication
No cookie. The token in the request is the whole credential. How sessions work.
Body
JSON, with content-type: application/json.
verifierstringrequiredThe secret the terminal kept. Its SHA-256 is what it sent as
terminal.- At most 200 characters
codestringrequiredThe code the sign-in page showed.
- At most 40 characters
Response
200 OK, with every field below present. Times are ISO 8601 strings in UTC.
signedInbooleanTrue when the code was right. The session comes back in
Set-Cookie, never in the body.
Errors
| Status | Kind | When |
|---|---|---|
| 400 | bad_request | The body isn't JSON, or doesn't match the shape below. message names the first field to fix, and fields lists each one with its path. |
| 413 | payload_too_large | The body is over 16 KB. No route takes anything near that. |
| 429 | rate_limited | This network has used 30 links and codes in the last hour. |
Any route can also answer 500 with internal_error. Every error has the same shape, described in Errors.