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
Set to application/json.
Authorization string
Set to Bearer BENCHER_API_TOKEN, where BENCHER_API_TOKEN is a vaild Bencher API token.
Path Parameters
projectThe slug or UUID for a project.
Query Parameters
directionstring
The direction to sort by. If not specified, the default sort direction is used.
Default: asc
One of: asc, desc
pageinteger
The page number to return. If not specified, the first page is returned.
Default: 1
per_pageinteger
The number of items to return per page. If not specified, the default number of items per page (8) is used.
Default: 8
sortstring
The field to sort by. If not specified, the default sort field is used.
Default: name
One of: name
namestring
Filter by key name, exact match.
revokedboolean
If set to `true`, only returns revoked keys. If not set or set to `false`, only returns non-revoked keys.
searchstring
Search by key name or UUID.
/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
Set to application/json.
Authorization string
Set to Bearer BENCHER_API_TOKEN, where BENCHER_API_TOKEN is a vaild Bencher API token.
Path Parameters
projectThe slug or UUID for a project.
Body Parameters
namestring
The name of the project key. Maximum length is 64 characters.
ttlinteger
The time-to-live (TTL) for the key in seconds. If not provided, the key will not expire for over 128 years.
/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
Set to application/json.
Authorization string
Set to Bearer BENCHER_API_TOKEN, where BENCHER_API_TOKEN is a vaild Bencher API token.
Path Parameters
keystring
The UUID for a project key.
projectThe slug or UUID for a project.
/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
Set to application/json.
Authorization string
Set to Bearer BENCHER_API_TOKEN, where BENCHER_API_TOKEN is a vaild Bencher API token.
Path Parameters
keystring
The UUID for a project key.
projectThe slug or UUID for a project.
Body Parameters
namestring
The new name of the project key. Maximum length is 64 characters.
/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
Set to application/json.
Authorization string
Set to Bearer BENCHER_API_TOKEN, where BENCHER_API_TOKEN is a vaild Bencher API token.
Path Parameters
keystring
The UUID for a project key.
projectThe slug or UUID for a project.
/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