Documentation
DocsAPI ReferenceMessages & Threads
Messages & Threads API
POST
/v1/messages/sendSend an outbound email. Supports Idempotency-Key header.
| Parameter | Type | Required | Description |
|---|---|---|---|
| inboxId | string | Yes | Inbox to send from. The inbox's displayName is used as the sender name recipients see. |
| subject | string | Yes | Email subject line |
| body | string | Yes | The full email body content (plaintext) |
| html | string | No | Optional HTML version of the email body |
| from | string | Yes | Sender email address (must match the inbox address or a verified domain) |
| to | string[] | Yes | Recipient email addresses |
TypeScript
const message = await client.sendMessage({
inboxId: "inb_abc123",
subject: "Following up",
body: "Hi,\n\nJust checking in on our conversation from last week. I had a few ideas on how we could streamline the onboarding flow.\n\nWould love to set up a quick call to walk through them.\n\nBest,\nAgent",
from: "agent@yourdomain.com",
to: ["lead@company.com"]
});
// message.status = "queued"
// Recipients see the inbox's displayName as the sender (e.g. "Sales Team")curl
curl -X POST https://api.outreachagent.dev/v1/messages/send \
-H "Authorization: Bearer $OUTREACHAGENT_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: unique-id-123" \
-d '{
"inboxId": "inb_abc123",
"subject": "Following up",
"body": "Hi,\n\nJust checking in on our conversation from last week. I had a few ideas on how we could streamline the onboarding flow.\n\nWould love to set up a quick call to walk through them.\n\nBest,\nAgent",
"from": "agent@yourdomain.com",
"to": ["lead@company.com"]
}'The sender name that recipients see in their inbox and push notifications comes from the inbox's
displayName, not the from address. To change how your emails appear, update the inbox's display name via PATCH /v1/inboxes/:inboxId.GET
/v1/messagesList messages with pagination.
TypeScript
const messages = await client.listMessages({ limit: 50 });curl
curl "https://api.outreachagent.dev/v1/messages?limit=50" \ -H "Authorization: Bearer $OUTREACHAGENT_API_KEY"
GET
/v1/messages/:messageIdGet full message details including attachments.
TypeScript
const msg = await client.getMessage("msg_abc123");
console.log(msg.attachments); // Attachment[]curl
curl https://api.outreachagent.dev/v1/messages/msg_abc123 \ -H "Authorization: Bearer $OUTREACHAGENT_API_KEY"
GET
/v1/threadsList conversation threads.
TypeScript
const threads = await client.listThreads({ limit: 20 });curl
curl "https://api.outreachagent.dev/v1/threads?limit=20" \ -H "Authorization: Bearer $OUTREACHAGENT_API_KEY"
GET
/v1/threads/:threadIdGet a thread with participants and message count.
TypeScript
const thread = await client.getThread("thr_abc123");
console.log(thread.participants); // ["agent@...", "lead@..."]
console.log(thread.messageCount); // 5curl
curl https://api.outreachagent.dev/v1/threads/thr_abc123 \ -H "Authorization: Bearer $OUTREACHAGENT_API_KEY"