Attachments
An attachment is a file, such as a receipt or a statement, that belongs to one transaction, account, category, reconciliation, bill or the business profile (its logo). For how attachments work in the product, see Attachments in the help center.
| Operation | Method and path | Scope |
|---|---|---|
list-attachments | GET /v1/workspaces/{workspaceID}/attachments?entityType=...&entityId=... | attachments:read |
list-workspace-attachments | GET /v1/workspaces/{workspaceID}/attachment-library | attachments:read |
attachment-usage | GET /v1/workspaces/{workspaceID}/attachment-usage | attachments:read |
get-attachment | GET /v1/workspaces/{workspaceID}/attachments/{attachmentID} | attachments:read |
create-attachment | POST /v1/workspaces/{workspaceID}/attachments | attachments:write |
confirm-attachment-upload | POST /v1/workspaces/{workspaceID}/attachments/{attachmentID}/confirm | attachments:write |
upload-attachment-content | POST /v1/workspaces/{workspaceID}/attachments/content | attachments:write |
create-attachment-upload-link | GET /v1/workspaces/{workspaceID}/attachment-upload-link?entityType=...&entityId=... | attachments:read |
rename-attachment | PATCH /v1/workspaces/{workspaceID}/attachments/{attachmentID} | attachments:write |
delete-attachment | DELETE /v1/workspaces/{workspaceID}/attachments/{attachmentID} | attachments:write |
Uploading, confirming, renaming and deleting need an owner, admin or editor
role. The business profile's logo can only be changed by an owner or admin.
AI assistants over MCP get only upload-attachment-content (as attach_file) and
create-attachment-upload-link (as get_attachment_upload_link); see
Attach a small file in one request and
Get a link to attach a file. The presigned flow
(create-attachment, confirm-attachment-upload) isn't offered to them.
The attachment object
{
"id": "att_7Hn2Kd9Lw4Xb1Rt6Pz3Mq",
"workspaceId": "wks_3Gh8Wn2Kc7Ty4Rb1Qs9Fm",
"entityType": "transaction",
"entityId": "txn_5Lp9Vw2Kd8Xb3Rt6Hn1Mz",
"name": "Hardware store receipt",
"filename": "IMG_2041.jpg",
"contentType": "image/jpeg",
"sizeBytes": 284512,
"status": "available",
"attachmentDate": "2026-11-14T00:00:00Z",
"createdAt": "2026-11-14T17:20:05Z",
"uploadedAt": "2026-11-14T17:20:07Z"
}
nameis the display name people see in the app.filenameis the original name of the file, used when it is downloaded. Renaming changesnameonly.statusisawaiting_uploaduntil the upload is confirmed, thenavailable. It can also befailedorexpired.get-attachmentadds adownloadUrlto fetch the file.
Upload a file
- Call
create-attachmentwithentityType,entityId,name(1 to 200 characters),filename,contentType,sizeBytesand, optionally,attachmentDate. The response has the newattachmentanduploadinstructions: aurl, themethod(PUT),headersto send andexpiresAt. - Send the file to
upload.urlwith that method and those headers beforeexpiresAt. - Call
confirm-attachment-upload. The attachment becomesavailable. Confirming an attachment that is alreadyavailablesucceeds and returns it unchanged, so a retry after a lost response is safe.
Retrying create-attachment
Send an optional Idempotency-Key header (up to 255 characters) with
create-attachment so a retry can't add a second attachment. Keys are scoped
to the workspace.
- Same key and same body: you get the original attachment back with
201. If it is stillawaiting_upload,uploadholds a new signed URL and the upload window starts again. If it is alreadyavailable, it is returned as it is andupload.urlis empty because there is nothing left to upload. - Same key with a different body:
409IDEMPOTENCY_KEY_CONFLICT. - A key whose attachment was rejected or deleted stays used, so use a new key to try again.
Without the header every call creates a new attachment, as before. Attachments that are never confirmed are still removed after their upload window passes.
Uploading needs a plan that includes receipt attachments (402
PLAN_FEATURE_REQUIRED with feature receipt_attachments; the business logo
needs business_tools instead). Uploading to a bill (entityType bill)
needs both receipt attachments and the bills feature; the error names the one
the plan lacks. Bills are only archived and restored, never deleted, so a bill's
attachments stay when it is archived, and an archived bill, or one the Debt
Center manages, still accepts uploads. Listing, downloading, renaming and
deleting a bill's attachments aren't plan-gated. The file must fit the plan's
file size and storage limits (402 PLAN_LIMIT_EXCEEDED). On a read-only plan,
uploads and deletes get 423.
Attach a small file in one request
POST /v1/workspaces/{workspaceID}/attachments/content
{
"entityType": "bill",
"entityId": "bill_4Fm8Kd2Wn7Xb1Rt9Pz3Hq",
"name": "November electricity bill",
"filename": "electricity-2026-11.pdf",
"contentType": "application/pdf",
"contentBase64": "JVBERi0xLjQK..."
}
Stores a file sent in the request itself and attaches it, with no presigned URL
and no confirm step. It returns 201 with the attachment and what it went to:
{
"attachment": {"id": "att_7Hn2Kd9Lw4Xb1Rt6Pz3Mq", "entityType": "bill", "status": "available"},
"entityLabel": "Electricity"
}
attachment is the attachment object. entityLabel
is a short description of the item (for a transaction: the payee, the date and
amountMinor; otherwise the name), made of the workspace's own data, so treat
it as untrusted text.
entityTypeistransaction,bill,account,reconciliationorcategory. The business logo (business_profile) is refused with422.attachmentDateis optional.contentBase64is the file as plain base64 (the standard or URL-safe alphabet, padded or not). Adata:prefix, whitespace or other characters are refused with422INVALID_REQUEST/attachmentContentEncodingInvalid.- The decoded file can be at most 4 MiB, and also within the plan's
per-file limit. A larger file gets
413attachment_content_too_large; use the presigned flow for it. The request body is size-limited before it is decoded, and the decoded size is checked again. - The file's own bytes decide what it is, as in the presigned flow, and
contentTypemust agree: a mismatch is422unsafe_attachment_content(attachmentContentTypeMismatch), as is an executable or an unsupported type. - It applies the same rules as
create-attachmentandconfirm-attachment-upload: the owner, admin or editor role, the plan (receipt attachments, andbillsfor a bill), the entity belonging to this workspace, the filename and name rules, and the per-file and storage limits. Theattachment.createdevent is published in the same transaction. If anything fails, no attachment is left and the stored file is removed. - Attaching changes nothing on the item. A reconciled transaction accepts attachments, as in the web app.
Send an optional Idempotency-Key header (up to 255 characters). The same key
with the same request and the same file returns the original attachment with
201 and stores nothing new. The same key with anything different (including a
different file) is 409 IDEMPOTENCY_KEY_CONFLICT. Keys are scoped to the
workspace and shared with create-attachment; a key used there is a conflict
here.
Get a link to attach a file
GET /v1/workspaces/{workspaceID}/attachment-upload-link?entityType=transaction&entityId=txn_5Lp9Vw2Kd8Xb3Rt6Hn1Mz
{
"url": "https://app.budgetthing.com/workspaces/wks_3Gh8Wn2Kc7Ty4Rb1Qs9Fm/transactions?transaction=txn_5Lp9Vw2Kd8Xb3Rt6Hn1Mz&attach=1",
"entityType": "transaction",
"entityId": "txn_5Lp9Vw2Kd8Xb3Rt6Hn1Mz",
"entityLabel": "Hardware store, 2026-11-14, amountMinor 4250"
}
For a client that can't hand over the file's bytes (a chat app, for example), this returns a link into the web app that opens the item and its upload dialog, so the person attaches the file themselves. It checks that the item exists in the workspace and that the caller's role (owner, admin or editor) and plan allow attaching files to it, with the same errors as an upload, and it changes nothing.
The link holds only IDs and no token or other credential. Opening it needs
the person's own sign-in, and the usual role and plan checks run again when they
upload. It never expires. A transaction and a bill open the item with the upload
dialog (&attach=1); an account or a category opens its page. A reconciliation
opens its detail page under the account,
/workspaces/{workspaceID}/accounts/{accountID}/reconciliations/{reconciliationID}?attach=1,
and its entityLabel reads like "Checking: statement 2026-10-31". The business
profile is refused with 422.
Rename an attachment
PATCH /v1/workspaces/{workspaceID}/attachments/{attachmentID}
{"name": "Hardware store receipt"}
Changes the display name and returns the attachment. The stored file and its
filename don't change, so a download keeps the original filename.
nameis required and is trimmed. It can be up to 200 characters.- An empty
name(or only spaces) resets the display name to the original filename without its extension, for exampleIMG_2041forIMG_2041.jpg. - Renaming isn't limited by plan, so it keeps working after a downgrade.
| Status | detail name | When |
|---|---|---|
403 | insufficientRoleToRenameAttachments | Your role can't edit data. |
403 | insufficientRoleToUpdateBusinessProfile | The attachment is the business profile's logo and you aren't an owner or admin. |
404 | attachmentNotFound | The attachment doesn't exist in this workspace. |
422 | name is missing or longer than 200 characters. |
A token without attachments:write also gets 403. The detail key is
errors.api.<name>.detail. See Errors for the response
format.
List attachments
list-attachments returns every attachment of one item: pass its entityType
and entityId. list-workspace-attachments returns one page of every
attachment in the workspace, each with the entityType and entityId it
belongs to. It takes sort (createdAt, the default, sizeBytes, name or
filename), direction (desc, the default, or asc), pageSize (default
100, up to 1000) and pageToken. Pass a response's nextToken as pageToken
for the next page; the token keeps the sort, direction and filters below.
attachment-usage returns the workspace's attachment count and totalBytes.
Search and filter the workspace list
list-workspace-attachments also takes these optional filters. They combine
with AND, and total in the response counts only the attachments that match.
| Parameter | Filters by |
|---|---|
q | Free text: a case-insensitive substring of the attachment name or filename. Surrounding spaces are ignored, %, _ and \ match literally, and it can be at most 200 characters |
fileType | image (any image/* content type), pdf (application/pdf) or other (anything else). Repeat it to allow several; a match on any of them counts |
entityType | The record the file belongs to: transaction, account, reconciliation, category, bill or business_profile. Repeat it to allow several |
GET /api/v1/workspaces/wks_3Gh8Wn2Kc7Ty4Rb1Qs9Fm/attachment-library?q=receipt&fileType=image&fileType=pdf&entityType=transaction&sort=name&direction=asc&pageSize=50
A pageToken is tied to the q, fileType and entityType values of the
request that produced it. Send the same filters with it; a changed filter makes
the token invalid and the request fails with
attachmentInvalidPaginationToken (422), so start again without a token.
Values outside the lists above, or a q longer than 200 characters, are
rejected with a 422.