Push to a campaign
From the Leads API reference. Requests use the base URL https://app.warmerly.com/api/v1 and an API key, see Authentication.
POST /leads/to-campaignSame 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 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. 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. |
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"]
}'{ "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), 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.