API Tokens REST API


List tokens for a user


⚠️ Breaking Changes: The Bencher API is in beta and under active development. We may introduce breaking changes in future releases. We will announce any breaking changes in the release notes.

DEPRECATED: User API tokens have been deprecated in favor of user API keys. This endpoint remains available to manage existing API tokens. Create a user API key instead.

List all API tokens for a user. Only the authenticated user themselves and server admins have access to this endpoint. By default, the tokens are sorted in alphabetical order by name. The HTTP response header `X-Total-Count` contains the total number of tokens.

Headers


Content-Type

string

Required

Set to application/json.


Authorization

string

Required

Set to Bearer BENCHER_API_KEY, where BENCHER_API_KEY is a valid Bencher API key (or a deprecated API token).

Path Parameters


user
Required

The slug or UUID for a user.

Query Parameters


direction

string

The direction to sort by. If not specified, the default sort direction is used.

Default: asc

One of: asc, desc


page

integer

The page number to return. If not specified, the first page is returned.

Default: 1


per_page

integer

The number of items to return per page. If not specified, the default number of items per page (8) is used.

Default: 8


sort

string

The field to sort by. If not specified, the default sort field is used.

Default: name

One of: name


name

string

Filter by token name, exact match.


revoked

boolean

If set to `true`, only returns revoked tokens. If not set or set to `false`, only returns non-revoked tokens.


search

string

Search by token name, slug, or UUID.

GET
/v0/users/{user}/tokens
Deprecated
Bencher Cloud https://api.bencher.dev
Bencher Self-Hosted http://localhost:6610

Bencher CLI

bencher token list USER

View OpenAPI Spec

Create a token


⚠️ Breaking Changes: The Bencher API is in beta and under active development. We may introduce breaking changes in future releases. We will announce any breaking changes in the release notes.

DEPRECATED: User API tokens have been deprecated in favor of user API keys, so this endpoint always fails with a `403 Forbidden` error. Create a user API key instead. Existing API tokens continue to work and can still be viewed, updated, and revoked.

Headers


Content-Type

string

Required

Set to application/json.


Authorization

string

Required

Set to Bearer BENCHER_API_KEY, where BENCHER_API_KEY is a valid Bencher API key (or a deprecated API token).

Path Parameters


user
Required

The slug or UUID for a user.

Body Parameters


name

string

Required

The name of the token. Maximum length is 64 characters.


ttl

integer

The time-to-live (TTL) for the token in seconds. If not provided, the token will not expire for over 128 years.

POST
/v0/users/{user}/tokens
Deprecated
Bencher Cloud https://api.bencher.dev
Bencher Self-Hosted http://localhost:6610

Bencher CLI

bencher token create USER

View OpenAPI Spec

View a token


⚠️ Breaking Changes: The Bencher API is in beta and under active development. We may introduce breaking changes in future releases. We will announce any breaking changes in the release notes.

DEPRECATED: User API tokens have been deprecated in favor of user API keys. This endpoint remains available to manage existing API tokens. Create a user API key instead.

View an API token for a user. Only the authenticated user themselves and server admins have access to this endpoint.

Headers


Content-Type

string

Required

Set to application/json.


Authorization

string

Required

Set to Bearer BENCHER_API_KEY, where BENCHER_API_KEY is a valid Bencher API key (or a deprecated API token).

Path Parameters


token
Required

The UUID for a token.


user
Required

The slug or UUID for a user.

GET
/v0/users/{user}/tokens/{token}
Deprecated
Bencher Cloud https://api.bencher.dev
Bencher Self-Hosted http://localhost:6610

Bencher CLI

bencher token view USER TOKEN

View OpenAPI Spec

Update a token


⚠️ Breaking Changes: The Bencher API is in beta and under active development. We may introduce breaking changes in future releases. We will announce any breaking changes in the release notes.

DEPRECATED: User API tokens have been deprecated in favor of user API keys. This endpoint remains available to manage existing API tokens. Create a user API key instead.

Update an API token for a user. Only the authenticated user themselves and server admins have access to this endpoint.

Headers


Content-Type

string

Required

Set to application/json.


Authorization

string

Required

Set to Bearer BENCHER_API_KEY, where BENCHER_API_KEY is a valid Bencher API key (or a deprecated API token).

Path Parameters


token
Required

The UUID for a token.


user
Required

The slug or UUID for a user.

Body Parameters


name

string

The new name of the token. Maximum length is 64 characters.

PATCH
/v0/users/{user}/tokens/{token}
Deprecated
Bencher Cloud https://api.bencher.dev
Bencher Self-Hosted http://localhost:6610

Bencher CLI

bencher token update USER TOKEN

View OpenAPI Spec

Revoke a token


⚠️ Breaking Changes: The Bencher API is in beta and under active development. We may introduce breaking changes in future releases. We will announce any breaking changes in the release notes.

DEPRECATED: User API tokens have been deprecated in favor of user API keys. This endpoint remains available to manage existing API tokens. Create a user API key instead.

Revoke an API token for a user. Revocation is terminal: a revoked token can no longer authenticate any request, and the revocation cannot be undone (for security — a leaked JWT must not become valid again). Only the authenticated user themselves and server admins have access to this endpoint.

Headers


Content-Type

string

Required

Set to application/json.


Authorization

string

Required

Set to Bearer BENCHER_API_KEY, where BENCHER_API_KEY is a valid Bencher API key (or a deprecated API token).

Path Parameters


token
Required

The UUID for a token.


user
Required

The slug or UUID for a user.

DELETE
/v0/users/{user}/tokens/{token}
Deprecated
Bencher Cloud https://api.bencher.dev
Bencher Self-Hosted http://localhost:6610

Bencher CLI

bencher token revoke USER TOKEN

View OpenAPI Spec


Published: Mon, February 12, 2024 at 7:26:00 AM UTC | Last Updated: Sat, May 9, 2026 at 12:00:00 AM UTC