APIAuth

Create an API key

Create an API key. Returns the full token once.

POST
/api-keys

Create an API key. Returns the full token once.

Authorization

ApiKeyAuth
headerAuthorizationBearer <token>

Bearer token authentication. Send an API key (a saai_api_-prefixed token) as Authorization: Bearer <token>.

Required permission

manage_api_keys

Request Body

application/json
  1. body
name*string
Length1 <= length <= 255
permissions*array<>

What the key may do. Every permission must be one you hold yourself.

Items1 <= items
expires_at?string
Formatdate-time

Response Body

The request has succeeded and a new resource has been created as a result.

application/json
  1. response

A key together with its secret. The secret is shown only once.

key*

A credential for calling this API from your own application. The key carries its own permissions and can never do more than the person who created it.

token*string

The full API key. Copy it now; it cannot be retrieved later.

curl -X POST "https://example.com/api-keys" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "permissions": [      "view_agents"    ]  }'
{  "key": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "permissions": [      "view_agents"    ],    "last_four": "string",    "expires_at": "2019-08-24T14:15:22Z",    "last_used_at": "2019-08-24T14:15:22Z",    "revoked_at": "2019-08-24T14:15:22Z",    "created_at": "2019-08-24T14:15:22Z"  },  "token": "string"}