/v1/workspaces/{workspace_id}/notifications/cancelAuthCancel notifications by cancellation key
Cancels every live notification sent with this `cancellation_key`: deliveries still pending, scheduled or retrying end `skipped: cancelled`. Already delivered messages stay delivered (retract inbox items with `…/retract`). Safe to repeat.
Path parameters
workspace_id*string · uuidId of the workspace.
Request body
cancellation_key*stringThe `cancellation_key` given at send.
Example: "invite.sent:inv_77"
Response · 200 What was cancelled.
cancelled*arrayNotifications that were cancelled (empty when none was live).
deliveries_cancelled*integerDeliveries moved to `skipped: cancelled`.
Example
Request
POST https://api.notify.productcraft.co/v1/workspaces/{workspace_id}/notifications/cancel
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"cancellation_key": "invite.sent:inv_77"
}import { Notify } from "@productcraft/notify";
// Reads PRODUCTCRAFT_API_KEY and PRODUCTCRAFT_WORKSPACE_ID from the environment;
// client routes take a recipient token: notify.client({ token })
const notify = new Notify();
const cancelByKey = await notify.notifications.cancelByKey({ cancellation_key: "invite:inv_77" });notify.notifications.cancelByKey(params, options?): Notify.CancelByKey
Response
{
"cancelled": [
"00000000-0000-0000-0000-000000000000"
],
"deliveries_cancelled": 0
}