API keys
3 operations in the WP Waterfall API.
List API keys
get/api-keysPermalink to List API keys
- Scope:
keys:read - Permission:
api_keys.read
Lists the API keys of the signed-in person, whichever company is selected (ADR 211). A key belongs to a person and reaches all their companies or only the ones named in company_ids. The connection of an AI assistant may list them too when the person gave it the keys:read scope; the answer then marks the key the connection acts with (current) and the keys behind assistant connections (assistant_connection). A plain API key cannot call this route.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | How many rows to return in one page: at most 200, and 50 when left out. Default: 50. Range: 1 to 200. |
cursor | query | string | The next_cursor of the page before. Leave it out for the first page. |
Responses
| Status | Body | Description |
|---|---|---|
200 | ApiKeyList | API keys |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
401 | Problem | The credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme. |
403 | Problem | The credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing. |
422 | Problem | The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field. |
429 | Problem | A rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address. |
4XX | Problem | Problem Details (RFC 9457) |
200 response fields
| Name | Type | Description |
|---|---|---|
data required | array of ApiKey | The rows of this page. |
data[].id required | string (uuid) | |
data[].name required | string | |
data[].prefix required | string | |
data[].scopes required | array of string | |
data[].company_ids required | array or null | The companies the key reaches. Null means every company the person belongs to, now and later. A call names its company in the X-Company-Id header. |
data[].expires_at required | string or null (date-time) | |
data[].ip_allowlist required | array or null | |
data[].last_used_at required | string or null (date-time) | |
data[].created_at required | string (date-time) | |
data[].age_days | integer | Whole days since the key was made. Range: 0 to any. |
data[].revoked_at | string or null (date-time) | Set once the key is revoked. A revoked key stays in the list so activity can still name it. |
data[].revoked_reason | string or null | Why a key stopped: "creator left" when the person who made it was removed from the company or their account was deleted, "role changed" when a lower role left it with no scope it may hold. Null for a key a person revoked themselves. |
data[].effective_scopes | array or null | The scopes the key can use now. A key never does more than the person who made it, so a downgrade of that person's role takes scopes away. Null when the key works as it was made. |
data[].current | boolean | Only for a caller that is an AI assistant connection. current is true for the key that connection acts with, and assistant_connection is true for any key that backs an AI assistant connection. Both are left out for a signed-in person. |
data[].assistant_connection | boolean | |
next_cursor required | string or null | Send it as cursor to get the next page. Null on the last page. |
Create an API key
post/api-keysPermalink to Create an API key
- Scope:
keys:write - Permission:
api_keys.write - Needs a confirmation
A signed-in person makes a key with any scope their role allows in at least one company the key reaches; what it may do in a company is decided by their role there on every call. Send company_ids to limit it to some companies, or leave it out for every company the person belongs to, now and later. A call with the key names its company in the X-Company-Id header (optional when the key reaches one). The connection of an AI assistant may make one when the person gave it the keys:write scope and sends confirm: true. A key made that way never holds more scopes than the connection or the person's role, never danger:destroy, and never a connection only scope (keys:read, keys:write, ssh-keys:read, ssh-keys:write). It always expires: 30 days when expires_at is left out, 365 days at most. The secret is shown once, in this answer. A plain API key cannot call this route.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key required | header | string | Send a fresh unique value on every POST: a POST without it answers 422. The answer is stored for 24 hours, so a retry with the same key and body returns the first answer, and the same key with a different body returns 422. |
confirm | query | string | An API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing. One of: true. |
Request body application/json, required, CreateApiKeyRequest
Fields
| Name | Type | Description |
|---|---|---|
name required | string | |
scopes required | array of string | |
expires_at | string (date-time) | |
ip_allowlist | array of string | |
company_ids | array of string | The companies the key reaches. Left out, it reaches every company the person belongs to, now and later. Each id must be a company the person belongs to. At most 100. |
confirm | boolean | A key lasts one year when expires_at is left out. An expires_at more than a year away needs confirm: true. For an AI assistant connection only: the person's yes. The server refuses a key made through a connection without it. A signed-in person leaves it out. |
Responses
| Status | Body | Description |
|---|---|---|
201 | CreatedApiKey | The key, with its secret shown once |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
401 | Problem | The credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme. |
403 | Problem | The credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing. |
409 | Problem | The current state does not allow this: the same change is already running, or another change got there first. |
422 | Problem | The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field. |
429 | Problem | A rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address. |
4XX | Problem | Problem Details (RFC 9457) |
201 response fields
| Name | Type | Description |
|---|---|---|
id required | string (uuid) | |
name required | string | |
prefix required | string | |
scopes required | array of string | |
company_ids required | array or null | The companies the key reaches. Null means every company the person belongs to, now and later. A call names its company in the X-Company-Id header. |
expires_at required | string or null (date-time) | |
ip_allowlist required | array or null | |
last_used_at required | string or null (date-time) | |
created_at required | string (date-time) | |
age_days | integer | Whole days since the key was made. Range: 0 to any. |
revoked_at | string or null (date-time) | Set once the key is revoked. A revoked key stays in the list so activity can still name it. |
revoked_reason | string or null | Why a key stopped: "creator left" when the person who made it was removed from the company or their account was deleted, "role changed" when a lower role left it with no scope it may hold. Null for a key a person revoked themselves. |
effective_scopes | array or null | The scopes the key can use now. A key never does more than the person who made it, so a downgrade of that person's role takes scopes away. Null when the key works as it was made. |
current | boolean | Only for a caller that is an AI assistant connection. current is true for the key that connection acts with, and assistant_connection is true for any key that backs an AI assistant connection. Both are left out for a signed-in person. |
assistant_connection | boolean | |
secret required | string |
Revoke an API key
delete/api-keys/{id}Permalink to Revoke an API key
- Scope:
keys:write - Permission:
api_keys.write - Needs a confirmation
A signed-in person revokes one of their own keys. The connection of an AI assistant may revoke a key when it holds the keys:write scope and sends confirm=true. It cannot revoke the key behind another assistant connection. Revoking the key it acts with also ends its connection and needs confirm_self=true. A plain API key cannot call this route.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string (uuid) | The id of the API key. |
confirm | query | string | The person's yes. A connection that revokes without it gets a 422. A session leaves it out. One of: true. |
confirm_self | query | string | Needed to revoke the key the connection itself acts with, which ends the connection. One of: true. |
Responses
| Status | Body | Description |
|---|---|---|
204 | Revoked | |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
401 | Problem | The credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme. |
403 | Problem | The credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing. |
404 | Problem | The thing in the path does not exist, or it belongs to another company. The answer is the same for both. |
409 | Problem | The current state does not allow this: the same change is already running, or another change got there first. |
422 | Problem | The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field. |
429 | Problem | A rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address. |
4XX | Problem | Problem Details (RFC 9457) |