Auth
Sign in with a code
Checks the code from the email.
POST
/auth/verifyTL;DR
| Question | Answer |
|---|---|
| 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.
| Field | Type | Required | Description |
|---|---|---|---|
email | string | yes | at least 3 characters; at most 254 characters. |
code | string | yes | pattern ^\d{6}$. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Signed in. | SignInResponse |
| 400 | The body is not valid. | ErrorResponse |
| 401 | The code is wrong, expired, or used. | ErrorResponse |
| 403 | The request came from an origin that may not sign in, or the account is suspended. | ErrorResponse |
| 429 | Too many requests. | ErrorResponse |
Response body
A 200 answer has the type SignInResponse.
| Field | Type | Required | Description |
|---|---|---|---|
user | Account | yes | |
user.id | string | yes | |
user.email | string | yes |
See also
| Doc | Why |
|---|---|
| API reference | Every endpoint, and the error envelope |
| Schemas | Every request and response type |
| Tool reference | The operations as callable tools |