API Keys

Create an API key

Mint a key for this workspace. The key itself is returned once; only its hash is stored. `expiresAt` makes it stop working at an instant (a key for a contractor or a one-off script); it stays listed until revoked.

POST
/v1/api-keys
AuthorizationBearer <token>

API key minted via POST /v1/api-keys (format mk_live_...)

In: header

name?string

A label for the key; "default" when omitted.

Length1 <= length <= 80
scope?string

read: GET only. write: everything.

Default"write"
Value in"read" | "write"
expiresAt?string

When the key stops working (ISO 8601, or epoch ms), for a key handed to a script or a contractor. Must be in the future. Omit or null for a key that never expires.

Formatdate-time

Response Body

application/json

application/json

application/json

curl -X POST "https://api.mentio.dev/v1/api-keys" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "name": "string",
  "prefix": "string",
  "scope": "read",
  "createdAt": "string",
  "lastUsedAt": "string",
  "expiresAt": "string",
  "key": "string"
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "retryAfterSeconds": 0
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "retryAfterSeconds": 0
  }
}