Skip to content

Verify the code: creates the account if it does not exist (user, organization and initial brand) and opens a session

POST
/v1/auth/code/verify
curl --request POST \
--url https://api.replifier.com/v1/auth/code/verify \
--header 'Content-Type: application/json' \
--data '{ "email": "hello@example.com", "code": "example", "name": "example", "organizationName": "example", "kind": "company", "invitation": "example" }'

Requires the __Host-repf_code cookie from the same request. name, organizationName and kind are only used when creating the account. Each code allows 5 attempts. After 10 failures per email and network in one hour (only with the cookie of a current code) you must wait 1 min, then 2, 4… up to 15 (429 code_attempts with Retry-After); it is never permanent. With invitation (token of an invitation for this same email), the new account is created without its own organization and the invitation is accepted; if the account already exists, it is just accepted. offerPasskey: the dashboard offers to create a passkey. mfaRequired: some organization requires a second factor; the code session is not enough for it.

Media typeapplication/json
object
email
required
string format: email
<= 254 characters
code
required
string
/^\d{6}$/
name
string
>= 1 characters <= 120 characters /^[^\x00-\x1f\x7f]*$/
organizationName
string
>= 1 characters <= 120 characters /^[^\x00-\x1f\x7f]*$/
kind
string
Allowed values: company agency
invitation
string
<= 2048 characters

Session created

Media typeapplication/json
object
user
required
object
id
required
string
email
required
string
name
required
string
locale
required
string
theme
required
string
Allowed values: light dark system
emailVerified
required
boolean
session
required
object
id
required
string
expiresAt
required
string
authLevel
required
string
accountCreated
required
boolean
offerPasskey
required
boolean
mfaRequired
required
boolean

Example

{
"user": {
"theme": "light"
}
}

Invalid data

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Not allowed, API key missing the scope, IP not allowed, or request rejected (csrf_rejected)

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Too many attempts

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Internal error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}