The key object
idThe key’s id:
key_and 32 hex characters. It is not the secret.nameThe system that uses it.
kindsecret,restrictedorpublishable.modeliveortest. A test key makes test objects that never bill.prefixHow its secret starts:
kt_live_orkt_test_for a secret or restricted key,kt_pub_live_orkt_pub_test_for a publishable key (one made before 29 November 2026 startskt_pub_and keeps working). The secret is the prefix and 64 hex characters.last4The last four characters of its secret.
scopesFor a restricted key: what it may do, each
resource:readorresource:write, such asdocuments:writeorcases:read. Write includes read. Empty on other keys.originsFor a publishable key: the exact web addresses it works from. Empty on other keys.
allow_nativeFor a publishable key only: a native app, which sends no origin, may start a verification with it. A publishable key has at least one origin, or this set to
true.created_byWho made it: a member’s id (
mem_) or, for a device’s key, the provisioning key’s id (key_).created_atWhen it was made.
last_used_atWhen it last made a call, to within ten minutes, or
null.expires_atWhen it stops working, or
nullfor never.statusactive, orexpiredonce pastexpires_at(its calls are refused withkey_expired).old_secret_expires_atAfter a roll that kept the old secret working: when it stops.
nullotherwise.device_idFor a device’s restricted key: the device it was made for, or
null.labelsFor a device’s restricted key: the labels a bulk revoke selects by, or
null.secretOnly in the answer that makes or rolls the key. Store it then: it cannot be read again.
{
"id": "key_bf17a8a43ad428b8b6de567666b9a46b",
"name": "Document sync worker",
"kind": "restricted",
"mode": "live",
"prefix": "kt_live_",
"last4": "0f3c",
"scopes": ["documents:write", "cases:read"],
"origins": [],
"created_by": "mem_34e593e655241ff32e468c8e54ddd984",
"created_at": "2026-10-17T13:04:22Z",
"last_used_at": "2026-11-27T08:58:40Z",
"expires_at": "2027-04-16T00:00:00Z",
"status": "active",
"old_secret_expires_at": null,
"device_id": null,
"labels": null
}POST/v1/keys
A key for a server (secret or restricted) or for a page or an app (publishable), live or test.
- Who may
- Owner, Admin and Developer
- CLI
kontiga keys create --name <name> [--kind <secret|restricted|publishable>] [--mode <live|test>] [--scopes <scope,...>] [--origins <url,...>] [--allow-native]- MCP tool
create_api_key- Returns
- The key, and its secret shown once.
Parameters
nameRequiredName it after the system that uses it. At most 80 characters.
kindsecretfor a server,restrictedfor one job with only its scopes,publishablefor a page or an app. A key can do only what your role may in its mode: a kind or a scope past it is refused with 403.modeLive or test. Left out, the call’s own mode: the
Kontiga-Modeheader’s, or live. One oflive,test.scopesFor a restricted key: what it may do, each
resource:readorresource:write. Write includes read. At most 30 items.originsFor a publishable key: the exact addresses it works from, such as
https://apply.harbourline.example. At most 20 items.allow_nativeFor a publishable key:
truelets your iOS or Android app start a verification with it too (an app sends no origin). With it,originsmay be empty.
curl -X POST https://api.kontiga.com/v1/keys \
-H "Authorization: Bearer $KONTIGA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Loan origination server",
"kind": "secret",
"mode": "live"
}'POST /v1/keys
{
"id": "key_8972d33cc4bd488fe0c563a5a75f389b",
"name": "Loan origination server",
"kind": "secret",
"mode": "live",
"prefix": "kt_live_",
"last4": "0504",
"scopes": [],
"origins": [],
"created_by": "mem_34e593e655241ff32e468c8e54ddd984",
"created_at": "2026-11-27T11:30:00Z",
"last_used_at": null,
"expires_at": null,
"status": "active",
"old_secret_expires_at": null,
"device_id": null,
"labels": null,
"secret": "kt_live_6243686061587473ee05800066d90868143a94e1b583b1c06c42fcb5756b0504"
}GET/v1/keys
The workspace’s keys, live and test, each shown by its start and last four characters.
- Who may
- Owner, Admin and Developer
- CLI
kontiga keys list- MCP tool
list_api_keys- Returns
- The keys, never their secrets.
No parameters.
curl -X GET https://api.kontiga.com/v1/keys \
-H "Authorization: Bearer $KONTIGA_API_KEY"GET /v1/keys
{
"items": [
{
"id": "key_8972d33cc4bd488fe0c563a5a75f389b",
"name": "Loan origination server",
"kind": "secret",
"mode": "live",
"prefix": "kt_live_",
"last4": "174b",
"scopes": [],
"origins": [],
"created_by": "mem_34e593e655241ff32e468c8e54ddd984",
"created_at": "2026-11-27T11:30:00Z",
"last_used_at": "2026-11-27T11:40:11Z",
"expires_at": null,
"status": "active",
"old_secret_expires_at": "2026-11-28T11:35:00Z",
"device_id": null,
"labels": null
},
{
"id": "key_b293cb646d8c36a861354dec94fa964f",
"name": "Local development",
"kind": "secret",
"mode": "test",
"prefix": "kt_test_",
"last4": "9a1e",
"scopes": [],
"origins": [],
"created_by": "mem_34e593e655241ff32e468c8e54ddd984",
"created_at": "2026-10-02T09:12:45Z",
"last_used_at": "2026-11-26T03:40:09Z",
"expires_at": null,
"status": "active",
"old_secret_expires_at": null,
"device_id": null,
"labels": null
}
],
"next_cursor": null
}PATCH/v1/keys/{key_id}
Rename a key, change the scopes of a restricted key, or the origins of a publishable key and whether a native app may start with it. Its secret stays the same.
- Who may
- Owner, Admin and Developer
- CLI
kontiga keys update <key_id> [--name <name>] [--scopes <scope,...>] [--origins <url,...>] [--allow-native <true|false>]- MCP tool
update_api_key- Returns
- The key as it now stands, never its secret.
Parameters
key_idRequiredThe key to change. Its secret stays the same. In the path.
nameA new name. At most 80 characters.
scopesFor a restricted key: its new scopes, each one your role holds in the key’s mode. At most 30 items.
originsFor a publishable key: its new origins. At most 20 items.
allow_nativeFor a publishable key: whether a native app may start with it. Turning it off needs at least one origin left.
curl -X PATCH https://api.kontiga.com/v1/keys/key_bf17a8a43ad428b8b6de567666b9a46b \
-H "Authorization: Bearer $KONTIGA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"scopes": [
"documents:write",
"cases:read",
"people:read"
]
}'PATCH /v1/keys/{key_id}
{
"id": "key_bf17a8a43ad428b8b6de567666b9a46b",
"name": "Document sync worker",
"kind": "restricted",
"mode": "live",
"prefix": "kt_live_",
"last4": "0f3c",
"scopes": ["documents:write", "cases:read"],
"origins": [],
"created_by": "mem_34e593e655241ff32e468c8e54ddd984",
"created_at": "2026-10-17T13:04:22Z",
"last_used_at": "2026-11-27T08:58:40Z",
"expires_at": "2027-04-16T00:00:00Z",
"status": "active",
"old_secret_expires_at": null,
"device_id": null,
"labels": null
}POST/v1/keys/{key_id}/roll
Replace a key’s secret; the old one keeps working for the hours you give, up to 30 days, then stops.
- Who may
- Owner, Admin and Developer
- CLI
kontiga keys roll <key_id> [--expire-old-in-hours <0-720>]- MCP tool
roll_api_key- Returns
- The key with its new secret, shown once.
Parameters
key_idRequiredThe key whose secret to replace. Your role must hold everything the key can do, in its mode. In the path.
expire_old_in_hoursHow long the old secret keeps working, up to 720 hours (30 days). 0 stops it at once.
curl -X POST https://api.kontiga.com/v1/keys/key_8972d33cc4bd488fe0c563a5a75f389b/roll \
-H "Authorization: Bearer $KONTIGA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"expire_old_in_hours": 24
}'POST /v1/keys/{key_id}/roll
{
"id": "key_8972d33cc4bd488fe0c563a5a75f389b",
"name": "Loan origination server",
"kind": "secret",
"mode": "live",
"prefix": "kt_live_",
"last4": "174b",
"scopes": [],
"origins": [],
"created_by": "mem_34e593e655241ff32e468c8e54ddd984",
"created_at": "2026-11-27T11:30:00Z",
"last_used_at": "2026-11-27T11:34:10Z",
"expires_at": null,
"status": "active",
"old_secret_expires_at": "2026-11-28T11:35:00Z",
"device_id": null,
"labels": null,
"secret": "kt_live_c301af86f6fca145fac49f0dbe3ca95db5b1d11d755dceb2f8640aa63c9e174b"
}DELETE/v1/keys/{key_id}
Stop a key at once: every call made with it is refused from now on. It cannot be undone; make a new key instead.
- Who may
- Owner, Admin and Developer
- CLI
kontiga keys revoke <key_id>- MCP tool
revoke_api_key- Returns
- The key’s id, object key and deleted true: it stopped at once.
Parameters
key_idRequiredThe key to stop. Every call with it is refused from now on. This cannot be undone. The answer is the key’s id with
objectanddeleted: true, as every delete. In the path.
curl -X DELETE https://api.kontiga.com/v1/keys/key_b293cb646d8c36a861354dec94fa964f \
-H "Authorization: Bearer $KONTIGA_API_KEY"DELETE /v1/keys/{key_id}
{
"id": "key_b293cb646d8c36a861354dec94fa964f",
"object": "key",
"deleted": true
}GET/v1/key_usage
For each key: its requests in the last 24 hours and the last 7 days, its errors, when it was last used, and until when an old secret still works after a roll.
- Who may
- Owner, Admin and Developer
- CLI
kontiga keys usage [--key-id <key_id>]- MCP tool
get_api_key_usage- Returns
- One row per key, never a secret.
Parameters
key_idOne key. Every key when left out.
curl -X GET "https://api.kontiga.com/v1/key_usage?key_id=key_8972d33cc4bd488fe0c563a5a75f389b" \
-H "Authorization: Bearer $KONTIGA_API_KEY"GET /v1/key_usage
{
"items": [
{
"key_id": "key_8972d33cc4bd488fe0c563a5a75f389b",
"requests_24h": 2602,
"daily": [2310, 2475, 1980, 640, 512, 2390, 2602],
"errors_24h": 14,
"last_used_at": "2026-11-27T11:40:11Z",
"old_secret_expires_at": "2026-11-28T11:35:00Z"
}
],
"next_cursor": null
}