Skip to content
Documentation/API reference
API · keys

Create API key

POST /api/v2/keys

Authorization

Owner/admin user session (use inboxit login). Use the CLI login flow; a workspace API key cannot call this operation.

Parameters

All resource access is checked against the selected workspace and user permissions.

NameTypeContract
namestring · required1–60 characters
scopesstring[] · requiredNonempty supported scopes; see Authentication
expires_in_daysinteger · optional1–365, default 30

Request

Run inboxit login first. The CLI supplies authenticated user credentials.

Example
inboxit keys create --data @request.json

JSON body

Save this JSON as request.json for the request above. Replace example values with your own.

Example
{
  "name": "Backend",
  "scopes": [
    "emails:send",
    "emails:read"
  ],
  "expires_in_days": 30
}

Response

HTTP 201. Example values are illustrative; excerpts are marked.

Example
{
  "id": "KEY_UUID",
  "name": "Backend",
  "prefix": "iit_…",
  "scopes": [
    "emails:send",
    "emails:read"
  ],
  "expires_at": "2026-11-22T12:00:00Z",
  "token": "iit_ONE_TIME_SECRET"
}

Behavior & errors

Ten active keys per account. Save token once; it is not recoverable from list responses. Common errors: 400 invalid input, 401 unauthenticated, 403 insufficient permission, 404 missing/inaccessible resource, 409 conflict, 429 rate/usage limit, 503 service unavailable. See Errors & retries for recovery guidance.