> ## Documentation Index
> Fetch the complete documentation index at: https://usegately.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Bulk Campaign

> Send a campaign to a list of resolved recipient IDs

An alternative to [Send Campaign](/docs/api-reference/campaigns/send) for when you already have a flat list of recipient IDs rather than contact list or segment IDs.

Recipient IDs must follow the format `customer_<email>` or `form_customer_<email>`. IDs with a `member_` prefix are not supported by this endpoint — use `recipient_list_ids` in the standard send endpoint instead.

## Headers

<ParamField header="Authorization" type="string" required>
  `Bearer YOUR_API_KEY`
</ParamField>

<ParamField header="X-Project-ID" type="string">
  Your project UUID. Not required if the API key already encodes the project.
</ParamField>

## Request Body

<ParamField body="name" type="string" required>
  Campaign display name
</ParamField>

<ParamField body="subject" type="string" required>
  Email subject line
</ParamField>

<ParamField body="content" type="string" required>
  HTML email body
</ParamField>

<ParamField body="recipient_ids" type="string[]" required>
  Array of recipient IDs. Supported formats:

  * `customer_alice@example.com`
  * `form_customer_alice@example.com`
</ParamField>

<ParamField body="scheduled_at" type="string">
  ISO 8601 datetime to schedule delivery. Omit to send immediately.
</ParamField>

<ParamField body="attachments" type="object[]">
  Optional file attachments — same shape as [Send Campaign](/docs/api-reference/campaigns/send)
</ParamField>

## Response

Same shape as [Send Campaign](/docs/api-reference/campaigns/send).

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.usegately.com/api/v1/campaigns/send-bulk" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "X-Project-ID: YOUR_PROJECT_ID" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "VIP Promo",
      "subject": "Exclusive offer for you",
      "content": "<p>Here is your exclusive deal.</p>",
      "recipient_ids": [
        "customer_alice@example.com",
        "customer_bob@example.com"
      ]
    }'
  ```

  ```typescript SDK theme={null}
  import { GatelyCampaigns } from '@gately/sdk'

  const campaigns = new GatelyCampaigns({ projectId: 'YOUR_PROJECT_ID' })

  const result = await campaigns.sendBulk({
    name: 'VIP Promo',
    subject: 'Exclusive offer for you',
    content: '<p>Here is your exclusive deal.</p>',
    recipient_ids: [
      'customer_alice@example.com',
      'customer_bob@example.com',
    ],
  })

  console.log(`Sent to ${result.successful_sends} of ${result.total_recipients}`)
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "success": true,
    "campaign": {
      "id": "a1b2c3d4-e5f6-4789-abcd-ef1234567890",
      "name": "VIP Promo",
      "status": "sent",
      "total_recipients": 2,
      "delivered_count": 2
    },
    "total_recipients": 2,
    "successful_sends": 2,
    "failed_sends": 0,
    "message": "Email campaign sent to 2 of 2 recipients"
  }
  ```

  ```json No valid recipients theme={null}
  {
    "error": "No valid recipients found"
  }
  ```
</ResponseExample>
