HttpOnly, Secure, SameSite=Lax cookie that lasts 30 days. You include that cookie automatically with every subsequent request. Most endpoints require both a valid session and a verified email address; if you haven’t linked an email yet, those routes return 400 Not Authorized until you complete the email verification flow.
POST /api/register
Creates a new account and immediately sets a session cookie, logging you in.Request body
string
required
Your desired username. Must be non-empty after trimming whitespace.
string
required
Your account password. Must be non-empty.
string
required
A reCAPTCHA v2 response token obtained from the Google reCAPTCHA widget on the registration page.
Response
200 OK — "Success". A session cookie is set on the response; your client is now logged in.
Error codes
POST /api/verification/login
Validates your username and password, then sends a one-time login code to the email address linked to your account. You pass that code toPOST /api/login to complete sign-in.
If your account has no linked email, credentials are accepted immediately and the server returns
{"logged_in": true, "needs_email": true} with a session cookie already set. You should then call POST /api/verification/set_email to link one.Request body
string
required
The username of the account you want to log in to.
string
required
The account password.
Response
200 OK — one of two shapes:
Account has a linked email — code sent, awaiting POST /api/login:
string
A masked version of the destination address, e.g.
a**@example.com. Use this to remind the user which inbox to check.number
Seconds until the code expires. Always
600 (10 minutes).Error codes
POST /api/login
Completes the login flow by exchanging the one-time code that was emailed to you for a session cookie.Request body
string
required
The same username you passed to
POST /api/verification/login.string
required
The 4-digit code from the login email, e.g.
"0391".Response
200 OK — "Success". A session cookie is set and you are now logged in.
Error codes
GET /api/session
Returns the current authentication state for the cookie your client sends. This endpoint always returns200 — a missing or invalid session is represented as data, not as an HTTP error, so you can safely call it on every page load without treating a 4xx as a failure.
Response
boolean
true if the request carries a valid, unexpired session cookie; false otherwise.boolean
true if the authenticated account has a confirmed email address. Many API endpoints require verified: true.string
Present only when
authenticated is true. The username of the logged-in account.POST /api/verification/set_email
Begins the email verification flow by sending a 4-digit confirmation code to the address you supply. Pass the code toPOST /api/verification to confirm.
You must be logged in to call this endpoint. Accounts that already have a verified email address cannot change it — the response will be
403 "Email is linked".Request body
string
required
A valid email address (max 254 characters). Must not already be linked to another Clody account.
Response
200 OK:
string
The normalised (lowercased, trimmed) email address the code was sent to.
number
Seconds until the code expires. Always
600 (10 minutes).Error codes
POST /api/verification
Confirms your email address by submitting the code that was sent viaPOST /api/verification/set_email.
Request body
string
required
The 4-digit code from the verification email, e.g.
"7142".Response
200 OK — "Success". Your email is now confirmed and GET /api/session will return verified: true.
Confirming your email invalidates all other active sessions for your account (a new
login_at timestamp is issued). Your current session remains valid.Error codes
POST /api/logout
Clears your current session. The session cookie remains on the client but the server-side record is invalidated.Response
200 OK — "Success".
POST /api/settings/logout_all_devices
Invalidates all active sessions for your account simultaneously. Every device that holds a session cookie for your account is logged out and receives alogout Socket.IO event.
You must be logged in with a verified email to call this endpoint.
Response
200 OK — "Success". All sessions — including the one used to make this request — are immediately invalidated. Re-authenticate via the normal login flow to continue using the API.