Start an import
Starts the website's own import of an uploaded file onto a campaign, in the background; watch it with GET /imports/{importId}. Imports run one at a time in an agency, so a start while another runs answers 409 import_running: retry it later with the same Idempotency-Key. Needs the leads:write scope and the Import leads permission.
AuthorizationBearer <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.
campaignId*stringA 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.
Idempotency-Key?stringA value of your choosing, new for each file (a UUID is right), and the same when you retry. A retry of the same file onto the same campaign by the same key holder returns the first import with status 200. A key that started anything else answers 409 idempotency_key_reused. A key names one import for good. An empty value is no key.
length <= 200application/json- body
uploadId*stringThe uploadId from POST /uploads, after the file has been put at its url.
1 <= length <= 1024mapping?Which target each column of the file goes to, as { "": "" }. Without a mapping, the server reads the first 64 KB of the file, finds the header row and matches the columns as the website's import does, and a plain CSV with headers such as first_name, phone and state needs no setup. A column is named by its header (in any case) or by its number counting from 1, and every column you leave out is ignored. A target is exact, so "phone" works and "Phone" doesn't. The targets are name, firstName, lastName, phone, email, notes, source, state, zip, city and address (the last four not for an agency with the People module); custom: for one of the agency's own fields, by its key on the Fields page; ignore to leave the column out; and, for an agency with the People module only, otherPhone, company:name, company:domain, company:phone and companyField:. The API makes no new fields. The mapping used comes back in the answer, so you can send it next time to pin it.
properties <= 512hasHeader?booleanWhether the first row is a header. Leave it out and it is worked out from the file. A mapping that names a column by its header counts as saying yes.
duplicates?stringWhat to do with a row whose number the agency already has. default: a duplicate of a number the agency has already called is dropped, and any other duplicate is skipped while the lead you already had joins the list. skip: duplicate rows are dropped, and the lead you already had joins the list. allow: every row is added, duplicates included. merge: duplicate rows are dropped, but their data updates the lead you already had. Duplicates are checked across the whole agency. An agency with the People module matches people its own way, and always imports as skip.
"default""default""skip""allow""merge"listName?stringA name for the new list the leads go into, with (2), (3) and so on added when the agency already has it. Without listName or listId, the new list is named from the file name and the minute the import started, in UTC. Send listName or listId, not both.
1 <= length <= 120listId?stringAn existing list to file the leads into, from GET /lists. It must feed this campaign or none (a list on none is attached to this campaign when the import finishes), and be switched on. Send listName or listId, not both.
1 <= length <= 200fileName?stringThe file's name, for the default list name. It defaults to the name at the end of uploadId.
1 <= length <= 255A retry: this Idempotency-Key already started this import, from the same file onto the same campaign by the same key holder, and that import is returned. A different mapping or list name in the retry doesn't change the import, but the mapping in this answer is the one worked out from the retry.
application/json- response
importId*stringWatch the import with GET /imports/{importId}.
listId*stringThe list the leads go into.
listName*stringmapping*The mapping the import uses, one entry for every column of the file, in the shape you send it. A column is keyed by its header, or by its number when it has no header, its header appears twice, or its header is only digits. On a replay it is worked out from the retry's request.
replayed*booleanTrue when an earlier start with this Idempotency-Key made the import. The status is then 200, not 201.
curl -X POST 'https://www.inyoke.com/api/v1/campaigns/cmhd4q2nb0001s8a1x7k3p9vz/imports' \ -H 'Idempotency-Key: 3f6b2a8e-4c1d-4e9a-9b7f-2d5c8e1a0f43' \ -H 'Content-Type: application/json' \ -d '{ "uploadId": "imports/cmh8w3k2c0000ab12cd34ef56/9f2c4e7a1b8d3f60a5c2e4b79d1a8f35/leads.csv"}'{ "importId": "cmhe2f3ja0007lq09p1s5v8xc", "listId": "cmhd4s1pw0006s8a1t9e3h7ud", "listName": "Vendor leads 2026-10-30", "mapping": { "First Name": "firstName", "Last Name": "lastName", "Cell": "phone", "State": "state", "Coverage": "custom:coverage_amount", "Lead Date": "ignore" }, "replayed": true}Ask for a place to upload a file POST
The first of three calls that put a CSV on a campaign: it answers with an uploadId to keep and a url to PUT the file to within the hour. Nothing is created until you start the import with that uploadId. Needs the leads:write scope and the Import leads permission.
Check an import GET
An import's status and counts; check every few seconds until status is done, failed or canceled. You can read an import you started, or any import in the agency if you hold the Import leads permission, and any other id answers 404. Needs the leads:read scope.