Create one-time token
Create a new one-time token associated with an email address. The token can be used for verification purposes and has an expiration time.
Body Required
-
The email address to associate with the one-time token.
Minimum length is
1
, maximum length is128
. -
context object
Additional context to store with the one-time token. This can be used to store arbitrary data that will be associated with the token.
Additional properties are allowed.
-
expiresIn number
The expiration time in seconds. If not provided, defaults to 2 days (172,800 seconds).
POST
/api/one-time-tokens
curl \
--request POST https://[tenant_id].logto.app/api/one-time-tokens \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"email":"string","context":{"jitOrganizationIds":["string"]},"expiresIn":42.0}'
Request examples
{
"email": "string",
"context": {
"jitOrganizationIds": [
"string"
]
},
"expiresIn": 42.0
}
Response examples (201)
{
"tenantId": "string",
"id": "string",
"email": "string",
"token": "string",
"context": {
"jitOrganizationIds": [
"string"
]
},
"status": "active",
"createdAt": 42.0,
"expiresAt": 42.0
}