---
title: "Regenerate API token"
method: POST
path: "/api/project/tokens/{token_id}/regenerate"
tags: ["Project Tokens"]
---

# Regenerate API token

`POST /api/project/tokens/{token_id}/regenerate`

## Request

- Base URL: `https://{Your_Space_Name}.signalwire.com`
- URL: `https://{Your_Space_Name}.signalwire.com/api/project/tokens/{token_id}/regenerate`
- Auth: one of:
  - HTTP basic
  - HTTP basic

Replaces a project API token's value and returns the new value. Use it to rotate a credential on a schedule, after it has been exposed, or when its value has been lost. The token keeps its `id`, `name`, and `permissions`, so there is nothing to re-enter; to change those, use [Update API token](/docs/apis/rest/project-tokens/update-token).

The previous value stops working immediately, on every API that accepts a project API token. Anything still using it receives `401 Unauthorized` until you give it the new value.

The response is the only place the new value is returned; store it securely. If you lose it, regenerate the token again.

The new value always uses the current token format: 42 characters beginning with `swapi_`. A token issued in the legacy format, 50 characters beginning with `PT`, changes format and length when regenerated, so update anything that validates or stores token values by length or prefix.

You can regenerate the token you are authenticating with. The request succeeds, but the value you sent is no longer valid once it does, so save the new value from the response before making any further request.

A token the caller cannot reach returns `404 Not Found`. Use [List API tokens](/docs/apis/rest/project-tokens/list-tokens) to find the `id` of each token you can manage.

#### Permissions

With a project API token, the token must have the following scope(s) enabled to make a successful request: _Management_.

With a [Personal access token](/docs/apis/authorization#personal-access-tokens) there are no scopes. The token holder must be an owner or admin of the space, and the request reaches only the projects the holder is enabled for, plus their subprojects.

[Learn more about API scopes](/docs/platform/your-signalwire-api-space).

## Path parameters

- `token_id` string, uuid, required: Universal Unique Identifier.

## Response `200`

The request has succeeded.

- ProjectCreateTokenResponse
  - `id` string, uuid, required: Universal Unique Identifier.
  - `name` string, nullable, required: The name of the API Token. `null` when the token has no name.
  - `permissions` ProjectTokenPermission[], required: The permissions enabled for this token.
  - `last_used_at` string, date-time, nullable, required: The date and time the token last authenticated a request. `null` if it never has.
  - `revoked_at` string, date-time, nullable, required: The date and time SignalWire revoked the token's value, for example after detecting that the value was exposed. `null` if it has not been revoked. A revoked token keeps its `id` and still appears in [List API tokens](/docs/apis/rest/project-tokens/list-tokens), but its previous value no longer authenticates and no replacement value has been issued to you. To get a working value, [regenerate the token](/docs/apis/rest/project-tokens/regenerate-token), which also clears `revoked_at`.
  - `token` string, required: The API token that can be used along with the project ID for basic authentication. It is returned only when the token is created or regenerated and cannot be retrieved again; store it securely.

## Other responses

- `401`: Access is unauthorized.
- `404`: The server cannot find the requested resource.
- `500`: An internal server error occurred.

## Changes

> 173 revisions in range; 3 could not be searched.

- **2026-10-20** `69656bc25141`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/signalwire/apis/signalwire-rest-api/changes/api/project/tokens/:token_id/regenerate/post.md)

---

[API](https://skmtc.dev/signalwire/apis/signalwire-rest-api.md) - [All operations](https://skmtc.dev/signalwire/apis/signalwire-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/signalwire/apis/signalwire-rest-api/revisions/7307749294e0?raw)
