---
title: "Create one-time token"
method: POST
path: "/api/one-time-tokens"
tags: ["One-time tokens"]
---

# Create one-time token

`POST /api/one-time-tokens`

Create a new one-time token associated with an email address. The token can be used for verification purposes and has an expiration time.

## Request body

- object
  - `email` string, required — The email address to associate with the one-time token.
  - `context` object — Additional context to store with the one-time token. Set `interactionEvent` to scope the token to a specific flow, such as `ForgotPassword` for reset-password magic links.
    - `jitOrganizationIds` string[]
    - `interactionEvent` 'SignIn' | 'Register' | 'ForgotPassword'
  - `expiresIn` number — The expiration time in seconds. If not provided, defaults to 10 mins (600 seconds).

## Response `201`

The one-time token was created successfully.

- object
  - `tenantId` string, required
  - `id` string, required
  - `email` string, required
  - `token` string, required
  - `context` object, required
    - `jitOrganizationIds` string[]
    - `interactionEvent` 'SignIn' | 'Register' | 'ForgotPassword'
  - `status` 'active' | 'consumed' | 'revoked' | 'expired', required
  - `createdAt` number, required
  - `expiresAt` number, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden

---

[API](https://skmtc.net/logto/apis/logto-api-references.md) · [All operations](https://skmtc.net/logto/apis/logto-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/logto/logto-api-references/versions/a163dc77d842/schema)
