# Push to a campaign

> Same selection shape as export, plus a target campaign. It adds matching companies directly to a campaign's audience instead of downloading a file and debits…

Source: https://warmerly.com/docs/leads/push-to-a-campaign

```text
POST /leads/to-campaign
```

Same selection shape as [export](https://warmerly.com/docs/leads/push-to-a-campaign#export-to-csv), plus a target campaign. It adds matching companies directly to a campaign's audience instead of downloading a file and debits the same monthly export quota as CSV export (the two share one meter).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `campaignId` | string (UUID) | Yes | The campaign to add leads to. |
| `domains` | string[] (1-10,000, each up to 253 characters) | One of `domains`/`selectAllMatching` | Explicit list of domains to add. |
| `filters` | object | No | Same filter shape as [export](https://warmerly.com/docs/leads/push-to-a-campaign#export-to-csv). Used with `selectAllMatching`; with `domains` only `channel` is read. |
| `selectAllMatching` | `true` | One of `domains`/`selectAllMatching` | Add every row matching `filters`, up to 10,000 rows per request. |

```bash
curl -X POST https://app.warmerly.com/api/v1/leads/to-campaign \
  -H "X-Api-Key: wmv_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "campaignId": "3a6f9e2e-4b7a-4e9a-9b1d-6e3a2f8c1a10",
    "domains": ["northwindtraders.com"]
  }'
```

```json
{ "added": 1, "skipped": 0, "rejected": 0, "noEmail": 0 }
```

`added` is the number of leads written. `skipped` counts rows already in the campaign's audience (deduplicated by lowercased email). `rejected` counts addresses that Warmerly's free checks proved invalid, which are never written. `noEmail` counts companies selected that have no contact email (for example under `channel=form`); a campaign lead is an email address, so they cannot be added. Only `added` counts against your export quota. Only the first 10,000 rows of a selection are used. If none of the rows has an email, the response is `{ "added": 0, "skipped": 0, "noEmail": N }`.

Errors: `400 bad_request` (`invalid_push_request` for a malformed body, including no selection; `too_many_leads`), `402 quota_exhausted` (same shape as [export](https://warmerly.com/docs/leads/push-to-a-campaign#export-to-csv)), `402 billing_locked` if the campaign's workspace has a billing issue, `402 campaign_lead_limit` if the campaign would go over its lead ceiling, `403 forbidden` for a campaign in a workspace you are not a member of, and `404 not_found` for an unknown `campaignId`.

## More from Leads

- [Export to CSV](https://warmerly.com/docs/leads/export-to-csv): Exports matching companies as a CSV file (download, not JSON). Debits your monthly lead export quota by the…
- [LinkedIn people search](https://warmerly.com/docs/leads/linkedin-people-search): A different database to the company search above: this queries LinkedIn through your own connected LinkedIn…
- [Export quota](https://warmerly.com/docs/leads/export-quota): Returns your current lead-export usage for the billing period. A pure read, checking it never debits quota.
