Project Keys REST API


List project keys


⚠️ 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.

List all API keys for a project. Requires `manage` permission on the project. By default, the keys are sorted in alphabetical order by name. The HTTP response header `X-Total-Count` contains the total number of keys.

Headers


Content-Type

string

Required

Set to application/json.


Authorization

string

Required

Set to Bearer BENCHER_API_TOKEN, where BENCHER_API_TOKEN is a vaild Bencher API token.

Path Parameters


project
Required

The slug or UUID for a project.

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 key name, exact match.


revoked

boolean

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


search

string

Search by key name or UUID.

GET
/v0/projects/{project}/keys
Bencher Cloud https://api.bencher.dev
Bencher Self-Hosted http://localhost:61016

Bencher CLI

bencher project key list PROJECT

View OpenAPI Spec

Create a project key


⚠️ 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.

Create a new API key for a project. The plaintext key is only returned once in the response. Requires `manage` permission on the project.

Headers


Content-Type

string

Required

Set to application/json.


Authorization

string

Required

Set to Bearer BENCHER_API_TOKEN, where BENCHER_API_TOKEN is a vaild Bencher API token.

Path Parameters


project
Required

The slug or UUID for a project.

Body Parameters


name

string

Required

The name of the project key. Maximum length is 64 characters.


ttl

integer

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

POST
/v0/projects/{project}/keys
Bencher Cloud https://api.bencher.dev
Bencher Self-Hosted http://localhost:61016

Bencher CLI

bencher project key create PROJECT

View OpenAPI Spec

View a project key


⚠️ 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.

View an API key for a project. Requires `manage` permission on the project.

Headers


Content-Type

string

Required

Set to application/json.


Authorization

string

Required

Set to Bearer BENCHER_API_TOKEN, where BENCHER_API_TOKEN is a vaild Bencher API token.

Path Parameters


key

string

Required

The UUID for a project key.


project
Required

The slug or UUID for a project.

GET
/v0/projects/{project}/keys/{key}
Bencher Cloud https://api.bencher.dev
Bencher Self-Hosted http://localhost:61016

Bencher CLI

bencher project key view PROJECT KEY

View OpenAPI Spec

Update a project key


⚠️ 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.

Update an API key for a project (rename only). Requires `manage` permission on the project.

Headers


Content-Type

string

Required

Set to application/json.


Authorization

string

Required

Set to Bearer BENCHER_API_TOKEN, where BENCHER_API_TOKEN is a vaild Bencher API token.

Path Parameters


key

string

Required

The UUID for a project key.


project
Required

The slug or UUID for a project.

Body Parameters


name

string

The new name of the project key. Maximum length is 64 characters.

PATCH
/v0/projects/{project}/keys/{key}
Bencher Cloud https://api.bencher.dev
Bencher Self-Hosted http://localhost:61016

Bencher CLI

bencher project key update PROJECT KEY

View OpenAPI Spec

Revoke a project key


⚠️ 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.

Revoke an API key for a project. Revocation is terminal: a revoked key can no longer authenticate any request, and the revocation cannot be undone. Requires `manage` permission on the project.

Headers


Content-Type

string

Required

Set to application/json.


Authorization

string

Required

Set to Bearer BENCHER_API_TOKEN, where BENCHER_API_TOKEN is a vaild Bencher API token.

Path Parameters


key

string

Required

The UUID for a project key.


project
Required

The slug or UUID for a project.

DELETE
/v0/projects/{project}/keys/{key}
Bencher Cloud https://api.bencher.dev
Bencher Self-Hosted http://localhost:61016

Bencher CLI

bencher project key revoke PROJECT KEY

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