Sign-up and API keys are open. Paid top-ups open soon.What changed
Docs menu

API reference, Console auth

Email a one-time sign-in code

View as Markdown

POST/v1/console/auth/email-codeoperation id requestSignInCode

Always answers 202 for a well-formed address, whether or not an account exists, so the route cannot be used to discover accounts. The first successful sign-in creates the account. At most 5 codes per address per hour: the sixth answers 429 email_codes_per_hour with retry-after set to the seconds until the oldest code of the hour stops counting (up to 3,600), not a capped 60.

Authentication. None. This route is public.

Request body

application/json, schema SignInCodeRequest

emailstringrequired
  • format email
  • at most 254 characters

Responses

202A code was sent if the address can receive one.

Headers: x-request-id

400The request could not be read. Codes: invalid_json (not JSON, not UTF-8, or a \u escape that is half of a surrogate pair, such as "\ud800" without its low half), duplicate_key (a JSON object repeats a key; param is the JSON pointer of the repeated member, such as /questions/q1/options/a), unsupported_media_type (not application/json) and invalid_header (a malformed idempotency-key or x-client-request-id; param names the header).

Headers: x-request-id, x-client-request-id

Error envelope. See Errors for every type and code.

422The request is well-formed JSON but breaks a validation rule. param names the field as a dotted path. Codes: unknown_field, missing_field, invalid_type (wrong JSON type), invalid_value (right type, value out of range: an empty or over-long string, a state, instructions, criteria string or option description of only whitespace, an empty questions or options object, an empty state object or array, a pattern or allowed-value mismatch such as a label or level with outer whitespace, a state nested deeper than 32 levels, a bad date or date range), field_not_allowed (options or levels on the wrong question type), invalid_question_id, too_many_questions, too_many_options, invalid_levels (including two levels equal after Unicode NFC normalisation and lower-casing), invalid_min_confidence, duplicate_label (two option labels equal after Unicode NFC normalisation and lower-casing, such as Billing and billing), state_path_not_found, state_not_json and, on the console, top_up_limit_exceeded.

Headers: x-request-id, x-client-request-id

Error envelope. See Errors for every type and code.

429email_codes_per_hour: this address was sent 5 sign-in codes in the last hour, or too many codes were asked for from this network. retry-after is the real wait until a code can be sent again, up to 3,600 seconds.

Headers: x-request-id, retry-after

Error envelope. See Errors for every type and code.

500An unexpected error. Any charge was refunded. Retry with the same idempotency key.

Headers: x-request-id, x-client-request-id

Error envelope. See Errors for every type and code.

503maintenance: the console's database, sign-in or payments are unavailable for a moment. Retry after retry-after. Nothing was changed.

Headers: x-request-id, retry-after

Error envelope. See Errors for every type and code.

Examples

Illustrative values. Examples show the shape of requests and responses; the numbers in them are not measured results.

Request: email

{
  "email": "dev@example.nl"
}