Attachments
Receipts and other files attached to records.
Paths are relative to https://evenbooks.org/api/v1. How keys, errors, paging and versions work is in the guide; the whole reference is also an OpenAPI 3.1 document.
Administrator key marks endpoints that need a key with the admin role, Write access those a read-only key can’t call, and Idempotent those that accept an idempotency key.
List attachments of a record
/attachmentsFiles attached to one record: entityType is purchase (an expense), invoice, journal_entry or bank_transaction.
Parameters
entityTypestringquery · requiredOne of:
purchaseinvoicejournal_entrybank_transactionentityIdstring (uuid)query · required
Response 200
array of AttachmentDto
Errors 400 · 401 · 403 · 404 · 409 · 429
Upload an attachment
/attachmentsSend multipart/form-data. PDF, PNG, JPEG, WebP, HEIC, CSV or plain text, up to 15 MB. Give entityType and entityId to attach it to that record at once, or neither and pass the returned id in attachmentIds when you record the expense; files left unattached are deleted after 7 days.
Request body
Form upload (multipart/form-data)
filestringrequiredThe file.
kindstringreceipt(default),csv_importorother.entityTypestringOptional:
purchase(an expense),invoice,journal_entryorbank_transaction.entityIdstringOptional, with
entityType: the id of that record.
Response 200
AttachmentDto (fields under Schemas)
Errors 400 · 401 · 403 · 404 · 409 · 429
Get an attachment
/attachments/{id}The file’s details. Get its contents with GET /attachments/{id}/download.
Parameters
idstring (uuid)path · required
Response 200
AttachmentDto (fields under Schemas)
Errors 400 · 401 · 403 · 404 · 409 · 429
Delete an attachment
/attachments/{id}Removes the file; History keeps a record of it. Invoice PDFs and import files stay with their records and cannot be deleted (400 validation).
Parameters
idstring (uuid)path · required
Response 204
Done; no body
No body.
Errors 400 · 401 · 403 · 404 · 409 · 429
Download an attachment
/attachments/{id}/downloadRedirects (302) to a short-lived signed URL, or streams the file. Add ?inline=1 to display it in a browser instead of downloading.
Parameters
idstring (uuid)path · required
Response 200
Returns the file (application/octet-stream).
Errors 400 · 401 · 403 · 404 · 409 · 429
Schemas
The types these endpoints take or return, by name. Type names above link here.
AttachmentDto
idstringkindstring · AttachmentKindOne of:
receiptinvoice_pdfcsv_importotherfileNamestringcontentTypestringsizeBytesnumbersha256string or nullstatusstringOne of:
pendinguploadeddeletedentityTypestring or nullentityIdstring or nullcreatedAtstring
AttachmentKind
string
One of: receipt invoice_pdf csv_import other