API keys
List, create and revoke publishable and secret API keys.
Keys are managed with a signed-in session; a secret key can't create or revoke keys. Admins manage every key. Developers can create only personal test keys and see and revoke only their own. See Authentication for how keys are used.
The key object#
| Field | Type | Description |
|---|---|---|
id |
uuid | Key id |
name |
string | Name |
prefix |
string | The start of the key, e.g. sk_live_Hq3v9T, to recognise it |
kind |
string | secret or publishable |
mode |
string | live or test |
scopes |
string[] | Scopes |
project_id |
uuid or null | The project it is bound to; null for org-wide |
created_by |
object or null | {id, name} |
personal |
boolean | A personal key belongs to its creator. Developers only see and revoke their personal keys. |
created_at |
datetime | Created |
last_used_at |
datetime or null | Last use (updated at most once a minute) |
List API keys#
/api/v1/orgs/{org_id}/api-keysActive keys in the current mode (set with Mendloop-Mode). Revoked keys aren't listed.
Auth: session only. Secret keys get 403 api_key_not_allowed. The role needs api_keys.create.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id |
uuid | required | Organization id |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit |
integer | optional | 1 to 200, default 50 |
cursor |
string | optional | next_cursor from the previous page |
Response
A page of key objects. The full key is never returned here.
curl "https://app.getmendloop.com/api/v1/orgs/ORG_ID/api-keys" \
--cookie "ml_session=…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/api-keys", {
headers: { Cookie: "ml_session=…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.get(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/api-keys",
cookies={"ml_session": "…"},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"items": [
{
"id": "0193a2c5-0a1b-7c2d-8e3f-4a5b6c7d8e9f",
"name": "CI source maps",
"prefix": "sk_live_Hq3v9T",
"kind": "secret",
"mode": "live",
"scopes": [
"sourcemaps:write"
],
"project_id": "0193a2c4-61b0-7d3e-9a15-7c2e4f8b1d02",
"created_by": {
"id": "0193a2c4-5e20-7c11-a3f0-6b9d2e4c8a15",
"name": "Priya Shah"
},
"personal": false,
"created_at": "2026-11-05T09:00:00Z",
"last_used_at": "2026-11-05T09:12:10Z"
}
],
"next_cursor": null
}Create an API key#
/api/v1/orgs/{org_id}/api-keysCreates a key. The full key is in secret and is shown only this once; store it now. Audit logged.
Auth: session only. Secret keys get 403 api_key_not_allowed. The role needs api_keys.create.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id |
uuid | required | Organization id |
Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | required | 1 to 200 characters |
mode |
string | required | live or test |
scopes |
string[] | required | 1 to 20 scopes. Publishable keys: events:write only. |
kind |
string | optional | secret (default) or publishable |
project_id |
uuid | optional | Bind the key to one project (a project of the same mode) |
personal |
boolean | optional | Make it your personal key. Default: true for Developers, false otherwise. Developers can only create personal test keys. |
Response
| Field | Type | Description |
|---|---|---|
… |
Every field of the key object | |
secret |
string | The full key. Shown once. |
Errors
| Status | Code | When |
|---|---|---|
| 422 | invalid_input |
Unknown scope, no scope, a publishable key with scopes other than events:write, or a project from another mode |
| 403 | permission_denied |
Your role can't create this key (e.g. a Developer creating a live key) |
curl -X POST "https://app.getmendloop.com/api/v1/orgs/ORG_ID/api-keys" \
--cookie "ml_session=…" \
-H "Content-Type: application/json" \
-d '{
"name": "CI source maps",
"mode": "live",
"scopes": [
"sourcemaps:write"
],
"project_id": "0193a2c4-61b0-7d3e-9a15-7c2e4f8b1d02"
}'const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/api-keys", {
method: "POST",
headers: { Cookie: "ml_session=…", "Content-Type": "application/json" },
body: JSON.stringify({
"name": "CI source maps",
"mode": "live",
"scopes": [
"sourcemaps:write"
],
"project_id": "0193a2c4-61b0-7d3e-9a15-7c2e4f8b1d02"
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.post(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/api-keys",
cookies={"ml_session": "…"},
json={
"name": "CI source maps",
"mode": "live",
"scopes": [
"sourcemaps:write"
],
"project_id": "0193a2c4-61b0-7d3e-9a15-7c2e4f8b1d02"
},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"id": "0193a2c5-0a1b-7c2d-8e3f-4a5b6c7d8e9f",
"name": "CI source maps",
"prefix": "sk_live_Hq3v9T",
"kind": "secret",
"mode": "live",
"scopes": [
"sourcemaps:write"
],
"project_id": "0193a2c4-61b0-7d3e-9a15-7c2e4f8b1d02",
"created_by": {
"id": "0193a2c4-5e20-7c11-a3f0-6b9d2e4c8a15",
"name": "Priya Shah"
},
"personal": false,
"created_at": "2026-11-05T09:00:00Z",
"last_used_at": null,
"secret": "sk_live_Hq3v9T…"
}Revoke an API key#
/api/v1/orgs/{org_id}/api-keys/{key_id}Revokes a key at once, for the REST API and for ingest. Audit logged.
Auth: session only. Secret keys get 403 api_key_not_allowed. The role needs api_keys.create.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id |
uuid | required | Organization id |
key_id |
uuid | required | Key id |
Errors
| Status | Code | When |
|---|---|---|
| 404 | api_key_not_found |
No such key, already revoked, in the other mode, or (for Developers) not yours |
curl -X DELETE "https://app.getmendloop.com/api/v1/orgs/ORG_ID/api-keys/KEY_ID" \
--cookie "ml_session=…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/api-keys/KEY_ID", {
method: "DELETE",
headers: { Cookie: "ml_session=…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);import requests
resp = requests.delete(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/api-keys/KEY_ID",
cookies={"ml_session": "…"},
timeout=30,
)
resp.raise_for_status()(empty body)