Messages

Send, reply, list, and retrieve messages within an inbox.

Messages encapsulate email content processed by Sendook—text, HTML, participants, and labels. All message routes are scoped to a specific inbox.

Send a message

  • Method: POST
  • Path: /v1/inboxes/{inboxId}/messages/send
  • Auth: Required

Path parameters

ParameterTypeDescription
inboxIdstringInbox that will send the outbound email.

Request body

{
  "to": ["recipient@example.com"],
  "cc": ["manager@example.com"],
  "bcc": [],
  "labels": ["outbound", "welcome"],
  "subject": "Welcome to Sendook",
  "text": "Plain text version of the email.",
  "html": "<p>HTML version of the email.</p>",
  "attachments": [
    {
      "content": "base64-encoded-file-content",
      "name": "document.pdf",
      "contentType": "application/pdf"
    }
  ]
}
FieldTypeRequiredDescription
tostringYesPrimary recipients (must contain at least one email).
ccstringNoCarbon copy recipients.
bccstringNoBlind carbon copy recipients.
labelsstringNoCustom labels applied to the message.
subjectstringYesMessage subject line.
textstringYesPlain-text body.
htmlstringYesHTML body.
attachmentsobjectNoArray of file attachments. Each attachment must include content (base64-encoded), optional name (filename), and optional contentType (MIME type).

Response 202 Accepted

{
  "id": "msg_01J3ZN9SB2M5MHF5C2QBP4DT78",
  "subject": "Welcome to Sendook",
  "text": "Plain text version of the email.",
  "html": "<p>HTML version of the email.</p>",
  "labels": ["outbound", "welcome"],
  "createdAt": "2024-10-10T19:22:10Z"
  // ...delivery metadata may be included
}

202 Accepted indicates the message is queued for delivery; monitor webhooks or threads for delivery outcomes.

Reply to a message

  • Method: POST
  • Path: /v1/inboxes/{inboxId}/messages/{messageId}/reply
  • Auth: Required

Path parameters

ParameterTypeDescription
inboxIdstringInbox that will send the reply.
messageIdstringOriginal message to reply to.

Request body

{
  "text": "Thanks for reaching out!",
  "html": "<p>Thanks for reaching out!</p>"
}

Both text and html representations are required to ensure accessibility.

Response 202 Accepted

The payload matches the standard Message schema with the newly created reply.

List messages

  • Method: GET
  • Path: /v1/inboxes/{inboxId}/messages
  • Auth: Required

Query parameters

ParameterTypeDescription
querystringOptional filter expression to search messages.

Response 200 OK

[
  {
    "id": "msg_01J3ZN9SB2M5MHF5C2QBP4DT78",
    "subject": "Welcome to Sendook",
    "text": "Plain text version of the email.",
    "html": "<p>HTML version of the email.</p>",
    "labels": ["outbound", "welcome"],
    "createdAt": "2024-10-10T19:22:10Z"
  }
]

Retrieve a message

  • Method: GET
  • Path: /v1/inboxes/{inboxId}/messages/{messageId}
  • Auth: Required

Response 200 OK

{
  "id": "msg_01J3ZN9SB2M5MHF5C2QBP4DT78",
  "subject": "Welcome to Sendook",
  "text": "Plain text version of the email.",
  "html": "<p>HTML version of the email.</p>",
  "labels": ["outbound", "welcome"],
  "createdAt": "2024-10-10T19:22:10Z"
}

Message schema

The Message schema includes the following core fields (additional metadata may be present):

FieldTypeDescription
idstringUnique message identifier.
subjectstringEmail subject line.
textstringPlain-text content.
htmlstringHTML content.
labelsstringCustom labels assigned to the message.
createdAtstring (date-time)Timestamp when the message was created.