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

get/attachments

Files attached to one record: entityType is purchase (an expense), invoice, journal_entry or bank_transaction.

Parameters

  • entityTypestringquery · required

    One of: purchase invoice journal_entry bank_transaction

  • entityIdstring (uuid)query · required

Response 200

array of AttachmentDto

Errors 400 · 401 · 403 · 404 · 409 · 429

Upload an attachment

post/attachments
Write access

Send 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)

  • filestringrequired

    The file.

    binary

  • kindstring

    receipt (default), csv_import or other.

  • entityTypestring

    Optional: purchase (an expense), invoice, journal_entry or bank_transaction.

  • entityIdstring

    Optional, with entityType: the id of that record.

Response 200

AttachmentDto (fields under Schemas)

Errors 400 · 401 · 403 · 404 · 409 · 429

Get an attachment

get/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

delete/attachments/{id}
Write access

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

get/attachments/{id}/download

Redirects (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

  • idstring
  • kindstring · AttachmentKind

    One of: receipt invoice_pdf csv_import other

  • fileNamestring
  • contentTypestring
  • sizeBytesnumber
  • sha256string or null
  • statusstring

    One of: pending uploaded deleted

  • entityTypestring or null
  • entityIdstring or null
  • createdAtstring

AttachmentKind

string

One of: receipt invoice_pdf csv_import other