Add files to an empty attachment
POST
/v1/attachments/{id}/filesUploads 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".
Requires one ofdocuments:writewrite:draftwrite:ledger
Path parameters
- Attachment id:
idfrom GET /v1/attachments, or attachment_id from GET /v1/ledger-entries
Body
multipart/form-data
- 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_ocrstringIf "true", Numina reads the files (OCR) so the document becomes searchable. Defaults to "false".One of
truefalse
Errors
400The upload is missing, too large, or not a valid file401Invalid or missing authentication403Missing scope, or the company is archived404The resource does not exist in this company409The attachment already has files429Rate limit exceeded500Internal Server Error
Every error has the same shape. See Errors.
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.pdfimport { openAsBlob } from "node:fs";
const form = new FormData();
form.append("files", "@receipt.pdf");
const response = await fetch("https://api.numina.app/v1/attachments/550e8400-e29b-41d4-a716-446655440000/files", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.NUMINA_API_KEY}`,
},
body: form,
});
const data = await response.json();import os
import requests
response = requests.post(
"https://api.numina.app/v1/attachments/550e8400-e29b-41d4-a716-446655440000/files",
headers={
"Authorization": f"Bearer {os.environ['NUMINA_API_KEY']}",
},
data={"files": "@receipt.pdf"},
)
data = response.json()Response
{
"attachment": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"file_name": "string",
"status": "uploaded",
"created_at": "string",
"attachment_number": 185
},
"files": [
{
"file_name": "string",
"sha256": "string"
}
]
}