Skip to Content
OpenPerf

API tokens

Create an API token

POST
/api/v1/api-tokens

Creates an organization API token and returns its secret value once.

Authorization

cookie
cookiebetter-auth.session_token<token>

Dashboard session cookie

Request Body

application/json
  1. body
name*string
Length1 <= length <= 80
scope?string
Default"write"
Value in"read""write"
expiresAt?|
Formatdate-time
Defaultnull

Response Body

application/json
  1. response
id*string
name*string
scope*ApiTokenScope
Value in"read""write"
start*string
createdBy*|null
expiresAt*|
Formatdate-time
lastUsedAt*|
Formatdate-time
createdAt*string
Formatdate-time
token*string
Example Request
curl -X POST 'https://api.example.com/api/v1/api-tokens' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string"
}'
Example Response
{
  "id": "string",
  "name": "string",
  "scope": "read",
  "start": "string",
  "createdBy": {
    "id": "string",
    "name": "string"
  },
  "expiresAt": "2019-08-24T14:15:22Z",
  "lastUsedAt": "2019-08-24T14:15:22Z",
  "createdAt": "2019-08-24T14:15:22Z",
  "token": "string"
}