REST API: access tokens

Update a permanent API token

Move the expiry of an existing token.

Purpose

Use this call to extend, shorten or remove the expiry of a token that already exists.

Request

POST <API_BASE_URL>/token/update. All calls are POST under your API address. Replace <API_BASE_URL> with the API address provided with your access.

Send a permanent API token in the token field of the body, or a user token in the token header. See authentication.

Content type: application/json.

FieldTypeRequiredDescription
tokenstring (uuid)if no headerYour current permanent API token. Required unless you send a user token in the token header.
token_idstring (uuid)noThe token to update.
expiresstringnoA new expiry as a UTC timestamp that ends in Z, for example 2027-01-01T00:00:00.000Z, or the string never.

Response

HTTP 200. The token was updated.

FieldTypeDescription
statusstringAlways ok on this body.
token.idstring (uuid)The updated token.
token.expiresstringThe expiry now in force, or never.

Errors

  • 400: The body failed validation. The answer has status of error and a details list with one entry per offending field (path, expected, actual).
  • 401: The token is missing, expired or unknown.

A refusal can also come before the operation runs: an address outside your IP allowlist, a token bound to another address, or a body that is not valid JSON. See response format and errors.

Example

Request:

curl -X POST "<API_BASE_URL>/token/update" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "<your permanent API token>",
    "token_id": "<token id to update>",
    "expires": "never"
  }'

Response:

{
  "status": "ok",
  "token": {
    "id": "<token id>",
    "expires": "never"
  }
}

Questions about tokens?

Write to us and we will help.

Talk to us