Skip to content

Verify the signup code

POST
/v1/auth/signup/verify
curl --request POST \
--url https://api.emite.cr/v1/auth/signup/verify \
--header 'Content-Type: application/json' \
--data '{ "email": "ventas@emite.cr", "code": "482913" }'

Verifies the code emailed by POST /v1/auth/signup, creates the account together with the acceptance of the legal documents its signup carried, and returns a session token (JWT), in the body and in the X-Session-Token header. The new account belongs to no company yet, so the token carries none: create one with POST /v1/tenants. 400 INVALID_CODE for a wrong code or an email with no pending signup, 400 CODE_EXPIRED, and 429 TOO_MANY_ATTEMPTS after five attempts on the same code.

Media typeapplication/json
object
email
required

Email of the signup, the same one sent to POST /v1/auth/signup.

string
Example
ventas@emite.cr
code
required

The 6-digit code from the verification email, valid for 15 minutes. A wrong code answers 400 INVALID_CODE and an expired one 400 CODE_EXPIRED; after five attempts, 429 TOO_MANY_ATTEMPTS until POST /v1/auth/signup/resend sends a new one.

string
Example
482913

The session of the new account, which carries no company yet.

Media typeapplication/json
object
accessToken
required

The session token, a signed JWT: send it as Authorization: Bearer <accessToken>. It acts for the person, in the company it names when it names one (currentTenantId in GET /v1/auth/me). The same token comes in the X-Session-Token response header.

string
tokenType
required

Always Bearer: the scheme to send the token with in the Authorization header.

string
Allowed values: Bearer
expiresIn
required

Remaining life of this token: whole seconds followed by s ("28800s" = 8 hours). It never reaches past the maximum of the session, which counts from the sign-in, so a re-issued token (switching company, renewing) lives less. Under a company inactivity rule it also ends that many minutes after it was issued, unless it is renewed with POST /v1/auth/sessions/renew.

string
expiresAt
required

The instant this token expires (ISO 8601, UTC): expiresIn as a date.

string format: date-time
passwordChangeSuggested

Present, and true, only in the answer of POST /v1/auth/login, when the password that just signed in does not meet the rule a new password must meet today (12 to 72 characters, nothing of the person, hard to guess: see POST /v1/auth/signup). A suggestion to change it, never a refusal: the sign-in went through.

boolean
Example
{
"tokenType": "Bearer",
"expiresIn": "28800s",
"expiresAt": "2026-10-22T22:30:00.000Z",
"passwordChangeSuggested": true
}