POST /api-keys
Generate, list, and revoke API keys. Takes the account page's session token only — API keys and MCP access tokens cannot manage keys.
On this page 5
Summary
- endpoint —
POST /api-keys,GET /api-keys,DELETE /api-keys - purpose — generate, list, and revoke long-lived API keys for MCP clients and direct API access
- auth — the account page's session token (a Supabase session JWT) only — a
tm_API key, or a valid MCP OAuth access token, is rejected with 403 - limits — up to five active keys per account; not counted against the daily rate limits, and responses carry no
X-RateLimit-*headers - synchronous — yes (no polling, no webhooks)
Manages API keys for the authenticated user. Three methods, one path. Use POST to create a key, GET to list existing keys, and DELETE to revoke one by ID.
The account page calls these endpoints for you after you sign in. That is the normal way to manage keys. See Authentication for the three kinds of token.
Session token only — API keys cannot manage other API keys. Every request to /api-keys must use the session JWT the account page holds as the bearer token. A bearer token that starts with tm_ is rejected with 403 straight away. The OAuth access token an MCP client holds is checked first: a valid one is rejected with 403, and an expired or invalid one gets 401. This prevents a leaked server key from quietly creating or revoking other keys.
Generate a key
POST /api-keys
Creates a new API key. The plaintext key is returned once in the response body and is never stored or recoverable after that — copy it immediately.
Request headers
| Header | Required | Value |
|---|---|---|
Authorization | yes | Bearer <supabase-jwt> |
Content-Type | recommended | application/json. The body is read as JSON whether or not the header is sent. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
label | string | optional | Human-readable name for the key, e.g. "Claude Desktop" or "Cursor". Shown in the key list. At most 60 characters after surrounding spaces are trimmed. An empty label, or null, is stored as null. |
The body is optional. An account can hold at most five active keys; a sixth POST returns 409 until you revoke one.
Key creation can be limited to approved accounts. When it is, a signed-in account outside that list gets a 403 with Key creation is limited to approved accounts.
Response — 201
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Unique key ID. Use this to revoke the key later. |
prefix | string | First 11 characters of the key (tm_ + 8 hex chars). Shown in the key list so you can identify the key without the full value. |
label | string | null | The label you supplied, or null. |
api_key | string | The full plaintext key. This is the only time it appears. |
warning | string | Literal reminder: "This is the only time the full key will be shown. Store it now." |
One-time disclosure. The api_key field is absent from all other responses. TagManifest stores only the SHA-256 hash. If you lose the key, revoke it and generate a new one.
List keys
GET /api-keys
Returns all keys for the authenticated user, sorted newest first. Never returns plaintext key values — only metadata.
Request headers
| Header | Required | Value |
|---|---|---|
Authorization | yes | Bearer <supabase-jwt> |
Response — 200
{
"keys": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"key_prefix": "tm_a1b2c3d4",
"label": "Claude Desktop",
"created_at": "2026-05-04T09:27:13.000Z",
"last_used_at": "2026-05-04T13:25:53.000Z",
"revoked_at": null
}
]
}
Each object in keys contains:
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Key ID. Pass to DELETE /api-keys?id= to revoke. |
key_prefix | string | First 11 characters of the key — enough to identify it in the UI. |
label | string | null | User-supplied label. |
created_at | string (ISO 8601) | When the key was generated. |
last_used_at | string (ISO 8601) | null | When the key last authenticated a request. |
revoked_at | string (ISO 8601) | null | When the key was revoked. null means the key is still active. |
Revoke a key
DELETE /api-keys?id=<uuid>
Marks a key as revoked. Revoked keys are rejected immediately on any subsequent request. The key record is retained for audit purposes — it is not deleted from the database.
Request headers
| Header | Required | Value |
|---|---|---|
Authorization | yes | Bearer <supabase-jwt> |
Query parameters
| Param | Type | Required | Description |
|---|---|---|---|
id | string (UUID) | yes | The id of the key to revoke. Returned by POST /api-keys and GET /api-keys. |
Response — 200
{
"revoked": true,
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Errors
| Status | Body | Cause |
|---|---|---|
400 | { "error": "Missing required query param: id" } | DELETE called without the id query parameter. |
400 | { "error": "Invalid key id" } | DELETE called with an id that is not a UUID. |
400 | { "error": "label must be a string" } | POST with a label that is neither a string nor null. |
400 | { "error": "label must be 60 characters or fewer" } | POST with a label longer than 60 characters after surrounding spaces are trimmed. |
401 | { "error": "Missing or malformed Authorization header" } | No Authorization header, or the header does not start with Bearer . |
401 | { "error": "Invalid or expired token" } | The session token is expired, malformed, or not recognized. |
403 | { "error": "API keys cannot manage API keys — use a session JWT" } | The bearer token starts with tm_. It is refused on the prefix alone, before the key is looked up. |
403 | { "error": "MCP access tokens cannot manage API keys — use a session JWT" } | Request carried a valid access token from an MCP client. An expired or invalid one gets the 401 above. |
403 | { "error": "Key creation is limited to approved accounts." } | POST from a signed-in account that is not on the approved list, when key creation is limited to approved accounts. |
404 | { "error": "Key not found" } | DELETE targeted an id that does not exist or belongs to a different user. |
405 | { "error": "Method not allowed" } | A method other than POST, GET, DELETE or OPTIONS, sent with a valid session token. The token is checked first, so without one the answer is 401 or 403. OPTIONS returns 200 and needs no token. |
409 | { "error": "This account already has 5 active keys. Revoke one to create another." } | POST when the account already holds five active keys. |
413 | { "error": "Request body too large" } | POST body over 16 KB. |
500 | { "error": "Key generation failed" } | Internal error during key creation — retry once before reporting. |
500 | { "error": "Failed to list keys" } | Internal error during key listing — retry once before reporting. |
500 | { "error": "Revoke failed" } | Internal error during revocation — retry once before reporting. |
The 503 rate_limiter_unavailable response does not occur here. It comes only from the scan and rule endpoints, which are rate limited. See Errors.
See also
- Authentication — the three kinds of token and what each can do
- Rate limits — daily caps and rate-limit response headers
- API reference introduction — base URL, versioning, and error conventions
Examples
curl https://developer.tagmanifest.com/v1/api-keys \
-X POST \
-H "Authorization: Bearer $SUPABASE_JWT" \
-H "Content-Type: application/json" \
-d '{"label":"Claude Desktop"}'
const r = await fetch("https://developer.tagmanifest.com/v1/api-keys", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SUPABASE_JWT}`,
"Content-Type": "application/json"
},
body: JSON.stringify({ label: "Claude Desktop" })
});
const { api_key, id, prefix } = await r.json();
// Save api_key now — it will not be shown again.
curl https://developer.tagmanifest.com/v1/api-keys \
-H "Authorization: Bearer $SUPABASE_JWT"
const r = await fetch("https://developer.tagmanifest.com/v1/api-keys", {
headers: { Authorization: `Bearer ${process.env.SUPABASE_JWT}` }
});
const { keys } = await r.json();
curl "https://developer.tagmanifest.com/v1/api-keys?id=a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
-X DELETE \
-H "Authorization: Bearer $SUPABASE_JWT"
const r = await fetch(
`https://developer.tagmanifest.com/v1/api-keys?id=${keyId}`,
{
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.SUPABASE_JWT}` }
}
);
const { revoked, id } = await r.json();
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"prefix": "tm_a1b2c3d4",
"label": "Claude Desktop",
"api_key": "tm_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6",
"warning": "This is the only time the full key will be shown. Store it now."
}