Skip to content

Sign in with a code

POST
/v1/id/sign-in/email-otp
curl --request POST \
--url https://your-tenant-host/v1/id/sign-in/email-otp \
--header 'Content-Type: application/json' \
--header 'x-edgekit-site-id: site_example' \
--data '{ "email": "user@example.com", "otp": "482913", "firstName": "Ada", "lastName": "Lovelace", "userTraits": { "favouriteSection": "business" } }'

Creates the user when the address is new. Registration traits are honoured on that branch only; an existing user keeps the traits they have. A code is single-use, so a retry after success is refused.

x-edgekit-site-id
required

The site this request is for, within this tenant. Every official EdgeKit SDK sets it from the client you configured; set it yourself only when calling this API directly.

string
>= 1 characters <= 128 characters

Example

site_example

The site this request is for, within this tenant. Every official EdgeKit SDK sets it from the client you configured; set it yourself only when calling this API directly.

Media typeapplication/json
object
email
required
string format: email

Example

user@example.com
otp
required
string
/^\d{6}$/

Example

482913
firstName
string
>= 1 characters <= 100 characters

Example

Ada
lastName
string
>= 1 characters <= 100 characters

Example

Lovelace
userTraits
object
key
additional properties

Example

{
"favouriteSection": "business"
}

The user is signed in.

Media typeapplication/json
object
user
required
object
id
required
string format: uuid
email
required
string
emailVerified
required
boolean
name
required
string | null
firstName
required
string | null
lastName
required
string | null
image
required
string | null
session
required
object
id
required
string format: uuid
kind
required
string
Allowed values: edgekit
expiresAt
required
string format: date-time

Example

{
"user": {
"id": "01926f3a-8b4c-7d2e-9f10-2a3b4c5d6e7f",
"email": "user@example.com",
"emailVerified": true,
"name": "Ada Lovelace",
"firstName": "Ada",
"lastName": "Lovelace",
"image": null
},
"session": {
"id": "01926f3a-8b4d-7a11-8c22-3d4e5f6a7b8c",
"kind": "edgekit",
"expiresAt": "2026-08-30T09:00:00.000Z"
}
}

Invalid request.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Not allowed.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Resource not found.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Request validation failed.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Too many requests. Retry-After says when to retry.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Unexpected error.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

With Retry-After, briefly unavailable; without it, not configured.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}