InyokeDocs

Add a lead

Post one lead into a lead list, and onto the campaign that list feeds, in a single call.

curl -X POST "https://www.inyoke.com/api/v1/lists/$LIST_ID/leads" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"firstName": "Ana", "lastName": "Rivera", "phone": "(305) 555-0123", "email": "ana@example.com", "state": "FL"}'

The list decides the campaign, because a list feeds at most one. Find a list's id with GET /lists. If the list feeds no campaign, the lead is filed and campaign and enrollment come back null.

Needs a key with Read and write access, and the Import leads permission.

The lead

KeyNotes
phoneRequired. Any common format. A number that can't be dialed answers 422.
name, or firstName and lastNameThe lead's name.
email, notes, sourceOptional.
state, zip, city, addressOptional. state is what licensing checks against.
fieldsYour agency's own fields, as { "<field key>": "value" }, by the key the Fields page lists. At most 100.

Every value is text of at most 500 characters. A key the lead doesn't take, or a field your agency doesn't have, is refused by name rather than dropped. The API never makes new fields.

The answer

{
  "result": "created",
  "lead": { "id": "cm2x9k1ld0003", "name": "Ana Rivera", "phone": "(305) 555-0123" },
  "list": { "id": "cm2x9k1lt0002" },
  "campaign": { "id": "cm2x9k1ab0001", "label": "Final expense Florida" },
  "enrollment": { "state": "active" }
}

result

ValueMeaning
createdA new lead was made and filed into the list. Status 201.
matchedYour agency already had this lead. It was filed into the list. Status 200.
already_calledYour agency has already called this number, so it was dropped: nothing was filed or enrolled, and lead is null. Status 200.

enrollment.state

ValueMeaning
activeOn the campaign and ready to be dialed.
already_onAlready on the campaign, and nothing changed.
blockedThe campaign's screening refused it. reasons lists why.
heldParked until someone on the campaign is licensed for the lead's state.
not_enrolledThe lead couldn't be put on the campaign. reasons says why.

Duplicates and retries

Adding a lead goes through the same duplicate rules and screening as an uploaded file. It's safe to retry: posting the same lead again finds the lead the first post made, files nothing new, and its enrollment reads already_on.

A key with Read and write access is told the name and phone of a matched lead you can see. A key that can only write is told its id and nothing else.

On this page