Skip to the documentation
MCP server

Keys and webhooks

The credentials and endpoints this workspace has issued.

Keys and webhooks tools

ToolWhat it does
listApiKeysEvery API key this workspace has issued, what it may do and what it may send as, in a masked form that is enough to tell two keys apart and nothing more. Returned a page at a time. query searches the name, the masked key, the id, the scopes and what a key is limited to.
listWebhooksEvery webhook endpoint this workspace has, where it posts, whether it is enabled and which events it asked for. Signing secrets are never shown. Returned a page at a time. query searches the URL, the description, the id, the events and the addresses and domains it names.
listWebhookEventsEvery event an endpoint can subscribe to, grouped by family, with a line saying when each one fires.
listApiKeyRequestsThe request log of the workspace’s keys, newest first: method, path, status, error code, duration, IP and user agent. Narrow it to one key, to failed calls, to exact status codes, to one route, or to a window. Returned a page at a time.
listApiKeyActivityWhat happened to the keys, newest first: created, updated, rotated, switched off or on, revoked, deleted and refused, and who did it. Returned a page at a time.
createApiKeyCreate an API key with its scopes, role, send scope, IP allowlist and expiry, and get its secret once. The owner only. A chat always asks first.
updateApiKeyRename a key, replace its scopes, send scope or IP allowlist, or switch it off and on. The owner only. A chat always asks first.
rotateApiKeyGive a key a new secret, shown once. The old one stops working at once. The owner only. A chat always asks first.
revokeApiKeyRevoke a key for good, with a reason if you like. The owner only. A chat always asks first.
deleteApiKeyRemove a revoked key. Its log and activity stay. The owner only. A chat always asks first.
listWebhookDeliveriesThe delivery log of one endpoint or of all of them, newest first, narrowed to delivered or failed and to a window. Returned a page at a time.
getWebhookDeliveryOne delivery in full: the body that was sent, what the receiver answered, every try of the event, and whether a replay would be accepted.
replayWebhookDeliverySend one event again, now, with its original id and a fresh signature. It always asks before it runs.
listWebhookDeadLettersThe events one endpoint gave up on, newest first: the open ones by default, or the replayed and discarded ones. Returned a page at a time.
replayWebhookDeadLettersSend up to 100 dead letters of one endpoint again, the named ones or the oldest open ones, and report what happened to each. It always asks before it runs.
discardWebhookDeadLetterClose one dead letter without sending it. The event stays in the delivery log. It always asks before it runs.
listWebhookActivityWhat happened to the webhooks, newest first: created, changed, switched off or on, secret rotated, tested, replayed and removed, and who did it. Returned a page at a time.
getWebhookOne webhook endpoint: where it posts, whether it is on, which events it wants and which addresses it hears about.
createWebhookAdd a webhook endpoint with the events it wants and, if you like, allowlists, the message content or a link to the source of arriving mail, and a retry policy. The signing secret is shown once.
updateWebhookChange an endpoint’s URL, events, description, allowlists, retry policy or whether arriving mail carries its content or a link to its source, or switch it on or off.
deleteWebhookRemove a webhook endpoint. Its log and history stay. A chat always asks first.
rotateWebhookSecretGive an endpoint a new signing secret, shown once. The old one keeps signing beside it for 24 hours.
testWebhookPost one signed test event to an endpoint now and report what it answered. A chat always asks first.
getWebhookStatsHow the deliveries went inside a window: attempts, delivered and failed, a series, the events sent and the response codes.
getApiKeyStatsWhat the keys did inside a window: the mail they sent, refused calls, requests and failures, the routes called most and the status codes.

A secret is shown once, when a key or a webhook endpoint is made or its secret is rotated, and nothing recovers it afterwards. createApiKey, rotateApiKey, createWebhook and rotateWebhookSecret are the tools here that return one, and a chat does not keep it. After a rotation the old webhook secret keeps signing for 24 hours, so hand the receiver the new one within the day, while a rotated key stops working at once. The assistant in the app does not rotate webhook secrets.

createApiKey, updateApiKey, rotateApiKey, revokeApiKey and deleteApiKey change keys as Console → API keys does, for the workspace owner, in the chat of the app, which always asks first. An MCP session never offers them: it runs on the OAuth access token of an app somebody connected, no app is ever given keys:manage, and the REST API refuses an app every change to a key with api_key_only. A program changes keys over the REST API instead, with an API key that holds keys:manage, in its own workspace or, with workspaceId, in another workspace the account owns, such as one POST /workspaces just made. Switching a key off is the reversible step and revoking it the permanent one.

A key never reaches further than whoever makes it: over the REST API a new or changed key sits inside the key making the call, and a key limited by a role or an allowlist reaches only its own workspace. An agent that creates an account with POST /signups gets a key for the new account from the code the person reads to it. The webhook tools act exactly as /webhooks on the REST API does, and need the owner or someone whose role reaches every address, through an app that reaches every address.

The key list and logs answer for the owner, or someone whose role holds api-keys:read and reaches every address, and the webhook logs and deliveries for the owner or someone whose role reaches every address, in both cases through an app that reaches every address, because a delivery body names the addresses the event is about. replayWebhookDelivery reaches a real receiver, so the assistant in the app always shows a card to approve it and a client should ask first as well. It is refused with retry_in_flight while an automatic retry of the event is being sent and with replay_in_flight while another replay of it is.

An event whose last automatic attempt fails is kept as a dead letter of its endpoint for 30 days. replayWebhookDeadLetters and discardWebhookDeadLetter change things, so a chat always shows a card to approve them, and replaying is refused while the endpoint is switched off.

Some tools on this server make a change the REST API guards with a verification code, and ask for the same code. Until the client has verified a code in the last 60 minutes, or the person has chosen Allow changes for 60 minutes on it in Account → Connected apps, such a tool answers with a result that starts Refused (step_up_required): and changes nothing. beginStepUp asks for a code, verifyStepUp checks the one the person gives, and getStepUpStatus says whether the client is verified. emptyAudience never asks for a code. The API Authentication page lists every tool that asks.

Reference

listApiKeys

Scopesapi-keys:readThe app's assistant runs it without askingToolkitworkspace

Every API key this workspace has issued, what it may do and what it may send as. The secret is shown once, when the key is made or rotated, and nothing recovers it afterwards, so what you get here is a masked form that is enough to tell two keys apart and nothing more. Send scope is the line worth reading: a key with no scope set may send as any address the workspace owns, and a key that names domains or addresses also reads only the sent mail, tracking and calendar of that same set. query searches the name, the masked key, the id, the scopes and the addresses, domains and IP addresses a key is limited to. One page at a time: when more follow, the last line gives a cursor to pass back for the next page.

Inputs

limitinteger
At least 1At most 100
cursorstring
querystring

Words to search for. Every word has to appear somewhere on the row, ignoring case and accents, and close spellings count when nothing matches exactly. Pass the same query with the cursor for the next page.

Up to 200 characters

Also available in

API
GET /keysGET /keys/{id}
TypeScript
keys.list()keys.listAll()keys.iterate()keys.get()
Python
keys.list()keys.list_all()keys.iterate()keys.get()
Ruby
keys.listkeys.list_allkeys.iteratekeys.get
PHP
keys->listkeys->listAllkeys->iteratekeys->get
Go
Keys.ListKeys.ListAllKeys.IterateKeys.Get
Java
keys().listkeys().listAllkeys().iteratekeys().get
C#
Keys.ListAsyncKeys.ListAllAsyncKeys.IterateAsyncKeys.GetAsync

listWebhooks

Scopeswebhooks:readThe app's assistant runs it without askingToolkitworkspace

Every webhook endpoint this workspace has, where it posts, whether it is enabled, which events it asked for and which addresses it hears about. An endpoint with no events listed receives every email event except email.replied, and one that names no addresses hears about every address this workspace owns. A delivery is tried up to 8 times over about 27 and a half hours, or 16 times over about 3 days on the extended retry policy, before it is given up on and kept as a dead letter, which replayWebhookDeadLetters sends again. An endpoint whose deliveries have all failed a hundred events in a row is disabled automatically, with the reason and the time shown here. Signing secrets are never shown. query searches the URL, the description, the id, the events and the addresses and domains an endpoint names. One page at a time: when more follow, the last line gives a cursor to pass back for the next page.

Inputs

limitinteger
At least 1At most 100
cursorstring
querystring

Words to search for. Every word has to appear somewhere on the row, ignoring case and accents, and close spellings count when nothing matches exactly. Pass the same query with the cursor for the next page.

Up to 200 characters

Also available in

API
GET /webhooksGET /webhooks/{id}
TypeScript
webhooks.list()webhooks.listAll()webhooks.iterate()webhooks.get()
Python
webhooks.list()webhooks.list_all()webhooks.iterate()webhooks.get()
Ruby
webhooks.listwebhooks.list_allwebhooks.iteratewebhooks.get
PHP
webhooks->listwebhooks->listAllwebhooks->iteratewebhooks->get
Go
Webhooks.ListWebhooks.ListAllWebhooks.IterateWebhooks.Get
Java
webhooks().listwebhooks().listAllwebhooks().iteratewebhooks().get
C#
Webhooks.ListAsyncWebhooks.ListAllAsyncWebhooks.IterateAsyncWebhooks.GetAsync

listWebhookEvents

Scopeswebhooks:readThe app's assistant runs it without askingToolkitworkspace

Every event an endpoint in this workspace can subscribe to, with a line saying when each one fires. Events are grouped by family: email events describe one message, domain events describe a domain changing state, and suppression events describe the list of addresses this workspace may no longer send to. An endpoint that names no events receives every email event except email.replied, so email.replied and the domain and suppression families only reach an endpoint that asks for them by name.

Inputs

Takes no input.

Also available in

API
GET /webhooks/events
TypeScript
webhooks.listEvents()
Python
webhooks.list_events()
Ruby
webhooks.list_events
PHP
webhooks->listEvents
Go
Webhooks.ListEvents
Java
webhooks().listEvents
C#
Webhooks.ListEventsAsync

listApiKeyRequests

Scopesapi-keys:readThe app's assistant runs it without askingToolkitworkspace

The request log of the API keys in this workspace, newest first: every authenticated REST call a key made, with its method, path, status, error code, duration, IP and user agent. Never a body or a query string. Nothing is pruned, so the log reaches back to the first call. Narrow it to one key with keyId or to several with keyIds, to failed calls (status 400 and up) with failedOnly, to exact status codes with statuses, to one route with path, and to a window with since and until. The filters combine. path matches the route rather than the exact path: ids and addresses in it count as :id and :address, so /emails/:id reads every call to one email, and a path ending in * reads every route that starts with it. Calls made with an OAuth access token are not in it. One page at a time: when more follow, the last line gives a cursor to pass back for the next page.

Inputs

keyIdstring
Not empty
keyIdsstring[]

Only these keys, at most 50. keyId adds one more.

Up to 50 items
failedOnlyboolean
statusesinteger[]

Only calls answered with one of these HTTP status codes, such as [401, 403].

Up to 20 items
pathstring

Only calls to this route, such as /emails or /emails/:id. End it with * to match every route that starts with it, such as /emails/*.

sincestring

Only rows at or after this ISO 8601 instant, such as 2026-09-01T00:00:00Z.

untilstring

Only rows before this ISO 8601 instant.

limitinteger
At least 1At most 100
cursorstring

Also available in

API
GET /keys/requestsGET /keys/{id}/requests
TypeScript
keys.listWorkspaceRequests()keys.listAllWorkspaceRequests()keys.iterateWorkspaceRequests()keys.listRequests()keys.listAllRequests()keys.iterateRequests()
Python
keys.list_workspace_requests()keys.list_all_workspace_requests()keys.iterate_workspace_requests()keys.list_requests()keys.list_all_requests()keys.iterate_requests()
Ruby
keys.list_workspace_requestskeys.list_all_workspace_requestskeys.iterate_workspace_requestskeys.list_requestskeys.list_all_requestskeys.iterate_requests
PHP
keys->listWorkspaceRequestskeys->listAllWorkspaceRequestskeys->iterateWorkspaceRequestskeys->listRequestskeys->listAllRequestskeys->iterateRequests
Go
Keys.ListWorkspaceRequestsKeys.ListAllWorkspaceRequestsKeys.IterateWorkspaceRequestsKeys.ListRequestsKeys.ListAllRequestsKeys.IterateRequests
Java
keys().listWorkspaceRequestskeys().listAllWorkspaceRequestskeys().iterateWorkspaceRequestskeys().listRequestskeys().listAllRequestskeys().iterateRequests
C#
Keys.ListWorkspaceRequestsAsyncKeys.ListAllWorkspaceRequestsAsyncKeys.IterateWorkspaceRequestsAsyncKeys.ListRequestsAsyncKeys.ListAllRequestsAsyncKeys.IterateRequestsAsync

listApiKeyActivity

Scopesapi-keys:readThe app's assistant runs it without askingToolkitworkspace

What happened TO the API keys in this workspace, newest first: created, updated, rotated, switched off or on, revoked, deleted, and every refused attempt to authenticate with one. Each row says who did it, a person as @username or a key as "API key <name>", and what changed. Narrow it with keyId or keyIds, since and until. One page at a time: when more follow, the last line gives a cursor to pass back for the next page.

Inputs

keyIdstring
Not empty
keyIdsstring[]

Only these keys, at most 50. keyId adds one more.

Up to 50 items
sincestring

Only rows at or after this ISO 8601 instant, such as 2026-09-01T00:00:00Z.

untilstring

Only rows before this ISO 8601 instant.

limitinteger
At least 1At most 100
cursorstring

Also available in

API
GET /keys/activityGET /keys/{id}/activity
TypeScript
keys.listWorkspaceActivity()keys.listAllWorkspaceActivity()keys.iterateWorkspaceActivity()keys.listActivity()keys.listAllActivity()keys.iterateActivity()
Python
keys.list_workspace_activity()keys.list_all_workspace_activity()keys.iterate_workspace_activity()keys.list_activity()keys.list_all_activity()keys.iterate_activity()
Ruby
keys.list_workspace_activitykeys.list_all_workspace_activitykeys.iterate_workspace_activitykeys.list_activitykeys.list_all_activitykeys.iterate_activity
PHP
keys->listWorkspaceActivitykeys->listAllWorkspaceActivitykeys->iterateWorkspaceActivitykeys->listActivitykeys->listAllActivitykeys->iterateActivity
Go
Keys.ListWorkspaceActivityKeys.ListAllWorkspaceActivityKeys.IterateWorkspaceActivityKeys.ListActivityKeys.ListAllActivityKeys.IterateActivity
Java
keys().listWorkspaceActivitykeys().listAllWorkspaceActivitykeys().iterateWorkspaceActivitykeys().listActivitykeys().listAllActivitykeys().iterateActivity
C#
Keys.ListWorkspaceActivityAsyncKeys.ListAllWorkspaceActivityAsyncKeys.IterateWorkspaceActivityAsyncKeys.ListActivityAsyncKeys.ListAllActivityAsyncKeys.IterateActivityAsync

createApiKey

Scopeskeys:manageThe app's assistant always asks firstToolkitworkspace

Create an API key for this workspace, as Console → API keys does, and get its secret, shown this once. scopes say what it may do, a role caps it, the allowlists limit what it may send as and the IP allowlist where it works from. A key acts for the workspace owner, so only the owner can create one. A chat always asks first, and a program creates keys over the REST API instead.

Inputs

namestringRequired
1 to 60 characters
scopesstring[]

What the key may do, as scopes. Left out, emails:send. What you pass replaces what it had.

At least one itemOne of"emails:send""emails:read""drafts:read""drafts:write""threads:read""threads:write""files:read""files:write""labels:read""labels:write""contacts:read""contacts:write""audiences:read""audiences:write""calendar:read""calendar:write""templates:read""templates:write""domains:read""domains:write""webhooks:read""webhooks:write""rules:read""rules:write""connections:read""members:read""members:write""roles:read""roles:write""settings:read""settings:write""keys:write""keys:read""keys:manage""forms:read""forms:write""knowledge:read""knowledge:write""automations:read""automations:write""tasks:read""tasks:write""connectors:read""connectors:use""connectors:write""billing:read""billing:write""account:read""account:write"
roleIdstring

A role of this workspace that caps the key, by the id listRoles gives. Left out, none.

1 to 64 characters
addressAllowliststring[]

Single addresses the key may send as. Left out together with domainAllowlist, every address the workspace owns.

Up to 50 items
domainAllowliststring[]

Whole domains the key may send as, addresses added to them later included.

Up to 25 items
ipAllowliststring[]

IP addresses or CIDR ranges the key works from. Left out, anywhere. An empty list lets it work from anywhere again.

Up to 50 items
expiresInMinutesinteger

Minutes until the key expires. Left out, it never does.

At least 5At most 5256000

Also available in

API
POST /keys
TypeScript
keys.create()
Python
keys.create()
Ruby
keys.create
PHP
keys->create
Go
Keys.Create
Java
keys().create
C#
Keys.CreateAsync

updateApiKey

Scopeskeys:manageThe app's assistant always asks firstToolkitworkspace

Change an API key of this workspace: rename it, replace its scopes, its send scope or its IP allowlist, or switch it off and back on with enabled. A list you pass replaces what the key had, and anything left out stays as it was. Switching a key off is the reversible step, and revokeApiKey the permanent one. A revoked key cannot be changed. Only the workspace owner can change keys. A chat always asks first.

Inputs

keyIdstringRequired

The key, by the id listApiKeys gives.

1 to 64 characters
namestring
1 to 60 characters
scopesstring[]

What the key may do, as scopes. Left out, emails:send. What you pass replaces what it had.

At least one itemOne of"emails:send""emails:read""drafts:read""drafts:write""threads:read""threads:write""files:read""files:write""labels:read""labels:write""contacts:read""contacts:write""audiences:read""audiences:write""calendar:read""calendar:write""templates:read""templates:write""domains:read""domains:write""webhooks:read""webhooks:write""rules:read""rules:write""connections:read""members:read""members:write""roles:read""roles:write""settings:read""settings:write""keys:write""keys:read""keys:manage""forms:read""forms:write""knowledge:read""knowledge:write""automations:read""automations:write""tasks:read""tasks:write""connectors:read""connectors:use""connectors:write""billing:read""billing:write""account:read""account:write"
addressAllowliststring[]

Single addresses the key may send as. Left out together with domainAllowlist, every address the workspace owns.

Up to 50 items
domainAllowliststring[]

Whole domains the key may send as, addresses added to them later included.

Up to 25 items
ipAllowliststring[]

IP addresses or CIDR ranges the key works from. Left out, anywhere. An empty list lets it work from anywhere again.

Up to 50 items
enabledboolean

False switches the key off, true switches it back on. Reversible, unlike revoking.

Also available in

API
PATCH /keys/{id}
TypeScript
keys.update()
Python
keys.update()
Ruby
keys.update
PHP
keys->update
Go
Keys.Update
Java
keys().update
C#
Keys.UpdateAsync

rotateApiKey

Scopeskeys:manageThe app's assistant always asks firstToolkitworkspace

Give an API key of this workspace a new secret, shown this once. The old secret stops working the moment this answers, with no overlap, and everything else about the key stays. A revoked or expired key cannot be rotated. Only the workspace owner can rotate keys. A chat always asks first.

Inputs

keyIdstringRequired

The key, by the id listApiKeys gives.

1 to 64 characters

Also available in

API
POST /keys/{id}/rotate
TypeScript
keys.rotate()
Python
keys.rotate()
Ruby
keys.rotate
PHP
keys->rotate
Go
Keys.Rotate
Java
keys().rotate
C#
Keys.RotateAsync

revokeApiKey

Scopeskeys:manageThe app's assistant always asks firstToolkitworkspace

Revoke an API key of this workspace for good: every later call with it is refused, and it can never be switched back on, rotated or changed. updateApiKey with enabled false is the reversible step. Revoking a key that is already revoked changes nothing. Only the workspace owner can revoke keys. A chat always asks first.

Inputs

keyIdstringRequired

The key, by the id listApiKeys gives.

1 to 64 characters
reasonstring

Why the key is revoked, kept on the key.

Up to 200 characters

Also available in

API
POST /keys/{id}/revoke
TypeScript
keys.revoke()
Python
keys.revoke()
Ruby
keys.revoke
PHP
keys->revoke
Go
Keys.Revoke
Java
keys().revoke
C#
Keys.RevokeAsync

deleteApiKey

Scopeskeys:manageThe app's assistant always asks firstToolkitworkspace

Delete an API key of this workspace that has already been revoked. Its request log and activity stay, under Deleted key. A key that has not been revoked is refused, so revoke it first. Only the workspace owner can delete keys. A chat always asks first.

Inputs

keyIdstringRequired

The key, by the id listApiKeys gives.

1 to 64 characters

Also available in

API
DELETE /keys/{id}
TypeScript
keys.delete()
Python
keys.delete()
Ruby
keys.delete
PHP
keys->delete
Go
Keys.Delete
Java
keys().delete
C#
Keys.DeleteAsync

listWebhookDeliveries

Scopeswebhooks:readThe app's assistant runs it without askingToolkitworkspace

The delivery log of this workspace’s webhooks, newest first: one row per POST, with the event, the answer the receiver gave, how long it took, which try it was and when the next automatic retry is due. Nothing is pruned, so it reaches the first delivery. Leave endpointId and endpointIds out to read every endpoint at once, or name one or several. status narrows to delivered or failed, and since and until to a window. The body that was sent is not here; getWebhookDelivery reads it. One page at a time: when more follow, the last line gives a cursor to pass back for the next page.

Inputs

endpointIdstring
Not empty
endpointIdsstring[]

Only these webhooks, at most 50. endpointId adds one more.

Up to 50 items
statusstring
One of"delivered""failed"
sincestring

Only rows at or after this ISO 8601 instant, such as 2026-09-01T00:00:00Z.

untilstring

Only rows before this ISO 8601 instant.

limitinteger
At least 1At most 100
cursorstring

Also available in

API
GET /webhooks/deliveriesGET /webhooks/{id}/deliveries
TypeScript
webhooks.listWorkspaceDeliveries()webhooks.listAllWorkspaceDeliveries()webhooks.iterateWorkspaceDeliveries()webhooks.listDeliveries()webhooks.listAllDeliveries()webhooks.iterateDeliveries()
Python
webhooks.list_workspace_deliveries()webhooks.list_all_workspace_deliveries()webhooks.iterate_workspace_deliveries()webhooks.list_deliveries()webhooks.list_all_deliveries()webhooks.iterate_deliveries()
Ruby
webhooks.list_workspace_deliverieswebhooks.list_all_workspace_deliverieswebhooks.iterate_workspace_deliverieswebhooks.list_deliverieswebhooks.list_all_deliverieswebhooks.iterate_deliveries
PHP
webhooks->listWorkspaceDeliverieswebhooks->listAllWorkspaceDeliverieswebhooks->iterateWorkspaceDeliverieswebhooks->listDeliverieswebhooks->listAllDeliverieswebhooks->iterateDeliveries
Go
Webhooks.ListWorkspaceDeliveriesWebhooks.ListAllWorkspaceDeliveriesWebhooks.IterateWorkspaceDeliveriesWebhooks.ListDeliveriesWebhooks.ListAllDeliveriesWebhooks.IterateDeliveries
Java
webhooks().listWorkspaceDeliverieswebhooks().listAllWorkspaceDeliverieswebhooks().iterateWorkspaceDeliverieswebhooks().listDeliverieswebhooks().listAllDeliverieswebhooks().iterateDeliveries
C#
Webhooks.ListWorkspaceDeliveriesAsyncWebhooks.ListAllWorkspaceDeliveriesAsyncWebhooks.IterateWorkspaceDeliveriesAsyncWebhooks.ListDeliveriesAsyncWebhooks.ListAllDeliveriesAsyncWebhooks.IterateDeliveriesAsync

getWebhookDelivery

Scopeswebhooks:readThe app's assistant runs it without askingToolkitworkspace

One webhook delivery in full: the JSON body that was POSTed (without the message content an endpoint with includeContent receives), the first 2,000 characters the receiver answered, every try of the same event on that endpoint, when the next automatic retry is due, and whether replayWebhookDelivery would send it again (and if not, why). The body names the addresses the event is about, so only the owner of the workspace, or someone whose role reaches every address, can read it, through an app that reaches every address.

Inputs

deliveryIdstringRequired
1 to 64 characters

Also available in

API
GET /webhooks/{id}/deliveries/{deliveryId}
TypeScript
webhooks.getDelivery()
Python
webhooks.get_delivery()
Ruby
webhooks.get_delivery
PHP
webhooks->getDelivery
Go
Webhooks.GetDelivery
Java
webhooks().getDelivery
C#
Webhooks.GetDeliveryAsync

replayWebhookDelivery

Scopeswebhooks:writeThe app's assistant always asks firstToolkitworkspace

Send one webhook event again, now, with its original id, type, createdAt and data, and a fresh signature. It reaches a real receiver, so confirm with the person before calling it, every time. One event per call; replayWebhookDeadLetters sends every event whose last attempt failed, and a delivered replay closes the dead letter of its event. It is refused with retry_in_flight while an automatic retry of the same event is being sent, with replay_in_flight while another replay of it is, and when the endpoint is switched off, no longer listens for the event, no longer covers its address, or the delivery has no stored body. Only the owner of the workspace, or someone whose role reaches every address, can replay, through an app that reaches every address.

Inputs

deliveryIdstringRequired
1 to 64 characters

Also available in

API
POST /webhooks/{id}/deliveries/{deliveryId}/replay
TypeScript
webhooks.replayDelivery()
Python
webhooks.replay_delivery()
Ruby
webhooks.replay_delivery
PHP
webhooks->replayDelivery
Go
Webhooks.ReplayDelivery
Java
webhooks().replayDelivery
C#
Webhooks.ReplayDeliveryAsync

listWebhookDeadLetters

Scopeswebhooks:readThe app's assistant runs it without askingToolkitworkspace

The events one webhook endpoint gave up on, newest first: every event whose last automatic attempt failed, because its retries ran out, the receiver gave an answer that is not tried again, or the endpoint was switched off before the next retry. Each row names the event, how many times it was tried, the last answer and that attempt, which getWebhookDelivery reads in full. status is open by default, the ones still waiting to be replayed or discarded; replayed, discarded and all read the rest. A dead letter is kept 30 days after the event was given up on. One page at a time: when more follow, the last line gives a cursor to pass back for the next page.

Inputs

endpointIdstringRequired

The webhook endpoint, by its id (whe_…). listWebhooks names every one.

1 to 64 characters
statusstring
One of"open""replayed""discarded""all"
sincestring

An ISO 8601 instant, such as 2026-09-01T00:00:00Z.

untilstring

An ISO 8601 instant, such as 2026-09-01T00:00:00Z.

limitinteger
At least 1At most 100
cursorstring

Also available in

API
GET /webhooks/{id}/dead-letters
TypeScript
webhooks.listDeadLetters()webhooks.listAllDeadLetters()webhooks.iterateDeadLetters()
Python
webhooks.list_dead_letters()webhooks.list_all_dead_letters()webhooks.iterate_dead_letters()
Ruby
webhooks.list_dead_letterswebhooks.list_all_dead_letterswebhooks.iterate_dead_letters
PHP
webhooks->listDeadLetterswebhooks->listAllDeadLetterswebhooks->iterateDeadLetters
Go
Webhooks.ListDeadLettersWebhooks.ListAllDeadLettersWebhooks.IterateDeadLetters
Java
webhooks().listDeadLetterswebhooks().listAllDeadLetterswebhooks().iterateDeadLetters
C#
Webhooks.ListDeadLettersAsyncWebhooks.ListAllDeadLettersAsyncWebhooks.IterateDeadLettersAsync

replayWebhookDeadLetters

Scopeswebhooks:writeThe app's assistant always asks firstToolkitworkspace

Send dead letters of one webhook endpoint again, now, each with its original id and a fresh signature. Name up to 100 in ids, or leave ids out to send the oldest 100 open ones. It reaches a real receiver, so confirm with the person before calling it, every time. A delivered one is closed as replayed and a failed one stays open; one that could not be sent says why. When 5 in a row fail it stops and leaves the rest open, and it says when open ones are left. Refused while the endpoint is switched off. Only the owner of the workspace, or someone whose role reaches every address, can replay, through an app that reaches every address.

Inputs

endpointIdstringRequired

The webhook endpoint, by its id (whe_…). listWebhooks names every one.

1 to 64 characters
idsstring[]

Dead letters to send again, by their ids (dlq_…). Leave it out to send the oldest open ones.

1 to 100 items

Also available in

API
POST /webhooks/{id}/dead-letters/replay
TypeScript
webhooks.replayDeadLetters()
Python
webhooks.replay_dead_letters()
Ruby
webhooks.replay_dead_letters
PHP
webhooks->replayDeadLetters
Go
Webhooks.ReplayDeadLetters
Java
webhooks().replayDeadLetters
C#
Webhooks.ReplayDeadLettersAsync

discardWebhookDeadLetter

Scopeswebhooks:writeThe app's assistant always asks firstToolkitworkspace

Close one open dead letter of a webhook endpoint without sending it. The event stays in the delivery log, where replayWebhookDelivery can still send it. Confirm with the person before calling it. One that was replayed cannot be discarded.

Inputs

endpointIdstringRequired

The webhook endpoint, by its id (whe_…). listWebhooks names every one.

1 to 64 characters
deadLetterIdstringRequired

A dead letter of this endpoint, by its id (dlq_…). listWebhookDeadLetters names them.

1 to 64 characters

Also available in

API
DELETE /webhooks/{id}/dead-letters/{deadLetterId}
TypeScript
webhooks.discardDeadLetter()
Python
webhooks.discard_dead_letter()
Ruby
webhooks.discard_dead_letter
PHP
webhooks->discardDeadLetter
Go
Webhooks.DiscardDeadLetter
Java
webhooks().discardDeadLetter
C#
Webhooks.DiscardDeadLetterAsync

listWebhookActivity

Scopeswebhooks:readThe app's assistant runs it without askingToolkitworkspace

What happened TO this workspace’s webhooks, newest first: created, updated, switched on or off (by a person or automatically after repeated failures), secret rotated, tested, replayed and removed. Each row says who did it, a person as @username or a key as "API key <name>", and what changed. A removed webhook keeps its history. Narrow it with endpointId or endpointIds, since and until. One page at a time: when more follow, the last line gives a cursor to pass back for the next page.

Inputs

endpointIdstring
Not empty
endpointIdsstring[]

Only these webhooks, at most 50. endpointId adds one more.

Up to 50 items
sincestring

Only rows at or after this ISO 8601 instant, such as 2026-09-01T00:00:00Z.

untilstring

Only rows before this ISO 8601 instant.

limitinteger
At least 1At most 100
cursorstring

Also available in

API
GET /webhooks/activityGET /webhooks/{id}/activity
TypeScript
webhooks.listWorkspaceActivity()webhooks.listAllWorkspaceActivity()webhooks.iterateWorkspaceActivity()webhooks.listActivity()webhooks.listAllActivity()webhooks.iterateActivity()
Python
webhooks.list_workspace_activity()webhooks.list_all_workspace_activity()webhooks.iterate_workspace_activity()webhooks.list_activity()webhooks.list_all_activity()webhooks.iterate_activity()
Ruby
webhooks.list_workspace_activitywebhooks.list_all_workspace_activitywebhooks.iterate_workspace_activitywebhooks.list_activitywebhooks.list_all_activitywebhooks.iterate_activity
PHP
webhooks->listWorkspaceActivitywebhooks->listAllWorkspaceActivitywebhooks->iterateWorkspaceActivitywebhooks->listActivitywebhooks->listAllActivitywebhooks->iterateActivity
Go
Webhooks.ListWorkspaceActivityWebhooks.ListAllWorkspaceActivityWebhooks.IterateWorkspaceActivityWebhooks.ListActivityWebhooks.ListAllActivityWebhooks.IterateActivity
Java
webhooks().listWorkspaceActivitywebhooks().listAllWorkspaceActivitywebhooks().iterateWorkspaceActivitywebhooks().listActivitywebhooks().listAllActivitywebhooks().iterateActivity
C#
Webhooks.ListWorkspaceActivityAsyncWebhooks.ListAllWorkspaceActivityAsyncWebhooks.IterateWorkspaceActivityAsyncWebhooks.ListActivityAsyncWebhooks.ListAllActivityAsyncWebhooks.IterateActivityAsync

getWebhook

Scopeswebhooks:readThe app's assistant runs it without askingToolkitworkspace

One webhook endpoint: where it posts, whether it is on and why not, which events it asked for, which addresses it hears about, its retry policy, and when it last delivered. The signing secret is never shown.

Inputs

idstringRequired

The webhook endpoint, by its id (whe_…). listWebhooks names every one.

1 to 64 characters

Also available in

API
GET /webhooksGET /webhooks/{id}
TypeScript
webhooks.list()webhooks.listAll()webhooks.iterate()webhooks.get()
Python
webhooks.list()webhooks.list_all()webhooks.iterate()webhooks.get()
Ruby
webhooks.listwebhooks.list_allwebhooks.iteratewebhooks.get
PHP
webhooks->listwebhooks->listAllwebhooks->iteratewebhooks->get
Go
Webhooks.ListWebhooks.ListAllWebhooks.IterateWebhooks.Get
Java
webhooks().listwebhooks().listAllwebhooks().iteratewebhooks().get
C#
Webhooks.ListAsyncWebhooks.ListAllAsyncWebhooks.IterateAsyncWebhooks.GetAsync

createWebhook

Scopeswebhooks:writeThe app's assistant always asks firstToolkitworkspace

Add a webhook endpoint: an https URL that Nextmail posts signed events to. Name the events it wants, from listWebhookEvents; with none it gets every email event except email.replied. Allowlists narrow it to some addresses or domains. The answer holds the signing secret, shown this once.

Inputs

urlstringRequired
1 to 2048 characters
eventTypesstring[]
Up to 57 itemsOne of"email.received""email.replied""email.sent""email.failed""email.cancelled""email.scheduled""email.queued""email.delivered""email.delivery_delayed""email.bounced""email.complained""email.suppressed""email.opened""email.clicked""email.downloaded""email.routed""domain.verified""domain.sending_changed""domain.deleted""domain.access_granted""domain.access_revoked""suppression.added""suppression.removed""file.uploaded""file.deleted""form.submitted""form.confirmed""automation.entered""automation.exited""automation.paused""automation.resumed""automation.webhook""contact.created""contact.updated""contact.deleted""contact.unsubscribed""contact.resubscribed""sending.paused""sending.resumed""connector.connected""connector.disconnected""connector.needs_attention""task.run.completed""task.run.failed""task.run.cancelled""approval.requested""booking.created""booking.confirmed""booking.rescheduled""booking.cancelled""broadcast.sending""broadcast.sent""broadcast.failed""broadcast.cancelled""address.expired""address.access_granted""address.access_revoked"
descriptionstring
Up to 200 characters
includeContentboolean

True to put the text, the HTML and an attachment download link of each arriving message into its email.received event, so the receiver needs no second call to read it. Needs threads:read.

includeRawboolean

True to put a link to the source of each arriving message into its email.received event, as data.raw, so the receiver can download the whole message for an hour. Needs threads:read.

retryPolicystring

How long a failed delivery is tried again: standard tries it up to 8 times over about 27 and a half hours, extended up to 16 times over about 3 days. A change applies from the next attempt.

One of"standard""extended"
addressAllowliststring[]

Only events about these addresses. What you pass replaces the list.

Up to 50 items
domainAllowliststring[]

Only events about addresses on these domains. What you pass replaces the list.

Up to 25 items

Also available in

API
POST /webhooks
TypeScript
webhooks.create()
Python
webhooks.create()
Ruby
webhooks.create
PHP
webhooks->create
Go
Webhooks.Create
Java
webhooks().create
C#
Webhooks.CreateAsync

updateWebhook

Scopeswebhooks:writeThe app's assistant always asks firstToolkitworkspace

Change a webhook endpoint: its URL, the events it wants, its description, its allowlists, whether arriving mail carries its content or a link to its source, how long failed deliveries are retried, or switch it on or off with enabled. Switching on clears an automatic disable. Lists you pass replace what it had.

Inputs

idstringRequired

The webhook endpoint, by its id (whe_…). listWebhooks names every one.

1 to 64 characters
urlstring
1 to 2048 characters
eventTypesstring[]
Up to 57 itemsOne of"email.received""email.replied""email.sent""email.failed""email.cancelled""email.scheduled""email.queued""email.delivered""email.delivery_delayed""email.bounced""email.complained""email.suppressed""email.opened""email.clicked""email.downloaded""email.routed""domain.verified""domain.sending_changed""domain.deleted""domain.access_granted""domain.access_revoked""suppression.added""suppression.removed""file.uploaded""file.deleted""form.submitted""form.confirmed""automation.entered""automation.exited""automation.paused""automation.resumed""automation.webhook""contact.created""contact.updated""contact.deleted""contact.unsubscribed""contact.resubscribed""sending.paused""sending.resumed""connector.connected""connector.disconnected""connector.needs_attention""task.run.completed""task.run.failed""task.run.cancelled""approval.requested""booking.created""booking.confirmed""booking.rescheduled""booking.cancelled""broadcast.sending""broadcast.sent""broadcast.failed""broadcast.cancelled""address.expired""address.access_granted""address.access_revoked"
descriptionstring
Can be nullUp to 200 characters
enabledboolean
includeContentboolean

True to put the text, the HTML and an attachment download link of each arriving message into its email.received event, so the receiver needs no second call to read it. Needs threads:read.

includeRawboolean

True to put a link to the source of each arriving message into its email.received event, as data.raw, so the receiver can download the whole message for an hour. Needs threads:read.

retryPolicystring

How long a failed delivery is tried again: standard tries it up to 8 times over about 27 and a half hours, extended up to 16 times over about 3 days. A change applies from the next attempt.

One of"standard""extended"
addressAllowliststring[]

Only events about these addresses. What you pass replaces the list.

Up to 50 items
domainAllowliststring[]

Only events about addresses on these domains. What you pass replaces the list.

Up to 25 items

Also available in

API
PATCH /webhooks/{id}
TypeScript
webhooks.update()
Python
webhooks.update()
Ruby
webhooks.update
PHP
webhooks->update
Go
Webhooks.Update
Java
webhooks().update
C#
Webhooks.UpdateAsync

deleteWebhook

Scopeswebhooks:writeThe app's assistant always asks firstToolkitworkspace

Remove a webhook endpoint. Nothing is posted to it from then on, and its delivery log and history stay readable. updateWebhook with enabled false is the reversible way to stop one.

Inputs

idstringRequired

The webhook endpoint, by its id (whe_…). listWebhooks names every one.

1 to 64 characters

Also available in

API
DELETE /webhooks/{id}
TypeScript
webhooks.delete()
Python
webhooks.delete()
Ruby
webhooks.delete
PHP
webhooks->delete
Go
Webhooks.Delete
Java
webhooks().delete
C#
Webhooks.DeleteAsync

rotateWebhookSecret

Scopeswebhooks:writeMCP only, not in the app's assistantToolkitworkspace

Give a webhook endpoint a new signing secret. For 24 hours every delivery is signed with the old secret as well, so the receiver keeps verifying while it is given the new one. The new secret is shown once, in the answer to this call.

Inputs

idstringRequired

The webhook endpoint, by its id (whe_…). listWebhooks names every one.

1 to 64 characters

Also available in

API
POST /webhooks/{id}/rotate-secret
TypeScript
webhooks.rotateSecret()
Python
webhooks.rotate_secret()
Ruby
webhooks.rotate_secret
PHP
webhooks->rotateSecret
Go
Webhooks.RotateSecret
Java
webhooks().rotateSecret
C#
Webhooks.RotateSecretAsync

testWebhook

Scopeswebhooks:writeThe app's assistant always asks firstToolkitworkspace

Post one signed test event to a webhook endpoint now and report what it answered. It reaches the real receiver, and it is recorded in the activity of the endpoint.

Inputs

idstringRequired

The webhook endpoint, by its id (whe_…). listWebhooks names every one.

1 to 64 characters

Also available in

API
POST /webhooks/{id}/test
TypeScript
webhooks.test()
Python
webhooks.test()
Ruby
webhooks.test
PHP
webhooks->test
Go
Webhooks.Test
Java
webhooks().test
C#
Webhooks.TestAsync

getWebhookStats

Scopeswebhooks:readThe app's assistant runs it without askingToolkitworkspace

How the webhook deliveries went inside a window: attempts, delivered and failed, the median time a receiver took, a count per bucket of grain, the events sent most and the response codes. Every endpoint, or the ones endpointIds names. The window is the last 30 days unless since or until say otherwise.

Inputs

endpointIdsstring[]
Up to 50 items
sincestring

An ISO 8601 instant, such as 2026-09-01T00:00:00Z.

untilstring

An ISO 8601 instant, such as 2026-09-01T00:00:00Z.

grainstring
One of"minute""hour""day"
offsetMinutesinteger
At least -840At most 840

Also available in

API
GET /webhooks/stats
TypeScript
webhooks.stats()
Python
webhooks.stats()
Ruby
webhooks.stats
PHP
webhooks->stats
Go
Webhooks.Stats
Java
webhooks().stats
C#
Webhooks.StatsAsync

getApiKeyStats

Scopesapi-keys:reademails:readThe app's assistant runs it without askingToolkitworkspace

What the API keys of this workspace did inside a window, as the Analytics tab of the API keys page shows it: the mail they sent and what became of it, the calls refused for a bad secret, the requests made and how many failed, the routes called most and the status codes returned. Every key, or the ones keyIds names. The window is the last 30 days unless since or until say otherwise. Only the owner of the workspace can read it.

Inputs

keyIdsstring[]
Up to 50 items
sincestring

An ISO 8601 instant, such as 2026-09-01T00:00:00Z.

untilstring

An ISO 8601 instant, such as 2026-09-01T00:00:00Z.

grainstring
One of"minute""hour""day"
offsetMinutesinteger
At least -840At most 840

Also available in

API
GET /keys/stats
TypeScript
keys.stats()
Python
keys.stats()
Ruby
keys.stats
PHP
keys->stats
Go
Keys.Stats
Java
keys().stats
C#
Keys.StatsAsync