---
title: "Create batch send"
method: POST
path: "/v1/batch/"
tags: ["batch"]
---

# Create batch send

`POST /v1/batch/`

## Request

- Base URL: `https://api.wraps.dev`
- URL: `https://api.wraps.dev/v1/batch/`
- Auth: HTTP bearer

Creates a new batch send job and queues it for processing

## Request body

- object
  - `channel` union: Channel to send through
    - string
    - string
  - `name` string: Name for the batch send
  - `audienceType` union: Audience targeting type
    - string
    - string
    - string
  - `topicId` string: Topic ID to target
  - `segmentId` string: Segment ID to target
  - `subject` string: Email subject line
  - `previewText` string: Email preview text
  - `from` string: From email address
  - `fromName` string: From display name
  - `replyTo` string: Reply-to email address
  - `templateId` string: Email template ID
  - `htmlContent` string: Raw HTML content (if not using template)
  - `variableMappings` object[]: Variable mappings for custom template variables
    - `variableName` string, required: Template variable name
    - `source` union, required
      - object
        - `type` string, required
        - `value` string, required: Static value
      - object
        - `type` string, required
        - `field` string, required: Contact field name
  - `body` string: SMS body text
  - `senderId` string: SMS sender ID
  - `scheduledFor` string, date-time: ISO 8601 datetime for scheduled send
  - `awsAccountId` string, required: AWS account ID to use for sending
  - `totalRecipients` number: Pre-counted recipient count

## Response `200`

- object
  - `id` string, required: Batch ID
  - `status` string, required: Batch status (queued, scheduled, processing, completed, failed, cancelled)
  - `channel` string, required: Channel (email or sms)
  - `totalRecipients` number, required: Total number of recipients
  - `createdAt` string, date-time, required: Creation timestamp
  - `warning` string: Set when the broadcast was accepted but something about it needs saying — e.g. it was marked scheduled in an environment with no scheduler configured, so it will never fire.

## Other responses

- `400`: Malformed request — unparseable body or an invalid parameter.
- `401`: Missing, malformed, or revoked credentials. Send `Authorization: Bearer <api key>`.
- `403`: Authenticated, but the resource belongs to another organization.
- `404`: No such route, or no such resource in this organization.
- `422`: The request parsed but failed schema validation.
- `429`: Rate limit exceeded. Wait for the window named by the RateLimit headers.
- `500`: Unexpected server failure. Safe to retry with backoff; quote `requestId` if it persists.

---

[API](https://skmtc.dev/wraps/apis/wraps-platform-api.md) · [All operations](https://skmtc.dev/wraps/apis/wraps-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/wraps/apis/wraps-platform-api/revisions/12116fb21af7?raw)
