Skip to main content
All API key endpoints require owner role.

List API keys

GET /api/v1/keys
page
integer
default:"1"
Page number
per_page
integer
default:"25"
Items per page (max 250)
sort
string
Sort field
order
string
default:"desc"
Sort order: asc or desc
The full API key value is only returned at creation time. The list endpoint shows key metadata (name, scope, prefix) but not the full key.

Create an API key

POST /api/v1/keys
name
string
required
Human-readable name for the key
scope
string
default:"full"
Scope: full or read_only
expires_at
string
Expiration date (ISO 8601 datetime)
Example
curl -X POST https://api.mosscrm.com/api/v1/keys \
  -H "X-API-Key: moss_k_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "ci-deploy", "scope": "full" }'

Response

{
  "data": {
    "id": "key_abc123",
    "name": "ci-deploy",
    "key": "moss_k_abc123def456...",
    "scope": "full",
    "created_at": "2026-02-08T12:00:00Z"
  }
}
Store the key value securely. It will not be shown again.

Revoke an API key

Immediately invalidates the key. Any requests using this key will return 401 Unauthorized.
DELETE /api/v1/keys/:id