API keys
Create, list and revoke the API keys your apps use.
List API keys (admin)
GET /v1/api-keys
curl -X GET https://api.ngamia.com/v1/api-keys \
-H "Authorization: Bearer $NGAMIA_TOKEN"Response 200 fields
| Field | Type | Required | Notes |
|---|---|---|---|
api_keys | array of object |
Responses
| Status | Meaning |
|---|---|
200 | Keys (secrets are never listed) |
Create an API key (admin)
POST /v1/api-keys
Request body (application/json)
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | yes | min length 1, max length 200 |
scopes | array of agents:read | agents:write | runs | knowledge:read | knowledge:write | yes | |
expires_in_days | integer | min 1, max 3650 |
curl -X POST https://api.ngamia.com/v1/api-keys \
-H "Authorization: Bearer $NGAMIA_TOKEN" \
-H 'content-type: application/json' \
-d '{"name": "web app", "scopes": []}'Response 201 fields
| Field | Type | Required | Notes |
|---|---|---|---|
api_key | object | ||
secret | string |
Responses
| Status | Meaning |
|---|---|
201 | Created. secret is shown only here; store it in your secret manager. |
400 | The request is invalid (invalid_request). |
403 | The role or key scope does not allow this (forbidden). |
Revoke an API key (admin)
DELETE /v1/api-keys/{id}
Parameters
| Parameter | In | Type | Notes |
|---|---|---|---|
id | path | string (uuid) | required |
curl -X DELETE https://api.ngamia.com/v1/api-keys/<id> \
-H "Authorization: Bearer $NGAMIA_TOKEN"Responses
| Status | Meaning |
|---|---|
204 | Revoked; the key stops working at once |
404 | Not found in this workspace (not_found). |