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.
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
Set to application/json.
Authorization string
Set to Bearer BENCHER_API_TOKEN, where BENCHER_API_TOKEN is a vaild Bencher API token.
Path Parameters
userThe slug or UUID for a user.
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 token name, exact match.
searchstring
Search by token name, slug, or UUID.
/v0/users/{user}/tokens | Bencher Cloud | https://api.bencher.dev |
| Bencher Self-Hosted | http://localhost:61016 |
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.
Create an API token for a user. Only the authenticated user themselves and server admins have access to this endpoint.
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
userThe slug or UUID for a user.
Body Parameters
namestring
The name of the token. Maximum length is 64 characters.
ttlinteger
The time-to-live (TTL) for the token in seconds. If not provided, the token will not expire for over 128 years.
/v0/users/{user}/tokens | Bencher Cloud | https://api.bencher.dev |
| Bencher Self-Hosted | http://localhost:61016 |
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.
View an API token for a user. Only the authenticated user themselves and server admins have access to this endpoint.
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
tokenThe UUID for a token.
userThe slug or UUID for a user.
/v0/users/{user}/tokens/{token} | Bencher Cloud | https://api.bencher.dev |
| Bencher Self-Hosted | http://localhost:61016 |
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.
Update an API token for a user. Only the authenticated user themselves and server admins have access to this endpoint.
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
tokenThe UUID for a token.
userThe slug or UUID for a user.
Body Parameters
namestring
The new name of the token. Maximum length is 64 characters.
/v0/users/{user}/tokens/{token} | Bencher Cloud | https://api.bencher.dev |
| Bencher Self-Hosted | http://localhost:61016 |
Bencher CLI
bencher token update USER TOKEN View OpenAPI Spec