InyokeDocs

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.csv

Start 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

FieldInRequiredDescription
fileNamebodyYesThe file's name.
sizebodyYesThe 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"
}
  • url is signed for exactly size bytes, so a PUT of any other size fails. Put the file there before expiresAt.
  • Keep uploadId as 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

StatusCodeReasonWhen
413invalidThe body is over 1 MB.
400invalidThe body isn't JSON.
422invalidThe body is JSON and doesn't fit the call. The message says what to fix, a key the call doesn't take included.
403forbiddenstoppedYour account is paused or suspended. Reads still work, and nothing can be sent until the platform lifts it.
403forbiddencant_postYour account can't send anything right now.
403forbiddenagreement_owedThe vendor agreement has changed. Sign the new version on the website, then send again.
403forbiddenattestation_owedThe feed attestation has changed. Sign the new version on the website, then send again.
422invalidfile_too_bigThe file is over 50 MB.
422invalidstorage_offFile uploads aren't available right now.
429rate_limitedupload_budgetYou've asked for 20 upload addresses today. Retry-After says when the day turns over, at midnight UTC.
500internalupload_budget_unavailableYour 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

FieldInRequiredDescription
listingIdpathYesYour ad's id, from GET /listings.
uploadIdbodyYesThe uploadId that POST /uploads answered.
fileNamebodyYesThe file's name, as sent to POST /uploads.
sizebodyYesThe file's size in bytes, as sent to POST /uploads.
scrubbedAtbodyYesThe 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 uploadId to the same ad. It answers the same fileId and 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

StatusCodeReasonWhen
413invalidThe body is over 1 MB.
400invalidThe body isn't JSON.
422invalidThe body is JSON and doesn't fit the call. The message says what to fix, a key the call doesn't take included.
403forbiddenstoppedYour account is paused or suspended. Reads still work, and nothing can be sent until the platform lifts it.
403forbiddencant_postYour account can't send anything right now.
403forbiddenagreement_owedThe vendor agreement has changed. Sign the new version on the website, then send again.
403forbiddenattestation_owedThe feed attestation has changed. Sign the new version on the website, then send again.
404not_foundad_not_foundThat ad isn't on your account. Another vendor's ad reads the same as one that doesn't exist.
422invalidad_retiredThat ad is retired, so it can't take leads.
422invalidscrub_dateThe scrub date is missing, in the future, or more than 31 days old.
422invalidstorage_offFile uploads aren't available right now.
422invalidupload_not_validThat uploadId isn't one this account was given.
422invalidupload_not_foundNothing has been put at that upload's address yet, or it has expired.
422invalidupload_size_changedThe file put at the address isn't the size you asked for.
422invalidupload_already_startedThat uploadId has already started a file on another of your ads.
409conflictfile_openAnother 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

FieldInRequiredDescription
fileIdpathYesThe 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
}
  • rowsTotal is null until the file has been counted. rowsProcessed and rowsInvalid are rows read and rows refused.
  • rejectSample holds the first 20 refused rows, by row number, with a sentence each.
  • pulledAt is set on a file taken off sale. failure says why a FAILED file stopped.
  • Read to the end says nothing about what went on sale.

status:

CodeMeaning
QUEUEDWaiting to be read.
RUNNINGBeing read.
DONERead to the end. It says nothing about what went on sale.
FAILEDStopped, and failure says why.
PULLEDTaken off sale before it was read to the end.

Refusals

StatusCodeReasonWhen
403forbiddencant_readYour account can't read this right now, usually because something is waiting to be signed. GET /me says why.
404not_foundfile_not_foundThat file isn't on your account. Another vendor's file, a day's feed and an id nobody has all read the same.

On this page