Apps API
Apps group the keys one integration uses. Turning an app off stops all its keys at once.
The same operations are in the interactive API reference, and the whole contract is in the OpenAPI document.
POST/v1/keys/{id}/revoke
Revoke a key
The developer console's form of DELETE /v1/keys/{id}: it revokes the same key and answers 204. Integrations should use the DELETE; this POST exists because the console's key table is built around app actions.
It is looser than the DELETE. It needs the key permission (a secret key, or a person with settings or developer-management rights) but does not additionally require an admin for live keys, and does not ask a signed-in person to enter their password again. Do not rely on that difference; it may be tightened to match the DELETE.
Revoking is permanent. A 404 means no such key in this organization, or a key that is already revoked: repeating the call answers 404, not 204.
Scope keys:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The resource id. |
Idempotency-Key | header | string | No | Makes a POST safe to repeat: the same key returns the first result for 24 hours. The same key with a different body is refused with `422 idempotency_key_reused`; while the first request still runs, `409 idempotency_in_progress`. |
GET/v1/apps
List apps
Lists the organization's apps, oldest first. An app groups the keys one integration uses; turning an app off stops all its keys at once. Each app says when and why it was turned off, if it is.
This GET can write. If the organization has no app yet it makes one called "My app", and it moves any keys made before apps existed into the first app. The first call may therefore be slightly slower; later calls change nothing.
Paged, oldest first: limit is 1 to 100 (default 50, out of range values are clamped) and cursor is the next_cursor of the previous page. The cursor is opaque and never built by the client; a cursor this API did not return is a 400. has_more is true while another page exists. There is no total.
Who may call it: a person with settings or developer-management rights, or a secret key. Restricted and publishable keys are refused.
Scope apps:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer | No | How many items to return. Default 50, at most 100. |
cursor | query | string | No | The `next_cursor` of the previous page. Opaque; never built by the client. |
POST/v1/apps
Create an app
Makes an app, an empty group of keys. Name it after the integration ("Order sync", "Shop widget") so that, when something misbehaves, the one app to turn off is obvious. The name is trimmed and must be 1 to 80 characters; otherwise 400. Names need not be unique.
Making an app makes no keys and costs nothing. Add keys with POST /v1/apps/{id}/keys.
Who may call it: a person with settings or developer-management rights, or a secret key.
Idempotency. Send Idempotency-Key with an API key; a retry then returns the first app instead of making a second one with the same name. Without it, repeating the call makes another app.
Scope apps:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | No | Makes a POST safe to repeat: the same key returns the first result for 24 hours. The same key with a different body is refused with `422 idempotency_key_reused`; while the first request still runs, `409 idempotency_in_progress`. |
GET/v1/apps/{id}/keys
List an app's keys
Lists the keys that belong to one app, including revoked ones, as the console shows them. The list never contains a secret, only the first characters (prefix). Paged, newest first: limit is 1 to 100 (default 50, out of range values are clamped) and cursor is the next_cursor of the previous page. The cursor is opaque and never built by the client; a cursor this API did not return is a 400. has_more is true while another page exists. There is no total.
Keys made before apps existed were moved into the organization's first app the first time apps were listed, so they appear under that app.
Who may call it: a person with settings or developer-management rights, or a secret key. A 404 means no app with that id in this organization. Read only; the call may create the default app if none exists yet, as listing apps does.
Scope apps:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The resource id. |
limit | query | integer | No | How many items to return. Default 50, at most 100. |
cursor | query | string | No | The `next_cursor` of the previous page. Opaque; never built by the client. |
POST/v1/apps/{id}/keys
Create a key for an app
Makes a key inside an app and returns it with its secret, shown this once. Only a hash is stored; a lost secret cannot be shown again, so roll or replace the key.
type is secret, restricted (give scopes, such as calls:read) or publishable (give domains, the sites allowed to use it). mode is test (simulated, nothing charged) or live (real numbers, paid from credit). A blank name becomes "Secret key", "Restricted key" or "Widget key" by type.
Live keys are held to a higher bar: the caller must be an admin or use a secret key, and a signed-in person must have entered their password again in the last five minutes, otherwise 403 reauthentication_required. A live organization with no credit can still make live keys; its live calls then fail with insufficient_credit. A sandbox organization cannot make live keys.
Making a key in a turned-off app is allowed, but the key will not work until the app is reinstated.
Idempotency. Send Idempotency-Key with an API key; a retry then returns the first response and the same secret instead of making a second key. Personal tokens and console sessions are not covered.
Scope apps:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The resource id. |
Idempotency-Key | header | string | No | Makes a POST safe to repeat: the same key returns the first result for 24 hours. The same key with a different body is refused with `422 idempotency_key_reused`; while the first request still runs, `409 idempotency_in_progress`. |
POST/v1/apps/{id}/disable
Turn an app off
Stops every key of the app at once, until the app is reinstated. It is the emergency switch for a leaked key or a runaway integration: no need to find and revoke keys one by one. Nothing is deleted, and keys come back as they were on reinstating. Calls already in progress finish.
A reason is required (1 to 500 characters) and is kept with the app so the team can see why. Without one, 400.
Do not turn off the app that owns the key you are calling with unless you mean to lock that integration out; reinstating needs another app's secret key or a person.
Permissions. A person with settings or developer-management rights, or a secret key. A signed-in person must also have entered their password again in the last five minutes (403 reauthentication_required).
Idempotent. Turning off an app that is already off keeps the original time, and replaces the stored reason with the new one. It is safe to repeat. Idempotency-Key is accepted with API keys.
Scope apps:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The resource id. |
Idempotency-Key | header | string | No | Makes a POST safe to repeat: the same key returns the first result for 24 hours. The same key with a different body is refused with `422 idempotency_key_reused`; while the first request still runs, `409 idempotency_in_progress`. |
POST/v1/apps/{id}/reinstate
Turn an app back on
Turns an app on again after disable: its keys work as they did, and the stored reason is cleared. Keys that were revoked while it was off stay revoked.
Permissions. A person with settings or developer-management rights, or a secret key. Unlike turning an app off, a signed-in person is not asked to enter their password again.
Safe to repeat: reinstating an app that is already on changes nothing and still answers { "disabled": false }. A 404 means no app with that id in this organization. If staff turned the app off, this call does not undo that; staff-side actions have their own surface.
Scope apps:write. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The resource id. |
Idempotency-Key | header | string | No | Makes a POST safe to repeat: the same key returns the first result for 24 hours. The same key with a different body is refused with `422 idempotency_key_reused`; while the first request still runs, `409 idempotency_in_progress`. |