Skip to content

Sign in with the 6-digit code of the sign-in email → open a session

POST
/v1/auth/verify-code
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.

Media type application/json
object
email
required

The address the sign-in letter went to.

string format: email
code
required

The 6 digits of the letter, without the space it shows them with.

string
/^\d{6}$/
Example
{
"email": "you@example.com",
"code": "482913"
}

Signed httpOnly plune_session cookie is set

Media type application/json
object
ok
required
boolean
userId
required
string format: uuid
Example generated
{
"ok": true,
"userId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

A malformed body: no valid address, or a code that is not 6 digits

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

The code opened nothing; code says why, for the screen to word it.

Media type application/json
object
error
required
string
code
required

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.

string
Allowed values: code_invalid code_expired code_attempts
Examples
{
"error": "that code is not right",
"code": "code_invalid"
}

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.

Retry-After
integer

Seconds until the window rolls over