> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slash.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Documents

> Upload a file once, then attach it to bills and accounting entries.

A document is a file Slash stores for your legal entity, such as an invoice
PDF or a photo of a receipt. It belongs to the user whose API key uploaded it.

## Upload a file

Send the file to [Upload a document](/api-reference/documents/upload) as
`multipart/form-data`, with the `purpose` it's for:

```bash theme={null}
curl https://api.slash.com/v2/documents \
  -X POST \
  -H "X-API-Key: $SLASH_API_KEY" \
  -H "x-legal-entity: $SLASH_LEGAL_ENTITY_ID" \
  -F "purpose=bill_invoice" \
  -F "file=@invoice-4471.pdf"
```

```json theme={null}
{
  "id": "st_2rj4l7hmrrrcv",
  "filename": "invoice-4471.pdf",
  "purpose": "bill_invoice",
  "contentType": "application/pdf",
  "sizeBytes": 48213,
  "downloadUrl": "https://files.slash.com/st_2rj4l7hmrrrcv-invoice-4471.pdf?X-Amz-Expires=900",
  "createdAt": "2026-03-02T15:04:05.000Z"
}
```

PDF, PNG and JPEG files up to 25 MB are accepted, and PDFs can have up to 100
pages. HEIC photos are converted to JPEG. Uploading the same file twice
creates two documents, so keep the id.

## Download it

[Get a document](/api-reference/documents/retrieve) returns a `downloadUrl`
that works for about 15 minutes. Fetch the document again whenever you need
the file instead of storing the link.

## Who can see a document

Until it's attached, only the person who uploaded it. Once attached, anyone
who can see that bill or accounting entry. If every bill or entry it was
attached to is deleted, it's back to only the uploader.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.