v13

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-04237161688.6 KB
API Keys

Create an API Key

post/api_keys

Request body

typestring
namestring required
descriptionstring nullable
subjectstring required
{"stackTrail":"paths:/api_keys:post:requestBody:content:application/json:schema:properties:claims","oasType":"schema","type":"unknown","nullable":true}
scopesstring[]
created_bystring nullable
seconds_until_expirationnumber nullable

Response

200 OK

object'api_key' required
idstring required
typestring required
subjectstring required
namestring required
descriptionstring nullable
{"stackTrail":"paths:/api_keys:post:responses:200:content:application/json:schema:properties:claims","oasType":"schema","type":"unknown","example":{"foo":"bar"},"nullable":true}
scopesstring[] required
secretstring required
revokedboolean required
revocation_reasonstring nullable required
expiredboolean required
expirationnumber nullable required

The timestamp for when the API key will expire, in milliseconds

created_bystring nullable required
last_used_atnumber nullable required

The timestamp for when the API key was last used, in milliseconds

created_atnumber required

The timestamp for when the API key was created, in milliseconds

updated_atnumber required

The timestamp for when the API key was last updated, in milliseconds

Example response

{
  "id": "ak_3beecc9c60adb5f9b850e91a8ee1e992",
  "type": "api_key",
  "subject": "user_2xhFjEI5X2qWRvtV13BzSj8H6Dk",
  "name": "MY_SERVICE_API_KEY",
  "description": "This is my API Key",
  "claims": {
    "foo": "bar"
  },
  "scopes": [
    "read",
    "write"
  ],
  "secret": "ak_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "revocation_reason": "Revoked by user",
  "expiration": 1716883200,
  "created_by": "user_2xhFjEI5X2qWRvtV13BzSj8H6Dk",
  "last_used_at": 1716883200,
  "created_at": 1716883200,
  "updated_at": 1716883200
}