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
user
string
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.
search
string
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
user
string
The slug or UUID for a user.
Body Parameters
name
string
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.
/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
token
The UUID for a token.
user
string
The 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
token
The UUID for a token.
user
string
The slug or UUID for a user.
Body Parameters
name
string
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