Skip to main content
POST
/
api
/
v1
/
emails
/
batch
Batch send emails
curl --request POST \
  --url http://localhost:3001/api/v1/emails/batch \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "items": [
    {
      "idempotencyKey": "<string>",
      "templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "profileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "from": "<string>",
      "replyTo": "<string>",
      "subject": "<string>",
      "subscriptionGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "to": {
        "email": "jsmith@example.com",
        "externalId": "<string>"
      },
      "cc": "<string>",
      "bcc": "<string>",
      "data": {},
      "tracking": {
        "clicks": true
      }
    }
  ],
  "defaults": {
    "templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "from": "<string>",
    "replyTo": "<string>",
    "subject": "<string>",
    "subscriptionGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "tracking": {
      "clicks": true
    }
  }
}
'
{
  "total": 4503599627370495,
  "accepted": 4503599627370495,
  "rejected": 4503599627370495,
  "items": [
    {
      "index": 4503599627370495,
      "idempotencyKey": "<string>",
      "send": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "templateSnapshotId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "from": {
          "email": "jsmith@example.com",
          "name": "<string>"
        },
        "replyTo": {
          "email": "jsmith@example.com",
          "name": "<string>"
        },
        "subject": "<string>",
        "subscriptionGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "profileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "to": {
          "email": "jsmith@example.com"
        },
        "cc": [
          {
            "email": "jsmith@example.com",
            "name": "<string>"
          }
        ],
        "messageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "failureMessage": "<string>",
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z"
      }
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://segmentflow.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Unified API key for server-side SDK and API integrations

Body

application/json
items
object[]
required

Independent email sends. Items are processed in order and each item has its own idempotency key and result.

Required array length: 1 - 100 elements
defaults
object

Shared batch defaults applied to each item before item validation. Recipient, data, cc, and bcc fields are not allowed here.

Response

Default Response

total
integer
required

Total items submitted.

Required range: 0 <= x <= 9007199254740991
accepted
integer
required

Items that created or replayed an EmailSend.

Required range: 0 <= x <= 9007199254740991
rejected
integer
required

Items rejected before creating an EmailSend.

Required range: 0 <= x <= 9007199254740991
items
(EmailBatchSendAcceptedItem · object | EmailBatchSendRejectedItem · object)[]
required

Ordered per-item results.