Skip to content
Connect an agent

Auth

Email a sign-in code

Sends a six-digit code to the address.

POST/auth/code

TL;DR

QuestionAnswer
What does it do?Email a sign-in code.
What does it take?A JSON body of type RequestCodeBody.
What does it return?Status 202 with a body of type Accepted.
What can go wrong?400 the address is not valid; 403 the request came from an origin that may not sign in, its Turnstile token was missing or refused (challenge.failed), or sign-in is for approved people only and the address is not approved (auth.not_approved); 429 too many requests; 502 the email could not be sent. Every failure uses the one error envelope.

What it does

Sends a six-digit code to the address. There is no separate sign-up: the first successful sign-in makes the account. The answer is the same whether or not an email went out, so it reveals nothing about the address. When the server has a Cloudflare Turnstile secret, turnstileToken must be one Cloudflare accepts, or the answer is 403 challenge.failed and nothing is sent; only the secret and the token go to Cloudflare. While sign-in is for approved people only, an address that is not approved, by itself or by its domain, is refused with 403 auth.not_approved and no code is sent; the answer depends on the approved list alone, never on whether an account has the address.

Request body

The body has the type RequestCodeBody.

FieldTypeRequiredDescription
emailstringyesat least 3 characters; at most 254 characters.
turnstileTokenstringnoThe token the Cloudflare Turnstile widget on the sign-in page gave. Required when the server has a Turnstile secret. at most 2048 characters.

Responses

StatusMeaningBody
202Accepted.Accepted
400The address is not valid.ErrorResponse
403The request came from an origin that may not sign in, its Turnstile token was missing or refused (challenge.failed), or sign-in is for approved people only and the address is not approved (auth.not_approved).ErrorResponse
429Too many requests.ErrorResponse
502The email could not be sent.ErrorResponse

Response body

A 202 answer has the type Accepted.

FieldTypeRequiredDescription
acceptedtrueyes

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools