GET: list keys for an org. POST: create a new key.
URL
- User APIhttps://auth.mattering.io/api/organizations/{org_id}/api-keys/
Path parameters
| Name | Type |
|---|---|
org_id | uuid |
Query parameters
| Name | Default |
|---|---|
app_id | none |
Body keys (JSON)
| Key | Required | Default |
|---|---|---|
app_id | optional or conditional | none |
name | optional or conditional | none |
Keys the view reads. A key not in this list is ignored by the view. Where a key is required only for some actions (for example the action dispatch), the description above says which.
Responses
200 bare JSON object (no envelope)
{
"keys": [
{
"id": "...",
"name": "...",
"key_prefix": "...",
"key_suffix": "...",
"app_id": "...",
"app_slug": "...",
"app_name": "...",
"is_active": true,
"created_at": "2026-01-01T00:00:00Z",
"last_used_at": "2026-01-01T00:00:00Z",
"expires_at": "2026-01-01T00:00:00Z",
"request_count": 0,
"created_by": "..."
}
]
}
201 bare JSON object (no envelope)
{
"id": "...",
"name": "...",
"key": "...",
"key_prefix": "...",
"key_suffix": "...",
"app_id": "...",
"app_slug": "...",
"app_name": "...",
"created_at": "2026-01-01T00:00:00Z"
}
Field names come from the code; values are placeholders (... is a string, 0 a number, dates are ISO 8601).
Errors
| Status | Code |
|---|---|
| 400 | app_id is required message |
| 400 | name is required message |
| 404 | App not found or inactive message |
Example
curl -X POST "https://auth.mattering.io/api/organizations/ORG_ID/api-keys/" \
-H "Authorization: Bearer $MATTERING_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"app_id": "...",
"name": "..."
}'
Source: mattering_auth/api_key_views.py (api_key_views.OrgAPIKeyListCreateView)