---
title: "POST /tokens/{id}/regenerate"
method: POST
path: "/tokens/{id}/regenerate"
tags: ["tokens"]
---

# POST /tokens/{id}/regenerate

`POST /tokens/{id}/regenerate`

## Request

- Base URL: `https://api.axiom.co/v2`
- URL: `https://api.axiom.co/v2/tokens/{id}/regenerate`
- Auth: OAuth 2
  - Authorization code: `https://accounts.google.com/o/oauth2/v2/auth`
  - Token URL: `https://www.googleapis.com/oauth2/v4/token` scopes: `apiTokens|update`
- TypeScript: <https://skmtc.dev/axiom/apis/axiom-public-api/docs/tokens/:id/regenerate/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new API token with the existing token's capabilities, or with those in `newToken`, and returns its secret value. The existing token keeps working until `existingTokenExpiresAt`; set it to the current time to revoke it immediately.

## Path parameters

- `id` string, required

## Request body

- RegenerateAPIToken
  - `existingTokenExpiresAt` string, date-time, required: Expiration date of the existing token (ISO 8601 format)
  - `newToken` CreateAPIToken
    - `datasetCapabilities` DatasetCapabilities
    - `description` string: Description of the token
    - `expiresAt` string, date-time, nullable: Expiration date of the token (ISO 8601 format)
    - `name` string, required: Name of the token
    - `orgCapabilities` OrgCapabilities
      - `annotations` string[]: Annotations capability
      - `apiTokens` string[]: API tokens capability
      - `auditLog` string[]: Audit Log capability
      - `billing` string[]: Billing capability
      - `dashboards` string[]: Dashboards capability
      - `datasets` string[]: Datasets capability
      - `endpoints` string[]: Endpoints capability
      - `integrations` string[]: Integrations capability
      - `labels` string[]: Labels capability
      - `monitors` string[]: Monitors capability
      - `notifiers` string[]: Notifiers capability
      - `rbac` string[]: Access control capability
      - `sharedAccessKeys` string[]: Shared access keys capability
      - `users` string[]: Users capability
      - `views` string[]: Views capability
    - `viewCapabilities` ViewCapabilities
  - `newTokenExpiresAt` string, date-time, nullable: Expiration date of the new token (ISO 8601 format)

## Response `200`

New API token, including its secret `token` value.

- CreateAPITokenResponse
  - `apiLastUsed` string, date-time, nullable: When the token was last used on an API other than ingest
  - `auditIdentity` string: Audit identity of the token
  - `datasetCapabilities` DatasetCapabilities, required
  - `description` string: Description of the token
  - `expiresAt` string, date-time, nullable: Expiration date of the token (ISO 8601 format)
  - `id` string, required: ID of the token
  - `ingestLastUsed` string, date-time, nullable: When the token was last used to ingest
  - `name` string, required: Name of the token
  - `orgCapabilities` OrgCapabilities, required
    - `annotations` string[]: Annotations capability
    - `apiTokens` string[]: API tokens capability
    - `auditLog` string[]: Audit Log capability
    - `billing` string[]: Billing capability
    - `dashboards` string[]: Dashboards capability
    - `datasets` string[]: Datasets capability
    - `endpoints` string[]: Endpoints capability
    - `integrations` string[]: Integrations capability
    - `labels` string[]: Labels capability
    - `monitors` string[]: Monitors capability
    - `notifiers` string[]: Notifiers capability
    - `rbac` string[]: Access control capability
    - `sharedAccessKeys` string[]: Shared access keys capability
    - `users` string[]: Users capability
    - `views` string[]: Views capability
  - `samlAuthenticated` boolean
  - `viewCapabilities` ViewCapabilities
  - `token` string

## Other responses

- `400`: Missing `existingTokenExpiresAt`, expiry set in both `newTokenExpiresAt` and `newToken.expiresAt`, or invalid capabilities in `newToken`.
- `404`: API token not found or expired.

## Changes

- **2026-10-16** (v2) `fbc1b8430feb`: 2 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `404`
- **2026-10-14** (v2) `8920e1697284`: 4 warning, 5 info
  - removed the request property `newToken/datasetCapabilities/additionalProperties/data`
  - removed the request property `newToken/orgCapabilities/flows`
  - removed the optional property `allOf[#/components/schemas/APIToken]/datasetCapabilities/additionalProperties/data` from the response with the `200` status
  - removed the optional property `allOf[#/components/schemas/APIToken]/orgCapabilities/flows` from the response with the `200` status
  - …5 more

[Operation history](https://skmtc.dev/axiom/apis/axiom-public-api/changes/tokens/:id/regenerate/post.md)

---

[API](https://skmtc.dev/axiom/apis/axiom-public-api.md) - [All operations](https://skmtc.dev/axiom/apis/axiom-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/axiom/apis/axiom-public-api/revisions/7e39a295e3ba?raw)
