# Upload document to the inbox

`POST /v1/attachments`

Uploads a document (PDF, PNG, JPG, or JPEG; max 10MB) without a journal entry, so it waits in the inbox. Put it on a draft later with `attachment_id` on PUT /v1/journal-entries/{id}. Numina reads it only with run_ocr "true", and the bookkeeping agent does not run on it. Uploading a file the company already has returns the existing document with 200 and `duplicate: true`.

**Scopes:** any of `documents:write`, `write:draft`, `write:ledger`

## Request

```bash
curl -X POST https://api.numina.app/v1/attachments \
  -H "Authorization: Bearer numi_YOUR_API_KEY" \
  -F file=@receipt.pdf
```

## Body (`multipart/form-data`)

- `file` (file, required): File to upload (PDF, PNG, JPG, or JPEG; max 10MB). Its content must match its declared type.
- `run_ocr` (string, optional): If "true", Numina reads the file (OCR) so the document becomes searchable. Defaults to "false". One of: `true`, `false`.

## Response `200`

The company already has this file

```json
{
  "attachment": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "file_name": "string",
    "status": "uploaded",
    "created_at": "string",
    "attachment_number": 185,
    "year": "2026",
    "is_empty": false,
    "file_count": 0,
    "booked_accounting_year": "2026",
    "content_sha256": "string",
    "journal_entry_ids": [
      "550e8400-e29b-41d4-a716-446655440000"
    ]
  },
  "duplicate": false
}
```

## Errors

- `400` Bad Request - The upload is missing, too large, or not a valid file
- `401` Unauthorized - Invalid or missing authentication
- `403` Forbidden - Missing scope, or the company is archived
- `429` Too Many Requests - Rate limit exceeded
- `500` Internal Server Error

See https://developers.numina.app/errors.md for the error format.
