curl -X POST https://api.gork.email/v1/messages/send \
-H "Authorization: Bearer gork_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"inboxId": "inb_728af980b4e",
"to": ["prospect@acmecorp.com"],
"subject": "Quick question regarding agent fleet scaling",
"text": "Hi Alex,\n\nI noticed you are scaling your customer support agents..."
}'
import { Gork } from "@gork/sdk"
const gork = new Gork({ apiKey: process.env.GORK_API_KEY })
const message = await gork.messages.send({
inboxId: "inb_728af980b4e",
to: ["prospect@acmecorp.com"],
subject: "Quick question regarding agent fleet scaling",
text: "Hi Alex,\n\nI noticed you are scaling your customer support agents..."
})
import requests, os
res = requests.post(
"https://api.gork.email/v1/messages/send",
headers={"Authorization": f"Bearer {os.getenv('GORK_API_KEY')}"},
json={
"inboxId": "inb_728af980b4e",
"to": ["prospect@acmecorp.com"],
"subject": "Quick question regarding agent fleet scaling",
"text": "Hi Alex,\n\nI noticed you are scaling your customer support agents..."
}
)
{
"data": {
"id": "msg_90e38dfb4a2c",
"threadId": "thd_128bca90f4",
"inboxId": "inb_728af980b4e",
"direction": "outbound",
"status": "sent",
"createdAt": "2026-09-07T12:00:00.000Z"
}
}
Messages
Send Message
Send an outbound email or automated reply from any active inbox.
POST
/
v1
/
messages
/
send
curl -X POST https://api.gork.email/v1/messages/send \
-H "Authorization: Bearer gork_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"inboxId": "inb_728af980b4e",
"to": ["prospect@acmecorp.com"],
"subject": "Quick question regarding agent fleet scaling",
"text": "Hi Alex,\n\nI noticed you are scaling your customer support agents..."
}'
import { Gork } from "@gork/sdk"
const gork = new Gork({ apiKey: process.env.GORK_API_KEY })
const message = await gork.messages.send({
inboxId: "inb_728af980b4e",
to: ["prospect@acmecorp.com"],
subject: "Quick question regarding agent fleet scaling",
text: "Hi Alex,\n\nI noticed you are scaling your customer support agents..."
})
import requests, os
res = requests.post(
"https://api.gork.email/v1/messages/send",
headers={"Authorization": f"Bearer {os.getenv('GORK_API_KEY')}"},
json={
"inboxId": "inb_728af980b4e",
"to": ["prospect@acmecorp.com"],
"subject": "Quick question regarding agent fleet scaling",
"text": "Hi Alex,\n\nI noticed you are scaling your customer support agents..."
}
)
{
"data": {
"id": "msg_90e38dfb4a2c",
"threadId": "thd_128bca90f4",
"inboxId": "inb_728af980b4e",
"direction": "outbound",
"status": "sent",
"createdAt": "2026-09-07T12:00:00.000Z"
}
}
Dispatch an email message from one of your provisioned inboxes. The outbound message is automatically signed with your organization’s DKIM keys and wrapped in loop-suppression headers to prevent infinite mail loops.
Files are stored against the message and count toward your workspace storage.
Read one back with
Headers
string
required
Bearer token formatted as
Bearer gork_live_... or scoped inbox key.string
Optional unique UUID string (max 255 chars) to prevent double sending on network retry.
Body
string
required
The unique ID of the inbox sending the email (e.g.
inb_8f29ac01...).string[]
required
Array of recipient email addresses. Max 50 recipients per request.
string
default:"(no subject)"
The subject line of the email. Max 500 characters.
string
Plain text body of the email.
string
Rich HTML body. Automatically sanitized before dispatch.
string[]
Array of CC recipient email addresses.
string[]
Array of BCC recipient email addresses.
string
Optional message or thread ID to preserve email threading and headers (
In-Reply-To, References).object[]
Files to attach. Each entry takes
filename, an optional contentType, and
content — the file’s raw bytes as a base64 string. Limits: 10 files per
email, 10MB per file, 15MB total including the body. Attachments are sent natively, not as links.Attachments
Send a file by base64-encoding its bytes:cURL
curl -X POST https://api.gork.email/v1/messages/send \
-H "Authorization: Bearer gork_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"inboxId\": \"inb_728af980b4e\",
\"to\": [\"billing@acmecorp.com\"],
\"subject\": \"Invoice #1042\",
\"text\": \"Invoice attached.\",
\"attachments\": [{
\"filename\": \"invoice-1042.pdf\",
\"contentType\": \"application/pdf\",
\"content\": \"$(base64 -w0 invoice-1042.pdf)\"
}]
}"
TypeScript
import { readFileSync } from "node:fs"
import { Gork } from "@gork/sdk"
const gork = new Gork({ apiKey: process.env.GORK_API_KEY })
await gork.messages.send({
inboxId: "inb_728af980b4e",
to: ["billing@acmecorp.com"],
subject: "Invoice #1042",
text: "Invoice attached.",
attachments: [
{
filename: "invoice-1042.pdf",
contentType: "application/pdf",
content: readFileSync("invoice-1042.pdf").toString("base64"),
},
],
})
GET /v1/attachments/{id} (or client.attachments.download(id)
in the SDK) — see Read Attachment.
Scheduling
string
ISO 8601 timestamp to schedule the message instead of sending it now. Must be
at least 1 minute and at most 30 days ahead. The message is stored with
status Attachments cannot be scheduled yet — a scheduled message with files is
rejected with
scheduled (HTTP 202), no quota is consumed until it actually
dispatches, and it can be cancelled while still scheduled:curl -X DELETE https://api.gork.email/v1/messages/msg_90e38dfb4a2c/schedule \
-H "Authorization: Bearer gork_live_YOUR_API_KEY"
attachments_not_schedulable rather than silently dropping them.Open tracking (opt-in)
boolean
default:"false"
Adds a signed 1×1 pixel to the HTML part and fires
email.opened the first
time it is fetched. Off by default: tracking pixels make mail look like
marketing, which is a deliverability cost most transactional agent mail
should not pay. When the message has no HTML body, the plain text is wrapped
in a minimal HTML part so the pixel has somewhere to live.Automatic retries
A send that fails with a transient provider error (network failure, 5xx, throttling) is retried automatically after 2 minutes, then 10, then 30. A permanent rejection (unverified destination, invalid address, auth failure) is never retried. Quota consumed by a failed attempt is refunded, so a retry never costs you twice.Response
object
curl -X POST https://api.gork.email/v1/messages/send \
-H "Authorization: Bearer gork_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"inboxId": "inb_728af980b4e",
"to": ["prospect@acmecorp.com"],
"subject": "Quick question regarding agent fleet scaling",
"text": "Hi Alex,\n\nI noticed you are scaling your customer support agents..."
}'
import { Gork } from "@gork/sdk"
const gork = new Gork({ apiKey: process.env.GORK_API_KEY })
const message = await gork.messages.send({
inboxId: "inb_728af980b4e",
to: ["prospect@acmecorp.com"],
subject: "Quick question regarding agent fleet scaling",
text: "Hi Alex,\n\nI noticed you are scaling your customer support agents..."
})
import requests, os
res = requests.post(
"https://api.gork.email/v1/messages/send",
headers={"Authorization": f"Bearer {os.getenv('GORK_API_KEY')}"},
json={
"inboxId": "inb_728af980b4e",
"to": ["prospect@acmecorp.com"],
"subject": "Quick question regarding agent fleet scaling",
"text": "Hi Alex,\n\nI noticed you are scaling your customer support agents..."
}
)
{
"data": {
"id": "msg_90e38dfb4a2c",
"threadId": "thd_128bca90f4",
"inboxId": "inb_728af980b4e",
"direction": "outbound",
"status": "sent",
"createdAt": "2026-09-07T12:00:00.000Z"
}
}