Upload a document
Upload a PDF, PNG or JPEG of up to 25 MB as multipart/form-data, then attach it to a bill or accounting entry by id. Until it’s attached, only the uploading user can read the document.
Authorizations
User API key authentication. Create a key under Settings → API keys in the Slash dashboard (https://app.slash.com/global-settings/api-keys) and send the x-legal-entity header naming the legal entity to act on with every request. Keys scoped to a legal entity are rejected with 403 user_api_key_required.
Headers
The legal entity to act on. Required on every request; a user API key can act on any legal entity its user has access to.
^le_[a-zA-Z0-9]+$Body
What the file is for: bill_invoice for bills, accounting_receipt for accounting entries. Send it before file.
bill_invoice, accounting_receipt The file to upload. PDF, PNG, or JPEG (HEIC is converted to JPEG). Required; a request without a file part is rejected with file_required.
Response
The uploaded document, with a downloadUrl for the stored file.
A file uploaded to Slash, owned by the user whose API key uploaded it. Until it's attached, only that user can read it; once attached to a bill or accounting entry, anyone who can see that bill or entry can. Attach it by id where its purpose is accepted; the file itself is fetched through downloadUrl.
Document id with the st_ prefix.
"st_2rj4l7hmrrrcv"
The filename supplied at upload.
"invoice-4471.pdf"
MIME type detected from the file's bytes.
"application/pdf"
Size of the stored file in bytes.
48213
Presigned URL for the file. Valid for about 15 minutes; fetch the document again for a fresh one.
When the document was uploaded.
What the document was uploaded for. Absent on files Slash stored for something else.
bill_invoice, accounting_receipt "bill_invoice"