nextmail webhooks
Every command in this namespace, with its arguments, flags and examples.
Commands
Endpoints that receive signed mailbox events, their secrets and their delivery log.
Every command here also takes the global flags, such as --json, --profile and --dry-run. See the global flags
webhooks listwebhooks getwebhooks createwebhooks updatewebhooks deletewebhooks rotate-secretwebhooks testwebhooks list-deliverieswebhooks get-deliverywebhooks replay-deliverywebhooks list-dead-letterswebhooks replay-dead-letterswebhooks discard-dead-letterwebhooks list-workspace-deliverieswebhooks list-activitywebhooks list-workspace-activitywebhooks list-eventswebhooks stats
nextmail webhooks list
List the webhook endpoints in the workspace
lsUsage
nextmail webhooks list [flags]
Resolves one page of the webhook endpoints registered on the key's workspace, newest first.
Signing secrets are never part of a read. Only create and rotateSecret return secret, so a lost secret cannot be recovered from here. An endpoint that names no events, such as one created without eventTypes, receives the default email.* set and reports eventTypes as ['*'] rather than an empty array.
Read enabled, disabledReason and consecutiveFailures as the health summary. An endpoint the server switched off after 100 consecutive failed deliveries shows enabled: false with disabledAt and a reason, while one you disabled yourself through update has both of those null.
Add --all to walk every page: a table on a terminal, one JSON object per line when piped or with --ndjson, and one { items, hasMore, nextCursor } document with --json. --max <n> stops after that many items.
Flags
--limit <n>Page size, from 1 to 100. The server defaults to 25.
Default25--cursor <value>The
nextCursorof the previous page. Leave it out for the first page.--q <value>Narrows to endpoints whose URL, description, id, events, or one of the addresses and domains they name matches, up to 200 characters. Every word has to appear in one of them, ignoring case and accents, and when nothing matches exactly the search allows for a typo instead.
--allFetch every page and stream the items as they arrive.
--max <n>Stop after this many items. Implies
--all.--ndjsonPrint every item as one JSON object per line. Implies
--all
Examples
nextmail webhooks listnextmail webhooks list --all --max 100nextmail webhooks list --all > webhooks.ndjsonAlso available in
- API
GET /webhooks- TypeScript
webhooks.list()- Python
webhooks.list()- Ruby
webhooks.list- PHP
webhooks->list- Go
Webhooks.List- Java
webhooks().list- C#
Webhooks.ListAsync
nextmail webhooks get
Read one webhook endpoint by id
showviewUsage
nextmail webhooks get <id> [flags]
Resolves a single endpoint with its URL, subscription list, enabled state and delivery health. The signing secret is never part of a read. It appears only in the responses of create and rotateSecret, and a lost one is replaced with rotateSecret rather than read back.
An id from another workspace answers exactly like one that never existed, with 404 resource_not_found, so a 404 does not tell you whether the endpoint was deleted or was never yours.
consecutiveFailures resets to 0 on any successful delivery and when update sets enabled to true. When it reaches 100 the server disables the endpoint, fills in disabledAt and disabledReason, and emails the workspace owner and every member whose role can read webhooks.
Arguments
<id>RequiredEndpoint id,
whe_followed by 24 hex characters.
Examples
nextmail webhooks get whe_3f9c2a7b1e4d8f60a5c7b92dnextmail webhooks get whe_3f9c2a7b1e4d8f60a5c7b92d --jsonAlso available in
- API
GET /webhooks/{id}- TypeScript
webhooks.get()- Python
webhooks.get()- Ruby
webhooks.get- PHP
webhooks->get- Go
Webhooks.Get- Java
webhooks().get- C#
Webhooks.GetAsync
nextmail webhooks create
Register an HTTPS endpoint for mailbox events
newaddUsage
nextmail webhooks create --url <value> [flags] nextmail webhooks create --data <json|@file|-> [flags]
Registers a receiver URL and subscribes it to events on the key's workspace. The endpoint starts enabled, so the next matching event is delivered to it straight away. Leave --event-types out, or pass an empty array, and the endpoint receives the default set, which is the email.* events other than email.replied and email.routed. Every family outside it has to be named: email.replied, domain.*, suppression.*, file.*, form.*, automation.*, contact.*, sending.*, connector.*, task.*, approval.*, booking.*, broadcast.* and address.*. Reads report an unnamed subscription as ['*'].
By default an endpoint hears about every address the workspace owns. --address-allowlist and --domain-allowlist narrow it, exactly as the same two lists narrow an API key: name whole domains, single addresses, or both. An event reaches the endpoint when the address or domain it concerns is covered, and address.* follows the address it names, as the email.* events do. Events that name no address at all, such as suppression.removed, reach every endpoint whatever its lists say. form.*, automation.*, contact.*, sending.*, connector.*, task.*, approval.*, booking.* and broadcast.* are the exception: sign-ups, automations, contacts, the sending lanes, connectors, tasks, booking pages and broadcasts belong to the whole workspace, so an endpoint limited to some addresses or domains never receives them. automation.webhook and email.routed are the two events no endpoint names. A webhook step of an automation sends automation.webhook only to the endpoint the step names, and an address or route that hands its mail to a webhook sends email.routed only to the endpoint it names in webhookId and to the taps of the address, whatever events those endpoints list and whatever their allowlists hold.
This response is the only place the full secret ever appears. Every later read omits it, so store it before doing anything else, and if it is lost call rotateSecret. The secret is whsec_ followed by 43 base64url characters, and the HMAC key is the whole string including the prefix, so pass it to verifyWebhookSignature exactly as returned.
url must be https. localhost, hosts ending .localhost, .internal or .local, and IP literals in loopback, private, link local, carrier grade NAT, multicast or unique local ranges are refused with 422 invalid_webhook_url. The host is resolved again on every delivery, and an attempt to a name that resolves into one of those ranges is recorded as failed without being sent. Deliveries never follow redirects, so register the final address.
Flags
--url <value>The https receiver URL. Another scheme or a blocked host is 422
invalid_webhook_url. Stored in normalised form, so theurlread back can differ cosmetically. Required, here or in--data.--event-types <a,b>RepeatableEvents to subscribe to. Omit it, or send
[], for the defaultemail.*set:email.received,email.sent,email.failed,email.cancelled,email.scheduled,email.queued,email.delivered,email.delivery_delayed,email.bounced,email.complained,email.suppressed,email.opened,email.clickedandemail.downloaded.email.replied,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,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_grantedandaddress.access_revokedare outside that set and have to be named.automation.webhookandemail.routedare never named here: a webhook step sends the first to the endpoint the step names, and an address or route sends the second to the endpoint it names inwebhookIdand to the taps of the address.--description <value>Free text note, at most 200 characters.
--address-allowlist <a,b>RepeatableSingle addresses this endpoint hears about. An event is delivered when the address it concerns is on this list, or when its domain is in
--domain-allowlist. Leave both empty and the endpoint hears about every address the workspace owns. At most 50, and an address this workspace does not own is 422invalid_parameter.--domain-allowlist <a,b>RepeatableWhole domains this endpoint hears about, including addresses added to them later. A domain also carries its own
domain.*events. At most 25. An address whose domain is already listed here is dropped from--address-allowlistwhen the endpoint is saved, so the two lists never overlap.--include-rawTrue gives every
email.receivedevent this endpoint gets a link to the message source, asdata.rawwithurl,size,sourceandexpiresAt: the bytes exactly as they arrived when the address keeps originals, and otherwise the message rebuilt the way a mail app downloads it. The link works for an hour from each attempt without a key. Turning it on needsthreads:readas well aswebhooks:write. Defaults to false.--retry-policy <value>standard, the default, tries a failed delivery up to 8 times over about 27 and a half hours.extendedtries it up to 16 times over about 3 days: as it happens, then after 1 minute, then after twice the last wait each time until the wait reaches 12 hours, then every 12 hours. The policy is read at every attempt, so a change also applies to events already waiting for a retry.--include-contentTrue puts the message itself into every
email.receivedevent this endpoint gets, asdata.content: the text, the HTML up to 512 KiB, and each attachment with a link that downloads it for an hour without a key. Turning it on needsthreads:readas well aswebhooks:write. Defaults to false.--data <json|@file|->The whole
bodyas JSON, inline, from a file with @path, or - for standard input. Flags override its keys.
Examples
nextmail webhooks create --url https://hooks.acme.com/nextmailnextmail webhooks create --url https://hooks.acme.com/nextmail --event-types email.received,email.bounced,email.complained --description 'Support desk sync'nextmail webhooks create --data @webhook.jsonAlso 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
nextmail webhooks update
Change an endpoint URL, events or enabled state
editUsage
nextmail webhooks update <id> [flags]
Patches the URL, subscription list, description, enabled flag, message content and source settings or retry policy of one endpoint. Every field is optional, and an empty patch is accepted and changes nothing you can read back. A new url goes through the same https and host checks as create, and description: null clears the note.
--event-types replaces the subscription set wholesale, so send the complete list you want rather than a delta. An empty array does not unsubscribe: it puts the endpoint back on the default email.* set. To stop deliveries, set enabled to false instead. As with create, email.replied and every family outside that set, address.* included, have to be named, while automation.webhook and email.routed are never named: an automation step, an address or a route sends them to the endpoints it names.
--address-allowlist and --domain-allowlist replace the endpoint's scope the same way, wholesale rather than as a delta. Send both empty to widen it back to every address the workspace owns. Each list is checked against the domains and addresses this workspace actually owns, and an unknown one is 422 invalid_parameter.
Writing enabled clears disabledAt and disabledReason either way, so an endpoint you switch off yourself reports both as null. Setting it back to true also resets consecutiveFailures to 0, which is how an endpoint the server disabled after 100 failures is brought back. Events that fire while an endpoint is disabled are never delivered to it later, but the events that failed before it was switched off are kept as dead letters, and replayDeadLetters sends them again once it is back on.
Arguments
<id>RequiredEndpoint id,
whe_followed by 24 hex characters.
Flags
--url <value>Replacement https URL, checked against the same host rules as
create.--event-types <a,b>RepeatableComplete replacement subscription set.
[]means the defaultemail.*set.--address-allowlist <a,b>RepeatableComplete replacement list of single addresses this endpoint hears about. At most 50. Send
[]on both lists to hear about every address again.--domain-allowlist <a,b>RepeatableComplete replacement list of whole domains this endpoint hears about, including addresses added to them later. At most 25.
--include-contentTrue puts the message itself into every
email.receivedevent this endpoint gets, asdata.content: the text, the HTML up to 512 KiB, and each attachment with a link that downloads it for an hour without a key. Turning it on needsthreads:readas well aswebhooks:write. Leaving the field out leaves it alone.--include-rawTrue gives every
email.receivedevent this endpoint gets a link to the message source, asdata.rawwithurl,size,sourceandexpiresAt: the bytes exactly as they arrived when the address keeps originals, and otherwise the message rebuilt the way a mail app downloads it. The link works for an hour from each attempt without a key. Turning it on needsthreads:readas well aswebhooks:write. Leaving the field out leaves it alone.--retry-policy <value>standard, the default, tries a failed delivery up to 8 times over about 27 and a half hours.extendedtries it up to 16 times over about 3 days: as it happens, then after 1 minute, then after twice the last wait each time until the wait reaches 12 hours, then every 12 hours. The policy is read at every attempt, so a change also applies to events already waiting for a retry.--description <value>Replacement note of at most 200 characters, or null to clear it.
--enabledFalse stops deliveries. True resumes them and resets
consecutiveFailures.--data <json|@file|->The whole
patchas JSON, inline, from a file with @path, or - for standard input. Flags override its keys.
Examples
nextmail webhooks update whe_3f9c2a7b1e4d8f60a5c7b92d --event-types email.sent,email.bounced,email.complained --enablednextmail webhooks update whe_3f9c2a7b1e4d8f60a5c7b92d --event-types email.sent,email.bounced,email.complained --enabled --jsonAlso available in
nextmail webhooks delete
Delete an endpoint and its delivery log
rmdelremoveUsage
nextmail webhooks delete <id> [flags]
Removes the endpoint for good. Deliveries stop immediately, the signing secret is gone, and the delivery log for the endpoint is deleted with it, so read it with listAllDeliveries first if you need it for an audit trail.
There is no undo and no soft delete. If the aim is only to pause deliveries, call update with enabled: false and keep the endpoint, its secret and its log.
The response is a tombstone rather than an empty body, so a log line can name what went. Deleting frees a slot against the workspace's endpoint limit straight away.
Arguments
<id>RequiredEndpoint id,
whe_followed by 24 hex characters.
Examples
nextmail webhooks delete whe_3f9c2a7b1e4d8f60a5c7b92dnextmail webhooks delete whe_3f9c2a7b1e4d8f60a5c7b92d --yesAlso available in
nextmail webhooks rotate-secret
Issue a new signing secret for an endpoint
Usage
nextmail webhooks rotate-secret <id> [flags]
Generates a new signing secret and resolves with the endpoint plus the new plaintext secret. As with create, this response is the only place that secret appears, so store it before anything else.
The old secret keeps working for 24 hours. Until then every delivery carries two v1 signatures in X-Webhook-Signature, one made with each secret, and verifyWebhookSignature passes when either matches, so a receiver that still holds the old secret keeps verifying while you give it the new one. previousSecretExpiresAt on the endpoint says when the old secret stops signing. Rotating again within those 24 hours keeps every secret retired in the window signing until its own 24 hours are up.
Give the receiver the returned secret within the day, then call test to confirm it verifies.
Arguments
<id>RequiredEndpoint id,
whe_followed by 24 hex characters.
Examples
nextmail webhooks rotate-secret whe_3f9c2a7b1e4d8f60a5c7b92dnextmail webhooks rotate-secret whe_3f9c2a7b1e4d8f60a5c7b92d --yesAlso available in
nextmail webhooks test
Send a synthetic event and report how delivery went
Usage
nextmail webhooks test <id> [flags]
Posts a signed synthetic email.sent event to the endpoint and waits for the attempt to finish before resolving. The payload data is { test: true, note } and no mail is sent, so it is safe against a production receiver. It proves the URL is reachable and that your signature check accepts the current secret before real mail depends on it.
The outcome comes back as delivery, read from the newest row of the delivery log. status is delivered for any 2xx answer and failed otherwise, responseCode is the HTTP status or null when no response arrived, such as a DNS failure or the 5 second timeout, and error explains a failure. A 3xx counts as failed because redirects are never followed.
The event goes out whatever the endpoint subscribes to, and even when it is disabled. It is recorded like any delivery, so it appears in listDeliveries and can be sent again with replayDelivery, but it is tried once and leaves consecutiveFailures and lastDeliveryAt alone, so a failing test never counts toward the 100 that disable an endpoint. A 410 Gone answer does switch the endpoint off, as it would for a real event.
Arguments
<id>RequiredEndpoint id,
whe_followed by 24 hex characters.
Examples
nextmail webhooks test whe_3f9c2a7b1e4d8f60a5c7b92dnextmail webhooks test whe_3f9c2a7b1e4d8f60a5c7b92d --jsonAlso 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
nextmail webhooks list-deliveries
List one page of delivery attempts for one endpoint
Usage
nextmail webhooks list-deliveries <id> [flags]
Returns one page of an endpoint's delivery log, newest first. status, since and until narrow it the way the Deliveries tab of the app does: status: 'failed' is its "only failed" switch.
Each attempt is one POST with a 5 second timeout, and one event can appear several times: when the failure is worth repeating, a delivery on the standard retry policy is tried up to 8 times, as it happens and then after 1 minute, 5 minutes, 30 minutes, 2 hours, 5 hours, 10 hours and 10 hours, about 27 and a half hours in all, one on extended up to 16 times over about 3 days, and each replayDelivery adds a row of its own. An event whose last attempt failed is also kept as a dead letter, which listDeadLetters reads. attempt and maxAttempts say which try a row is, and eventId is the same across all of them, so this log distinguishes a retry from a new event. nextAttemptAt is when the automatic retry that follows a row is due, and null when none is waiting, so a failed row with a time in it is not the final word. status is delivered for a 2xx answer and failed for anything else, including a 3xx, since redirects are not followed.
responseCode null means no response arrived, such as a DNS or TLS failure or the timeout, which is a different fact from a receiver that answered. durationMs is null only when the attempt was never made because the server could not read the signing secret, and error then says so. The body that was sent and your server's answer are not part of this response, and getDelivery returns both. listWorkspaceDeliveries reads every endpoint at once.
Add --all to walk every page: a table on a terminal, one JSON object per line when piped or with --ndjson, and one { items, hasMore, nextCursor } document with --json. --max <n> stops after that many items.
Arguments
<id>RequiredEndpoint id,
whe_followed by 24 hex characters.
Flags
--status <value>failedkeeps only the attempts that did not get a 2xx, the "only failed" view of the app;deliveredkeeps the rest.--since <when>Only rows at or after this instant. A
Dateis sent as ISO 8601, and a string must already be one.--until <when>Only rows before this instant. It has to be later than
since, or the server answers 400invalid_parameter.--limit <n>Rows per page, a whole number from 1 to 100. The server defaults to 25.
Default25--cursor <value>The
nextCursorfrom the previous page, passed back unchanged. Never build one yourself.--allFetch every page and stream the items as they arrive.
--max <n>Stop after this many items. Implies
--all.--ndjsonPrint every item as one JSON object per line. Implies
--all
Examples
nextmail webhooks list-deliveries whe_3f9c2a7b1e4d8f60a5c7b92dnextmail webhooks list-deliveries whe_3f9c2a7b1e4d8f60a5c7b92d --status failed --limit 50nextmail webhooks list-deliveries whe_3f9c2a7b1e4d8f60a5c7b92d --all --max 100nextmail webhooks list-deliveries whe_3f9c2a7b1e4d8f60a5c7b92d --all > webhooks.ndjsonAlso available in
nextmail webhooks get-delivery
Read one delivery attempt in full, with the body that was sent
Usage
nextmail webhooks get-delivery <id> <delivery-id> [flags]
Resolves one attempt from an endpoint's delivery log with what listDeliveries leaves out. payload is the exact JSON body that was POSTed, { id, type, createdAt, data }, and responseBody is the first 2,000 characters your server answered, or null when nothing came back or the answer was a redirect.
attempts lists every try of the same event on this endpoint, oldest first: the first attempt, the automatic retries and any replays, each with its own id, attempt, status, responseCode, error and createdAt. They share eventId, which is the payload id your receiver saw. nextAttemptAt is when the next automatic retry of the event is due, whichever attempt it follows, and null when none is waiting.
replayRefusal says whether replayDelivery would accept this attempt before you call it: null when it would, and otherwise the code and message the replay would be refused with, such as webhook_disabled while the endpoint is switched off, or retry_in_progress while an automatic retry of the same event is being sent.
Arguments
<id>RequiredEndpoint id,
whe_followed by 24 hex characters.<delivery-id>RequiredDelivery id,
whd_followed by 24 hex characters, aslistDeliveriesreturns it.
Examples
nextmail webhooks get-delivery whe_3f9c2a7b1e4d8f60a5c7b92d whd_8c1e4a7f2b9d3e6a0c5f1b28nextmail webhooks get-delivery whe_3f9c2a7b1e4d8f60a5c7b92d whd_8c1e4a7f2b9d3e6a0c5f1b28 --jsonAlso available in
nextmail webhooks replay-delivery
Send one stored event to the endpoint again, now
Usage
nextmail webhooks replay-delivery <id> <delivery-id> [flags]
Posts the event behind a recorded attempt to the endpoint once more, straight away, and resolves when that attempt has finished. The body is the one stored with the original, with the same id, type, createdAt and data, so a receiver that drops ids it has already handled treats the replay as the event it already knows. Only X-Webhook-Signature is new, because every POST is signed with the current secret at the moment it goes out, so a replay verifies after a rotateSecret too.
It accepts a delivered attempt as well as a failed one. Replaying a success is how a receiver that lost its copy, or handled it wrongly, is brought back in step. Any attempt of the event will do, since they all carry the same event.
The replay is recorded in the log as a new delivery, attempt 1 of 1, and is never retried automatically. Before it goes out, the automatic retries of the same event that have not started are paused, so the receiver never gets two copies at once. When the replay is delivered they stay cancelled; when it fails they resume on their schedule. If an automatic retry of the event is being sent at that very moment, the replay sends nothing and is refused with 409 retry_in_progress, and if another replay of the same event is still being sent, it is refused with 409 replay_in_progress, so two copies never go out at once. The call resolves with 200 whatever your server answered, so branch on delivery.status rather than on whether the promise rejected.
Arguments
<id>RequiredEndpoint id,
whe_followed by 24 hex characters.<delivery-id>RequiredAny attempt of the event to send again,
whd_followed by 24 hex characters.
Examples
nextmail webhooks replay-delivery whe_3f9c2a7b1e4d8f60a5c7b92d whd_8c1e4a7f2b9d3e6a0c5f1b28nextmail webhooks replay-delivery whe_3f9c2a7b1e4d8f60a5c7b92d whd_8c1e4a7f2b9d3e6a0c5f1b28 --jsonAlso available in
nextmail webhooks list-dead-letters
List one page of the events an endpoint gave up on
Usage
nextmail webhooks list-dead-letters <id> [flags]
Returns one page of an endpoint's dead letters, newest first. An event becomes a dead letter when its last automatic attempt fails: its retries ran out under the endpoint's retryPolicy, the receiver gave an answer that is not tried again (a 4xx other than 408, 425 and 429, or a 410 that also switches the endpoint off), or the endpoint was switched off before the next retry was due. Keeping dead letters changes nothing about how events are delivered.
status is open by default, the dead letters still waiting for somebody to replay or discard them; replayed and discarded read the closed ones and all reads every one. Each one names the event (eventId and eventType), how many times it was tried (attempts), what the last attempt got back (responseCode and error) and that attempt as deliveryId, whose stored body getDelivery reads. A dead letter is deleted 30 days after the event was given up on, at expiresAt, whatever its status, while the delivery log keeps every attempt.
replayDeadLetters sends open ones again and discardDeadLetter closes one without sending it.
Add --all to walk every page: a table on a terminal, one JSON object per line when piped or with --ndjson, and one { items, hasMore, nextCursor } document with --json. --max <n> stops after that many items.
Arguments
<id>RequiredEndpoint id,
whe_followed by 24 hex characters.
Flags
--status <value>open, the default, keeps the dead letters still waiting for a decision;replayedanddiscardedkeep the closed ones andallkeeps every one.Default"open"--since <when>Only dead letters given up on at or after this instant. A
Dateis sent as ISO 8601, and a string must already be one.--until <when>Only dead letters given up on before this instant. It has to be later than
since, or the server answers 400invalid_parameter.--limit <n>Rows per page, a whole number from 1 to 100. The server defaults to 25.
Default25--cursor <value>The
nextCursorfrom the previous page, passed back unchanged. Never build one yourself.--allFetch every page and stream the items as they arrive.
--max <n>Stop after this many items. Implies
--all.--ndjsonPrint every item as one JSON object per line. Implies
--all
Examples
nextmail webhooks list-dead-letters whe_3f9c2a7b1e4d8f60a5c7b92dnextmail webhooks list-dead-letters whe_3f9c2a7b1e4d8f60a5c7b92d --limit 50nextmail webhooks list-dead-letters whe_3f9c2a7b1e4d8f60a5c7b92d --all --max 100nextmail webhooks list-dead-letters whe_3f9c2a7b1e4d8f60a5c7b92d --all > webhooks.ndjsonAlso available in
nextmail webhooks replay-dead-letters
Send an endpoint's open dead letters again, now
Usage
nextmail webhooks replay-dead-letters <id> [flags]
Sends open dead letters of the endpoint again, each through the same replay as replayDelivery: the stored event goes out once, straight away, with its original id, type, createdAt and data and a fresh signature, and is never retried automatically. Name up to 100 in --ids, or leave the body out to send the 100 oldest open ones.
Each entry of data says in outcome what happened to one dead letter. delivered closes it as replayed, with the replay in its replayDeliveryId. failed leaves it open with the new attempt as its last one, so it can be sent again later. refused sent nothing and leaves it open, and refusal holds the code and message a single replay is refused with (event_not_subscribed, event_out_of_scope, delivery_not_replayable, retry_in_progress or replay_in_progress), or resource_not_found for an id that is not a dead letter of this endpoint and dead_letter_resolved for one already closed. skipped was not reached by this call.
Replays go out five at a time. When five in a row fail the call skips the rest, so a receiver that is still down is not sent the whole backlog, and a call also stops starting new replays after about 20 seconds, or before it would use up the database work one request may do, so a long backlog can take a few calls. hasMore is true while open dead letters are left that this call did not send, so call again until it is false. Every replay is recorded in the delivery log as attempt 1 of 1 and in the activity of the endpoint.
Arguments
<id>RequiredEndpoint id,
whe_followed by 24 hex characters.
Flags
--ids <a,b>RepeatableDead letter ids,
dlq_followed by 24 hex characters, at most 100. Leave it out to send the oldest open ones.--data <json|@file|->The whole
bodyas JSON, inline, from a file with @path, or - for standard input. Flags override its keys.
Examples
nextmail webhooks replay-dead-letters whe_3f9c2a7b1e4d8f60a5c7b92dnextmail webhooks replay-dead-letters whe_3f9c2a7b1e4d8f60a5c7b92d --jsonAlso available in
nextmail webhooks discard-dead-letter
Close a dead letter without sending it
Usage
nextmail webhooks discard-dead-letter <id> <dead-letter-id> [flags]
Marks an open dead letter discarded, for an event that should not reach the receiver after all. Nothing is sent. The event stays in the delivery log, where replayDelivery can still send it, and the dead letter is deleted 30 days after its event was given up on, like every other.
Discarding one that is already discarded answers with it unchanged, and one that was replayed is refused with 409 dead_letter_resolved.
Arguments
<id>RequiredEndpoint id,
whe_followed by 24 hex characters.<dead-letter-id>RequiredDead letter id,
dlq_followed by 24 hex characters.
Examples
nextmail webhooks discard-dead-letter whe_3f9c2a7b1e4d8f60a5c7b92d dlq_8c1e4a7f2b9d3e6a0c5f1b28nextmail webhooks discard-dead-letter whe_3f9c2a7b1e4d8f60a5c7b92d dlq_8c1e4a7f2b9d3e6a0c5f1b28 --yesAlso available in
nextmail webhooks list-workspace-deliveries
List one page of delivery attempts across every endpoint
Usage
nextmail webhooks list-workspace-deliveries [flags]
Returns one page of the whole workspace's delivery log, newest first: the all-endpoints Deliveries tab of the app. Each row carries endpointId, so the endpoint an attempt went to is never lost. --endpoint-ids narrows it to some endpoints, and status, since and until work exactly as they do on listDeliveries.
The body that was sent is not here: read it with getDelivery, passing the row's endpointId and id.
Add --all to walk every page: a table on a terminal, one JSON object per line when piped or with --ndjson, and one { items, hasMore, nextCursor } document with --json. --max <n> stops after that many items.
Flags
--endpoint-ids <a,b>RepeatableEndpoint ids to read, at most 50, sent comma-separated. Left out, every endpoint in the workspace.
--status <value>failedkeeps only the attempts that did not get a 2xx, the "only failed" view of the app;deliveredkeeps the rest.--since <when>Only rows at or after this instant. A
Dateis sent as ISO 8601, and a string must already be one.--until <when>Only rows before this instant. It has to be later than
since, or the server answers 400invalid_parameter.--limit <n>Rows per page, a whole number from 1 to 100. The server defaults to 25.
Default25--cursor <value>The
nextCursorfrom the previous page, passed back unchanged. Never build one yourself.--allFetch every page and stream the items as they arrive.
--max <n>Stop after this many items. Implies
--all.--ndjsonPrint every item as one JSON object per line. Implies
--all
Examples
nextmail webhooks list-workspace-deliveriesnextmail webhooks list-workspace-deliveries --status failed --limit 50nextmail webhooks list-workspace-deliveries --all --max 100nextmail webhooks list-workspace-deliveries --all > webhooks.ndjsonAlso available in
nextmail webhooks list-activity
List one page of what happened to one endpoint
Usage
nextmail webhooks list-activity <id> [flags]
Returns one page of an endpoint's audit log, newest first, the Activity tab of the endpoint in the app. Every change is a row: created, updated, enabled, disabled, auto_disabled, secret_rotated, tested, replayed and removed, whether it came from the app, from a key over the API, or from Nextmail itself. actor says who, with label already formatted the way the app shows it: @username for a person, API key <name> for a key, and actor is null when Nextmail made the change on its own, such as switching an endpoint off after 100 failed events in a row. detail carries what moved: the URL, previousUrl when it changed, the event types and allowlists an update set, or the status and response code a test or a replay got.
Nothing is pruned, and a removed endpoint keeps its history, so this answers for an endpoint that is gone too. since and until keep a window.
Add --all to walk every page: a table on a terminal, one JSON object per line when piped or with --ndjson, and one { items, hasMore, nextCursor } document with --json. --max <n> stops after that many items.
Arguments
<id>RequiredEndpoint id,
whe_followed by 24 hex characters.
Flags
--since <when>Only rows at or after this instant. A
Dateis sent as ISO 8601, and a string must already be one.--until <when>Only rows before this instant. It has to be later than
since, or the server answers 400invalid_parameter.--limit <n>Rows per page, a whole number from 1 to 100. The server defaults to 25.
Default25--cursor <value>The
nextCursorfrom the previous page, passed back unchanged. Never build one yourself.--allFetch every page and stream the items as they arrive.
--max <n>Stop after this many items. Implies
--all.--ndjsonPrint every item as one JSON object per line. Implies
--all
Examples
nextmail webhooks list-activity whe_3f9c2a7b1e4d8f60a5c7b92dnextmail webhooks list-activity whe_3f9c2a7b1e4d8f60a5c7b92d --all --max 100nextmail webhooks list-activity whe_3f9c2a7b1e4d8f60a5c7b92d --all > webhooks.ndjsonAlso available in
nextmail webhooks list-workspace-activity
List one page of what happened to every endpoint
Usage
nextmail webhooks list-workspace-activity [flags]
Returns one page of the whole workspace's webhook audit log, newest first, the Activity tab of Settings, Webhooks. Every change is a row: created, updated, enabled, disabled, auto_disabled, secret_rotated, tested, replayed and removed, whether it came from the app, from a key over the API, or from Nextmail itself. actor says who, with label already formatted the way the app shows it: @username for a person, API key <name> for a key, and actor is null when Nextmail made the change on its own, such as switching an endpoint off after 100 failed events in a row. detail carries what moved: the URL, previousUrl when it changed, the event types and allowlists an update set, or the status and response code a test or a replay got.
--endpoint-ids narrows it to some endpoints, removed ones included, and since and until keep a window.
Add --all to walk every page: a table on a terminal, one JSON object per line when piped or with --ndjson, and one { items, hasMore, nextCursor } document with --json. --max <n> stops after that many items.
Flags
--endpoint-ids <a,b>RepeatableEndpoint ids to read, at most 50, sent comma-separated. Left out, every endpoint in the workspace.
--since <when>Only rows at or after this instant. A
Dateis sent as ISO 8601, and a string must already be one.--until <when>Only rows before this instant. It has to be later than
since, or the server answers 400invalid_parameter.--limit <n>Rows per page, a whole number from 1 to 100. The server defaults to 25.
Default25--cursor <value>The
nextCursorfrom the previous page, passed back unchanged. Never build one yourself.--allFetch every page and stream the items as they arrive.
--max <n>Stop after this many items. Implies
--all.--ndjsonPrint every item as one JSON object per line. Implies
--all
Examples
nextmail webhooks list-workspace-activitynextmail webhooks list-workspace-activity --since 2026-09-01T00:00:00Znextmail webhooks list-workspace-activity --all --max 100nextmail webhooks list-workspace-activity --all > webhooks.ndjsonAlso available in
nextmail webhooks list-events
List the events an endpoint can subscribe to
Usage
nextmail webhooks list-events [flags]
Returns every event an endpoint can name in eventTypes, each with a sentence saying when it fires, and the limits an endpoint is held to: how many endpoints the workspace may have, which its plan decides, and how many addresses and domains one allowlist may name.
An endpoint that names no events receives every email event except email.replied and email.routed, so email.replied and the domain, suppression, file, form, automation, contact, sending, connector, task, approval, booking, broadcast and address families only reach an endpoint that asks for them by name. automation.webhook and email.routed are not in the list, because no endpoint subscribes to them: a webhook step sends automation.webhook to the endpoint the step names, and an address or route sends email.routed to the endpoint it names in webhookId and to the taps of the address.
Examples
nextmail webhooks list-eventsnextmail webhooks list-events --jsonAlso available in
nextmail webhooks stats
Read how webhook deliveries went inside a window
Usage
nextmail webhooks stats [flags]
Returns the numbers behind the Analytics tab of the Webhooks page: how many delivery attempts were made, how many were delivered and how many failed, the median time a receiver took to answer, a series of buckets, the events sent and the response codes received.
It covers every endpoint, or the ones --endpoint-ids names. Each try of an event counts as one attempt, so an event retried three times counts three times. The window runs from since to until, and left out it is the 30 days before now. grain sets the bucket width and the key shape, YYYY-MM-DD, YYYY-MM-DDTHH or YYYY-MM-DDTHH:MM, and --offset-minutes shifts the boundaries so days break where the reader's day does.
Flags
--endpoint-ids <a,b>RepeatableOnly these endpoints, at most 50. Left out, every endpoint.
--since <when>The start of the window, a
Dateor an ISO 8601 instant. Defaults to 30 days beforeuntil.--until <when>The end of the window, not included. Defaults to now.
--grain <value>Bucket width:
minute,hourorday, defaulting today.Default"day"--offset-minutes <n>Minutes east of UTC to bucket in, from -840 to 840, defaulting to 0. Pass
-new Date().getTimezoneOffset()for the local zone.Default0
Examples
nextmail webhooks statsnextmail webhooks stats --grain daynextmail webhooks stats --jsonAlso 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