Skip to main content
POST
/
api
/
v1
/
keys
Create a new API key
curl --request POST \
  --url https://forge.gloo.ai/api/v1/keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "scopes": [
    "<string>"
  ],
  "label": "<string>",
  "expiresAt": 123
}
'
{
  "data": {
    "id": "<string>",
    "key": "<string>",
    "keyPrefix": "<string>",
    "interfaceId": "<string>",
    "label": "<string>",
    "scopes": [
      "<string>"
    ],
    "status": "<string>",
    "createdAt": 123,
    "expiresAt": 123
  },
  "meta": {
    "requestId": "<string>",
    "hasMore": true,
    "nextCursor": "<string>",
    "warning": "<string>"
  }
}

Authorizations

Authorization
string
header
required

API key from /api/v1/keys. Pass as Authorization: Bearer <key>.

Body

application/json
scopes
string[]
required

Scopes to grant (must be subset of caller scopes)

label
string

Optional human-readable label

Maximum string length: 128
expiresAt
number

Optional expiry as Unix timestamp in milliseconds

Response

201 - application/json

Key created (plaintext key shown once)

data
object
meta
object