Skip to main content

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.

OperationMethod and pathScope
list-attachmentsGET /v1/workspaces/{workspaceID}/attachments?entityType=...&entityId=...attachments:read
list-workspace-attachmentsGET /v1/workspaces/{workspaceID}/attachment-libraryattachments:read
attachment-usageGET /v1/workspaces/{workspaceID}/attachment-usageattachments:read
get-attachmentGET /v1/workspaces/{workspaceID}/attachments/{attachmentID}attachments:read
create-attachmentPOST /v1/workspaces/{workspaceID}/attachmentsattachments:write
confirm-attachment-uploadPOST /v1/workspaces/{workspaceID}/attachments/{attachmentID}/confirmattachments:write
upload-attachment-contentPOST /v1/workspaces/{workspaceID}/attachments/contentattachments:write
create-attachment-upload-linkGET /v1/workspaces/{workspaceID}/attachment-upload-link?entityType=...&entityId=...attachments:read
rename-attachmentPATCH /v1/workspaces/{workspaceID}/attachments/{attachmentID}attachments:write
delete-attachmentDELETE /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"
}
  • name is the display name people see in the app. filename is the original name of the file, used when it is downloaded. Renaming changes name only.
  • status is awaiting_upload until the upload is confirmed, then available. It can also be failed or expired.
  • get-attachment adds a downloadUrl to fetch the file.

Upload a file​

  1. Call create-attachment with entityType, entityId, name (1 to 200 characters), filename, contentType, sizeBytes and, optionally, attachmentDate. The response has the new attachment and upload instructions: a url, the method (PUT), headers to send and expiresAt.
  2. Send the file to upload.url with that method and those headers before expiresAt.
  3. Call confirm-attachment-upload. The attachment becomes available. Confirming an attachment that is already available succeeds 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 still awaiting_upload, upload holds a new signed URL and the upload window starts again. If it is already available, it is returned as it is and upload.url is empty because there is nothing left to upload.
  • Same key with a different body: 409 IDEMPOTENCY_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.

  • entityType is transaction, bill, account, reconciliation or category. The business logo (business_profile) is refused with 422. attachmentDate is optional.
  • contentBase64 is the file as plain base64 (the standard or URL-safe alphabet, padded or not). A data: prefix, whitespace or other characters are refused with 422 INVALID_REQUEST/attachmentContentEncodingInvalid.
  • The decoded file can be at most 4 MiB, and also within the plan's per-file limit. A larger file gets 413 attachment_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 contentType must agree: a mismatch is 422 unsafe_attachment_content (attachmentContentTypeMismatch), as is an executable or an unsupported type.
  • It applies the same rules as create-attachment and confirm-attachment-upload: the owner, admin or editor role, the plan (receipt attachments, and bills for a bill), the entity belonging to this workspace, the filename and name rules, and the per-file and storage limits. The attachment.created event 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 /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.

  • name is 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 example IMG_2041 for IMG_2041.jpg.
  • Renaming isn't limited by plan, so it keeps working after a downgrade.
Statusdetail nameWhen
403insufficientRoleToRenameAttachmentsYour role can't edit data.
403insufficientRoleToUpdateBusinessProfileThe attachment is the business profile's logo and you aren't an owner or admin.
404attachmentNotFoundThe attachment doesn't exist in this workspace.
422name 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.

ParameterFilters by
qFree 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
fileTypeimage (any image/* content type), pdf (application/pdf) or other (anything else). Repeat it to allow several; a match on any of them counts
entityTypeThe 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.