Skip to content
Connect an agent
Auth

Sign in with a code

Checks the code from the email.

POST/auth/verify

TL;DR

QuestionAnswer
What does it do?Sign in with a code.
What does it take?A JSON body of type VerifyCodeBody.
What does it return?Status 200 with a body of type SignInResponse.
What can go wrong?400 the body is not valid; 401 the code is wrong, expired, or used; 403 the request came from an origin that may not sign in, or the account is suspended; 429 too many requests. Every failure uses the one error envelope.

What it does

Checks the code from the email. On success it makes the account if there is none, opens a session, and sets the session cookie, which is HTTP-only and shared by every Plotwork subdomain, and a plain marker cookie, plotwork_signed_in, that tells the site and the docs a session exists. An account the operator suspended gets no session. A code dies after five wrong guesses or ten minutes.

Request body

The body has the type VerifyCodeBody.

FieldTypeRequiredDescription
emailstringyesat least 3 characters; at most 254 characters.
codestringyespattern ^\d{6}$.

Responses

StatusMeaningBody
200Signed in.SignInResponse
400The body is not valid.ErrorResponse
401The code is wrong, expired, or used.ErrorResponse
403The request came from an origin that may not sign in, or the account is suspended.ErrorResponse
429Too many requests.ErrorResponse

Response body

A 200 answer has the type SignInResponse.

FieldTypeRequiredDescription
userAccountyes
user.idstringyes
user.emailstringyes

See also

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