curl -X DELETE https://api.gork.email/v1/messages/msg_90e38dfb4a2c \
-H "Authorization: Bearer gork_live_YOUR_API_KEY"
import { Gork } from "@gork/sdk"
const gork = new Gork({ apiKey: process.env.GORK_API_KEY })
// The SDK has no delete helper — call the endpoint directly.
// (Cancel a scheduled send instead with gork.messages.cancelScheduled(id).)
await fetch("https://api.gork.email/v1/messages/msg_90e38dfb4a2c", {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.GORK_API_KEY}` },
})
import requests, os
res = requests.delete(
"https://api.gork.email/v1/messages/msg_90e38dfb4a2c",
headers={"Authorization": f"Bearer {os.getenv('GORK_API_KEY')}"},
)
{
"data": {
"id": "msg_90e38dfb4a2c",
"deleted": true
}
}
Messages
Delete Message
Permanently delete a message and its attachments, or cancel a scheduled send.
DELETE
/
v1
/
messages
/
{id}
curl -X DELETE https://api.gork.email/v1/messages/msg_90e38dfb4a2c \
-H "Authorization: Bearer gork_live_YOUR_API_KEY"
import { Gork } from "@gork/sdk"
const gork = new Gork({ apiKey: process.env.GORK_API_KEY })
// The SDK has no delete helper — call the endpoint directly.
// (Cancel a scheduled send instead with gork.messages.cancelScheduled(id).)
await fetch("https://api.gork.email/v1/messages/msg_90e38dfb4a2c", {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.GORK_API_KEY}` },
})
import requests, os
res = requests.delete(
"https://api.gork.email/v1/messages/msg_90e38dfb4a2c",
headers={"Authorization": f"Bearer {os.getenv('GORK_API_KEY')}"},
)
{
"data": {
"id": "msg_90e38dfb4a2c",
"deleted": true
}
}
Two destructive operations on messages, both requiring the
messages:send scope.
Delete a message
DELETE /v1/messages/{id} permanently deletes the message row. Attachment rows cascade-delete, and the stored objects — HTML body, raw archive, and every attachment — are removed from R2 when storage is bound. This cannot be undone.
curl -X DELETE https://api.gork.email/v1/messages/msg_90e38dfb4a2c \
-H "Authorization: Bearer gork_live_YOUR_API_KEY"
import { Gork } from "@gork/sdk"
const gork = new Gork({ apiKey: process.env.GORK_API_KEY })
// The SDK has no delete helper — call the endpoint directly.
// (Cancel a scheduled send instead with gork.messages.cancelScheduled(id).)
await fetch("https://api.gork.email/v1/messages/msg_90e38dfb4a2c", {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.GORK_API_KEY}` },
})
import requests, os
res = requests.delete(
"https://api.gork.email/v1/messages/msg_90e38dfb4a2c",
headers={"Authorization": f"Bearer {os.getenv('GORK_API_KEY')}"},
)
{
"data": {
"id": "msg_90e38dfb4a2c",
"deleted": true
}
}
Cancel a scheduled message
DELETE /v1/messages/{id}/schedule cancels a scheduled send before it dispatches. The record is kept for audit with status cancelled and can never be dispatched afterwards — the scheduler only picks up rows still marked scheduled. No quota is consumed by a cancelled message.
curl -X DELETE https://api.gork.email/v1/messages/msg_90e38dfb4a2c/schedule \
-H "Authorization: Bearer gork_live_YOUR_API_KEY"
import { Gork } from "@gork/sdk"
const gork = new Gork({ apiKey: process.env.GORK_API_KEY })
await gork.messages.cancelScheduled("msg_90e38dfb4a2c")
import requests, os
res = requests.delete(
"https://api.gork.email/v1/messages/msg_90e38dfb4a2c/schedule",
headers={"Authorization": f"Bearer {os.getenv('GORK_API_KEY')}"},
)
{
"data": {
"id": "msg_90e38dfb4a2c",
"status": "cancelled"
}
}
| Code | HTTP | Meaning |
|---|---|---|
inbox_access_denied | 403 | The key is bound to a different inbox than this message. |
message_not_found | 404 | No message with this ID exists in your organization. |
not_scheduled | 409 | Cancel-schedule only: the message is in another status (e.g. delivered) — there is nothing to cancel. |