# Add files to an empty attachment

`POST /v1/attachments/{id}/files`

Uploads the files of an attachment (bilag) that has none yet, including on booked transactions: documenting a posting does not change it. Send up to 10 files at once; they become the pages of the one attachment. An attachment that already has files is refused with 409 attachment_not_empty, so a retried request never adds the files twice. GET /v1/ledger-entries shows attachment_id and attachment_number per entry. Numina does not read the files unless run_ocr is "true".

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

## Request

```bash
curl -X POST https://api.numina.app/v1/attachments/550e8400-e29b-41d4-a716-446655440000/files \
  -H "Authorization: Bearer numi_YOUR_API_KEY" \
  -F files=@receipt.pdf
```

## Path parameters

- `id` (string (uuid), required): Attachment id: `id` from GET /v1/attachments, or attachment_id from GET /v1/ledger-entries

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

- `files` (array of files, required): 1–10 files (PDF, PNG, JPG or JPEG; max 10MB each), in page order. All files must have the same type, and each file's content must match its declared type.
- `run_ocr` (string, optional): If "true", Numina reads the files (OCR) so the document becomes searchable. Defaults to "false". One of: `true`, `false`.

## Response `201`

Files added

```json
{
  "attachment": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "file_name": "string",
    "status": "uploaded",
    "created_at": "string",
    "attachment_number": 185
  },
  "files": [
    {
      "file_name": "string",
      "sha256": "string"
    }
  ]
}
```

## 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
- `404` Not Found - The resource does not exist in this company
- `409` Conflict - The attachment already has files
- `429` Too Many Requests - Rate limit exceeded
- `500` Internal Server Error

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