Skip to content

Create a token

POST
/v1/tokens/

Logs a user in. Needs no authentication. The token expires 30 minutes after its last use, and ends the earlier tokens of the user. When the user has MFA, send mfa_token or a valid trusted_token.

Request Body

application/json
  1. body
email*string

The email address of the user.

password*string

The password of the user.

mfa_token?string

A code from the authenticator app or the SMS, or a recovery code.

force_send_sms?boolean

Send an SMS code when the user has both SMS and an authenticator app.

generate_trusted_token?boolean

Return a trusted_token, valid for 14 days, so the device can log in without an MFA code.

trusted_token?string

A trusted token from an earlier login, instead of an MFA code.

Response Body

The user is logged in.

application/json
  1. response
id?string

The token. Send it as the username of HTTP Basic authentication.

created?string
Formatdate-time
merchant_id?string
Formatuuid
account_id?string

The ID of the user.

Formatuuid
email?string
legal_name?string
expiration?string

When the token expires, unless it's used before.

Formatdate-time
expiration_period?string

How long the token lasts after its last use, as an ISO 8601 duration.

status?string
Value in"active""inactive""invalid""expired"
permissions?

Path permissions, see Permissions.

field_permissions?

The field permissions of the user, when it has any.

allowed_project_ids?array<string>

The projects the user may read.

trusted_token?string

The new trusted token, when you sent generate_trusted_token or trusted_token.

curl -X POST 'https://api.example.com/v1/tokens/' \  --user "$API_KEY:" \  -H 'Content-Type: application/json' \  -d '{  "email": "ops@example.com",  "password": "correct-Horse-battery-7"}'
{  "id": "4c0ffee5c0ffee5c0ffee5c0ffee5c0f",  "created": "2026-04-30T12:16:28.598389+00:00",  "merchant_id": "b09a6915-71f8-4597-986e-c431d37a09b8",  "account_id": "845c16de-f627-48cb-bc81-a6b3b1fb134b",  "email": "ops@example.com",  "legal_name": "Example user",  "expiration": "2026-04-30T12:46:28.598171+00:00",  "expiration_period": "PT30M",  "status": "active",  "permissions": {    "/merchants/self/": {      "GET": true    },    "/merchants/self/users/self/": {      "GET": true,      "PUT": true    },    "/orders/**": {      "GET": true    },    "/search/orders/": {      "POST": true    }  },  "trusted_token": "7e57c0de7e57c0de7e57c0de7e57c0de7e57c0de"}