Upload document

Upload a receipt, bill or sales invoice to the Costs or Sales inbox.

POST https://cotlet.dev/api/v1/dext/documents

write

Uploads one file through Add documents and returns the new item in Processing. Images and PDFs may be up to 6MB, ZIP files 100MB. Mode one_per_file takes PDF, JPG, PNG or ZIP; one_per_page and auto_split take PDF only. The upload reaches no one and the item can be archived, so it runs without asking.

Parameters

Parameters: upload_document
NameTypeDescription
inbox enum enum costs or sales. Default: costs.
file_url string required string HTTPS link to the file Cotlet downloads.
document_owner string string Owner ID from list_document_owners, or none. Default: none.
mode enum enum one_per_file, one_per_page or auto_split. Default: one_per_file.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/dext/documents \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"inbox":"costs","file_url":"https://files.example.com/receipts/office-supplies-0412.pdf","document_owner":"Dana Reyes","mode":"one_per_file"}'
Python
result = client.call("dext", "upload_document", {"inbox":"costs","file_url":"https://files.example.com/receipts/office-supplies-0412.pdf","document_owner":"Dana Reyes","mode":"one_per_file"})
Node.js
const result = await cotlet.call('dext', 'upload_document', {"inbox":"costs","file_url":"https://files.example.com/receipts/office-supplies-0412.pdf","document_owner":"Dana Reyes","mode":"one_per_file"});
CLI
cotlet call dext upload_document --data '{"inbox":"costs","file_url":"https://files.example.com/receipts/office-supplies-0412.pdf","document_owner":"Dana Reyes","mode":"one_per_file"}'

Example response

JSON

{
  "item_id": "it_7f3b02",
  "inbox": "costs",
  "status": "processing",
  "document_owner": "Dana Reyes"
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.