Mail API reference

Mail API · Threads

post/v1/workspaces/{workspace_id}/threads/{id}/forwardAuth

Forward a message of a conversation

Sends a message of the thread on to `to` (and `cc` / `bcc`) from the thread's mailbox, with `Fwd: ` before the subject, your optional note (`text` / `html`) above a `Forwarded message` block (sender, date, subject, recipients, original text) and the original's files attached (executables left out; over 20 files or 10 MB with yours, none, and the body says so). The forward appears in the thread. Needs `mail.send` on the mailbox.

Path parameters

workspace_id*string · uuid

Id of the workspace.

id*string · uuid

Thread id.

Headers

Idempotency-Keystring

Opaque client-generated string (1–256 chars, `[A-Za-z0-9._:-]`) used to deduplicate retries within a 24h window. A retry with the same key and body returns the original response with `Idempotent-Replay: true`.

Request body

htmlstring

HTML body. At least one of `html` and `text`. With no `text`, the plain-text part is derived from it.

Example: "<p>Thanks, the refund is on its way.</p>"

textstring

Plain-text body. At least one of `html` and `text`.

Example: "Thanks, the refund is on its way."

ccobject

Cc recipients: one address or an array. Shown in the `Cc` header to every recipient.

Example: ["finance@example.com"]

bccobject

Bcc recipients: one address or an array. Each gets the message; no header names them.

Example: ["audit@example.com"]

attachmentsarray

Files to attach, and inline images (`content_id`). Up to 20 files and 10 MB in total after decoding (400 `MAIL_ATTACHMENT_TOO_LARGE`). Stored for the message log's 30 days and downloadable from `GET /emails/{id}/attachments/{position}`. We do not scan for viruses: executable files are refused by name, declared type and content (400 `MAIL_ATTACHMENT_TYPE_BLOCKED`), and archives are passed through unopened. Not accepted by the batch routes (400 `MAIL_ATTACHMENTS_NOT_IN_BATCH`).

message_id*string · uuid

The message to forward: a received or sent message of this thread.

Example: "3f0a3c3e-6c1d-4b8e-9b7a-0d4b1c2e3f40"

to*object

Who to forward it to: one address or an array. At most 50 recipients across `to`, `cc` and `bcc`.

Example: ["success@simulator.amazonses.com"]

Response · 202 Accepted; queued for delivery.

thread_id*string · uuid

The conversation the message was sent in.

email_id*string · uuid

The sent email (`GET /emails/{id}`); also its `messages[].id` in `GET /threads/{id}`.

subject*string

Subject it went out with.

Example: "Re: Refund for order 42"

to*array

Recipients in the `To` header.

Example: ["alice@example.com"]

cc*array

Recipients in the `Cc` header.

Example: []

Example

Request

POST https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/threads/{id}/forward
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "html": "<p>Thanks, the refund is on its way.</p>",
  "text": "Thanks, the refund is on its way.",
  "cc": [
    "finance@example.com"
  ],
  "bcc": [
    "audit@example.com"
  ],
  "attachments": [
    {
      "filename": "invoice-1234.pdf",
      "content": "JVBERi0xLjcKJcfsj6IKMSAwIG9iago8PC9UeXBlL0NhdGFsb2c+PgplbmRvYmoK",
      "path": "https://files.acme.com/invoices/1234.pdf",
      "content_type": "application/pdf",
      "content_id": "logo"
    }
  ],
  "message_id": "3f0a3c3e-6c1d-4b8e-9b7a-0d4b1c2e3f40",
  "to": [
    "success@simulator.amazonses.com"
  ]
}

Response

{
  "thread_id": "00000000-0000-0000-0000-000000000000",
  "email_id": "00000000-0000-0000-0000-000000000000",
  "subject": "Re: Refund for order 42",
  "to": [
    "alice@example.com"
  ],
  "cc": []
}