Sign in with the 6-digit code of the sign-in email → open a session
const url = 'https://beta-api.plune.ai/v1/auth/verify-code';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"email":"you@example.com","code":"482913"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://beta-api.plune.ai/v1/auth/verify-code \ --header 'Content-Type: application/json' \ --data '{ "email": "you@example.com", "code": "482913" }'The sign-in email carries a 6-digit code beside the link (#2533), for a sign-in on another device than the one the mail is read on. The code and the link are one: whichever is used first spends the other, and both expire with the letter (15 minutes). A good code opens the same session GET /v1/auth/verify does (the signed plune_session cookie). A code takes five wrong tries, then it is void (code_attempts); the per-IP throttle allows 30 tries in 15 minutes, and one address 10 wrong codes an hour, across letters. A refusal says nothing about whether the address has an account: an address that asked for no letter answers code_expired, as a spent one does, and one the door turned away answers wrong codes as an invited one does.
Request Body required
Section titled “Request Body required ”object
The address the sign-in letter went to.
The 6 digits of the letter, without the space it shows them with.
Example
{ "email": "you@example.com", "code": "482913"}Responses
Section titled “ Responses ”Signed httpOnly plune_session cookie is set
object
Example generated
{ "ok": true, "userId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}A malformed body: no valid address, or a code that is not 6 digits
object
Example generated
{ "error": "example"}The code opened nothing; code says why, for the screen to word it.
object
code_invalid: no live letter to the address has this code; the try is counted. code_expired: the newest letter to the address is spent (by its link or its code) or expired, or there is none — the same answer for each. code_attempts: the code took five wrong tries and is void; the link of the same letter still works, and a new letter brings a new code.
Examples
{ "error": "that code is not right", "code": "code_invalid"}{ "error": "that code has expired or was already used", "code": "code_expired"}{ "error": "too many wrong tries with this code - ask for a new link", "code": "code_attempts"}Rate-limited by the client IP (30 tries in 15 minutes) or by the address (10 wrong codes an hour). error names the limit and the wait, e.g. too many sign-in requests: at most 30 code tries from one IP address in 15 minutes — try again in 7 minutes. Retry-After carries the seconds until the oldest counted try leaves the window.
Headers
Section titled “Headers ”Seconds until the window rolls over