InyokeDocs
Leads

Remove leads from a campaign

POST
/campaigns/{campaignId}/leads/remove

Stops dialing these leads on this campaign, exactly as Remove does on the website, and answers one line per entry in the order sent. Lead lists and the leads themselves are untouched, and a later playlist sync, list re-attach or import can put a removed lead back. Needs the leads:write scope, and the Create campaigns permission with See campaigns set to Everyone's.

Authorization

headerAuthorizationBearer <sk_live_...>

Your API key in an Authorization header: Authorization: Bearer sk_live_.... When a request carries a Bearer key and an x-api-key header, the Bearer key is used.

Path Parameters

campaignId*string

A campaign id from GET /campaigns. A campaign the key's holder can't reach, or an archived one, answers 404, the same as one that doesn't exist.

Request Body

application/json
  1. body
leads*array<|>

The leads to take off the campaign, each named by id or by phone.

Items1 <= items <= 1000

Response Body

One line per entry, whatever each says. An entry that names nothing is its own not_found line, never a refusal of the whole call.

application/json
  1. response
results*array<>

One line per entry you sent, in the order you sent them.

Example Request
curl -X POST 'https://www.inyoke.com/api/v1/campaigns/cmhd4q2nb0001s8a1x7k3p9vz/leads/remove' \  -H 'Content-Type: application/json' \  -d '{  "leads": [    {      "id": "cmhe1b7yf0012lq09d4n8r3ua"    },    {      "phone": "(305) 555-0199"    },    {      "phone": "+15125550147"    }  ]}'
Example Response
{  "results": [    {      "id": "cmhe1b7yf0012lq09d4n8r3ua",      "outcome": "removed",      "leadIds": [        "cmhe1b7yf0012lq09d4n8r3ua"      ]    },    {      "phone": "(305) 555-0199",      "outcome": "not_found"    },    {      "phone": "+15125550147",      "outcome": "not_on_campaign",      "leadIds": [        "cmhe1c2mq0014lq09v7x1d9sf"      ]    }  ]}