Documentation

DocsAPI ReferenceMessages & Threads

Messages & Threads API

POST/v1/messages/send

Send an outbound email. Supports Idempotency-Key header.

ParameterTypeRequiredDescription
inboxIdstringYesInbox to send from. The inbox's displayName is used as the sender name recipients see.
subjectstringYesEmail subject line
bodystringYesThe full email body content (plaintext)
htmlstringNoOptional HTML version of the email body
fromstringYesSender email address (must match the inbox address or a verified domain)
tostring[]YesRecipient 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/messages

List 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/:messageId

Get 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/threads

List 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/:threadId

Get 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); // 5
curl
curl https://api.outreachagent.dev/v1/threads/thr_abc123 \
  -H "Authorization: Bearer $OUTREACHAGENT_API_KEY"