InyokeDocs
Leads

Add a lead to a list

POST
/lists/{listId}/leads

Adds one lead to an existing lead list and, when the list feeds a campaign, puts it on that campaign with the same duplicate rules and screening as a row of an uploaded file. Safe to retry once the first post has answered: a repeat finds the same lead, files nothing new, and its enrollment reads already_on. Needs the leads:write scope and the Import leads permission.

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

listId*string

A list id from GET /lists.

Request Body

application/json
  1. body

One lead. Only phone is required. A key the lead doesn't take is refused by name, never dropped. Every value is text of at most 500 characters.

phone*string

The lead's phone number, written any way. One that can't be dialed answers 422.

Length1 <= length <= 500
name?string

The full name. Or send firstName and lastName.

Lengthlength <= 500
firstName?string
Lengthlength <= 500
lastName?string
Lengthlength <= 500
email?string
Lengthlength <= 500
notes?string
Lengthlength <= 500
source?string
Lengthlength <= 500
state?string

The lead's state. An agency with the People module doesn't take state, zip, city or address yet: send them in fields under one of its own field keys.

Lengthlength <= 500
zip?string
Lengthlength <= 500
city?string
Lengthlength <= 500
address?string
Lengthlength <= 500
fields?

Anything else about the lead, under the agency's own field keys as the Fields page lists them. A key the agency doesn't have is refused by name, because the API makes no fields. Send numbers as text ("42").

Propertiesproperties <= 100

Response Body

The agency already had this lead (matched), or has already called this number (already_called).

application/json
  1. response
result*string

created: a new lead was made and filed into the list (201). matched: the agency already had this lead, and it was filed into the list (200). already_called: the agency has already called this number, so it was dropped as a duplicate, nothing was filed or enrolled, and lead is null (200).

Value in"created""matched""already_called"
lead*|

The lead, or null when result is already_called.

list*
campaign*|

The campaign the list feeds, or null when it feeds none.

enrollment*|

How putting the lead on the campaign went, or null when there is no campaign or nothing was filed.

curl -X POST 'https://www.inyoke.com/api/v1/lists/cmhd4s1pw0006s8a1t9e3h7ud/leads' \  -H 'Content-Type: application/json' \  -d '{  "firstName": "Ana",  "lastName": "Rivera",  "phone": "(305) 555-0123",  "email": "ana.rivera@example.com",  "state": "FL",  "source": "Web form"}'
Example Response
{  "result": "matched",  "lead": {    "id": "cmhe1b7yf0012lq09d4n8r3ua",    "name": "Ana Rivera",    "phone": "(305) 555-0123"  },  "list": {    "id": "cmhd4s1pw0006s8a1t9e3h7ud"  },  "campaign": {    "id": "cmhd4q2nb0001s8a1x7k3p9vz",    "label": "Final expense Florida"  },  "enrollment": {    "state": "already_on",    "onCampaign": "active",    "dialState": "scheduled"  }}