Send a file
Send a CSV of leads to one of your ads in three calls, then read the file until it has finished.
A file is a CSV with a header row, the same columns a post's rows take. It can be 50 MB and 200,000 rows at most, and one file is read at a time.
You can ask for 20 upload addresses a day, and each one lasts an hour.
An uploaded file is kept 90 days whatever happens to it, even if it is never started or you take it off sale.
Three calls send a file. Run each one, setting the variables it names from the answer before it.
Ask for a place to put the file
Send the file's name and its size in bytes. The answer has an uploadId to keep and a url signed for exactly that many bytes.
curl -X POST "https://www.inyoke.com/api/vendor/v1/uploads" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d "{\"fileName\": \"leads.csv\", \"size\": $(wc -c < leads.csv | tr -d ' ')}"Put the file at that address
Send the file's bytes to the url before expiresAt. This goes to file storage, so send no API key. An answer of 200 means the file is there.
curl -X PUT "$UPLOAD_URL" --upload-file leads.csvStart the file on an ad
Send the uploadId, the name, the size and the day you scrubbed the file. Then read GET /files/{fileId} until its status is DONE or FAILED.
curl -X POST "https://www.inyoke.com/api/vendor/v1/listings/$LISTING_ID/files" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d "{\"uploadId\": \"$UPLOAD_ID\", \"fileName\": \"leads.csv\", \"size\": $(wc -c < leads.csv | tr -d ' '), \"scrubbedAt\": \"2026-11-03\"}"Ask for a place to put a file
POST /api/vendor/v1/uploads
Ask for a place to put one CSV file. Nothing is started yet.
Scope: leads:write. Status: 201. Try it in the API reference.
Request
| Field | In | Required | Description |
|---|---|---|---|
fileName | body | Yes | The file's name. |
size | body | Yes | The file's size in bytes, at most 50 MB. |
Request body
{
"fileName": "leads.csv",
"size": 48213
}Example
curl -X POST "https://www.inyoke.com/api/vendor/v1/uploads" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"fileName":"leads.csv","size":48213}'Response
{
"uploadId": "imports/vnd-cm3p8k2tn0000/9f2c4e7a1b8d3f60a5c2e4b79d1a8f35/leads.csv",
"url": "https://files.example.com/…?X-Amz-Signature=…",
"expiresAt": "2026-11-04T15:05:00.000Z"
}urlis signed for exactlysizebytes, so aPUTof any other size fails. Put the file there beforeexpiresAt.- Keep
uploadIdas it is, and send it to start the file. Only your account can start it. - You can ask for 20 upload addresses a day.
Refusals
| Status | Code | Reason | When |
|---|---|---|---|
413 | invalid | The body is over 1 MB. | |
400 | invalid | The body isn't JSON. | |
422 | invalid | The body is JSON and doesn't fit the call. The message says what to fix, a key the call doesn't take included. | |
403 | forbidden | stopped | Your account is paused or suspended. Reads still work, and nothing can be sent until the platform lifts it. |
403 | forbidden | cant_post | Your account can't send anything right now. |
403 | forbidden | agreement_owed | The vendor agreement has changed. Sign the new version on the website, then send again. |
403 | forbidden | attestation_owed | The feed attestation has changed. Sign the new version on the website, then send again. |
422 | invalid | file_too_big | The file is over 50 MB. |
422 | invalid | storage_off | File uploads aren't available right now. |
429 | rate_limited | upload_budget | You've asked for 20 upload addresses today. Retry-After says when the day turns over, at midnight UTC. |
500 | internal | upload_budget_unavailable | Your upload addresses for today couldn't be counted just now, so none was made. Try again in a moment. |
Start a file
POST /api/vendor/v1/listings/{listingId}/files
Start reading a file you have put at its upload address, onto one of your ads.
Scope: leads:write. Status: 202. Try it in the API reference.
Request
| Field | In | Required | Description |
|---|---|---|---|
listingId | path | Yes | Your ad's id, from GET /listings. |
uploadId | body | Yes | The uploadId that POST /uploads answered. |
fileName | body | Yes | The file's name, as sent to POST /uploads. |
size | body | Yes | The file's size in bytes, as sent to POST /uploads. |
scrubbedAt | body | Yes | The day, YYYY-MM-DD in UTC, you checked this file against the National Do Not Call Registry. |
Request body
{
"uploadId": "imports/vnd-cm3p8k2tn0000/9f2c4e7a1b8d3f60a5c2e4b79d1a8f35/leads.csv",
"fileName": "leads.csv",
"size": 48213,
"scrubbedAt": "2026-11-03"
}Example
curl -X POST "https://www.inyoke.com/api/vendor/v1/listings/$LISTING_ID/files" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d "{\"uploadId\": \"$UPLOAD_ID\", \"fileName\": \"leads.csv\", \"size\": $(wc -c < leads.csv | tr -d ' '), \"scrubbedAt\": \"2026-11-03\"}"Response
{
"fileId": "cm3p8k2fb0009"
}- Read its progress with
GET /files/{fileId}. - A start that timed out can be sent again with the same
uploadIdto the same ad. It answers the samefileIdand starts nothing twice. - One file is read at a time. Starting another while one is being read is refused with
file_open. - A file holds at most 200,000 rows. A file over that, or over what's left of your allowance, fails whole, and its rows use none of it.
Refusals
| Status | Code | Reason | When |
|---|---|---|---|
413 | invalid | The body is over 1 MB. | |
400 | invalid | The body isn't JSON. | |
422 | invalid | The body is JSON and doesn't fit the call. The message says what to fix, a key the call doesn't take included. | |
403 | forbidden | stopped | Your account is paused or suspended. Reads still work, and nothing can be sent until the platform lifts it. |
403 | forbidden | cant_post | Your account can't send anything right now. |
403 | forbidden | agreement_owed | The vendor agreement has changed. Sign the new version on the website, then send again. |
403 | forbidden | attestation_owed | The feed attestation has changed. Sign the new version on the website, then send again. |
404 | not_found | ad_not_found | That ad isn't on your account. Another vendor's ad reads the same as one that doesn't exist. |
422 | invalid | ad_retired | That ad is retired, so it can't take leads. |
422 | invalid | scrub_date | The scrub date is missing, in the future, or more than 31 days old. |
422 | invalid | storage_off | File uploads aren't available right now. |
422 | invalid | upload_not_valid | That uploadId isn't one this account was given. |
422 | invalid | upload_not_found | Nothing has been put at that upload's address yet, or it has expired. |
422 | invalid | upload_size_changed | The file put at the address isn't the size you asked for. |
422 | invalid | upload_already_started | That uploadId has already started a file on another of your ads. |
409 | conflict | file_open | Another of your files is still being read. Wait for it to finish, then start this one. |
Read a file
GET /api/vendor/v1/files/{fileId}
One of your files: where it stands, how many rows were read and refused, and the first refusals.
Scope: leads:read. Status: 200. Try it in the API reference.
Request
| Field | In | Required | Description |
|---|---|---|---|
fileId | path | Yes | The fileId that POST /listings/{listingId}/files answered. |
Example
curl "https://www.inyoke.com/api/vendor/v1/files/$FILE_ID" \
-H "Authorization: Bearer $API_KEY"Response
{
"id": "cm3p8k2fb0009",
"typeId": "vnd-ad-3f9c2a7e1b4d8f60a5c2e4b7",
"fileName": "leads.csv",
"status": "DONE",
"rowsTotal": 1200,
"rowsProcessed": 1200,
"rowsInvalid": 14,
"rejectSample": [
{
"row": 7,
"reason": "No valid consent date"
}
],
"scrubbedAt": "2026-11-03T00:00:00.000Z",
"createdAt": "2026-11-04T14:05:00.000Z",
"pulledAt": null,
"failure": null
}rowsTotalis null until the file has been counted.rowsProcessedandrowsInvalidare rows read and rows refused.rejectSampleholds the first 20 refused rows, by row number, with a sentence each.pulledAtis set on a file taken off sale.failuresays why aFAILEDfile stopped.- Read to the end says nothing about what went on sale.
status:
| Code | Meaning |
|---|---|
QUEUED | Waiting to be read. |
RUNNING | Being read. |
DONE | Read to the end. It says nothing about what went on sale. |
FAILED | Stopped, and failure says why. |
PULLED | Taken off sale before it was read to the end. |
Refusals
| Status | Code | Reason | When |
|---|---|---|---|
403 | forbidden | cant_read | Your account can't read this right now, usually because something is waiting to be signed. GET /me says why. |
404 | not_found | file_not_found | That file isn't on your account. Another vendor's file, a day's feed and an id nobody has all read the same. |