Skip to main content
POST
/
accounting
/
attachment
Upload an attachment
curl --request POST \
  --url https://api.routemcp.io/api/v1/accounting/attachment \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-End-User-Id: <x-end-user-id>' \
  --form file='@example-file' \
  --form file_name=team-lunch-receipt.pdf \
  --form mime_type=application/pdf \
  --form related_object_type=INVOICE \
  --form related_object_id=019d04a5-invoice-uuid \
  --form 'integration_params={}'
{
  "success": true,
  "statusCode": 201,
  "message": "Created",
  "data": {
    "data": {
      "id": "urn:xero:attachment:2d03a37c-d389-4d7d-999a-80353b19e789",
      "remote_id": "2d03a37c-d389-4d7d-999a-80353b19e789",
      "file_name": "team-lunch-receipt.pdf",
      "mime_type": "application/pdf",
      "file_url": "https://api.routemcp.io/api/v1/attachments/proxy/abc123?token=...",
      "created_at": "2026-05-15T13:00:00Z",
      "modified_at": "2026-05-15T13:00:00Z"
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.routemcp.io/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Enter your API key with the Bearer prefix — e.g. Bearer sk_live_xxx (production) or Bearer sk_test_xxx (sandbox)

Headers

X-End-User-Id
string
required

Query Parameters

provider
string
required
Example:

"xero"

Body

multipart/form-data

Multipart form body. file carries the binary content; all other fields are optional metadata.

Multipart write body for POST /accounting/attachment. Send the binary file content in the file part. Per-file size cap: 25 MB. Content replacement is not supported on Update/Patch — DELETE and POST a new file to replace an existing one.

file
file
required

Binary file content. Use a file form field in the multipart body — every modern OpenAPI tool (Mintlify, Scalar, Postman, Swagger) renders a native file-picker for this.

file_name
string

Optional override for the on-disk filename. Falls back to the uploaded file's own name if omitted.

Example:

"team-lunch-receipt.pdf"

mime_type
string

Optional MIME type override. Falls back to the multipart part's Content-Type if omitted.

Example:

"application/pdf"

Optional canonical type of a parent record to attach to. Provider support varies — Xero's Files API uploads to the library by default; QBO attaches to the referenced record.

Available options:
INVOICE,
BILL,
EXPENSE,
PURCHASE_ORDER,
JOURNAL_ENTRY,
CONTACT,
ITEM

Optional id of the parent record (in URN or raw form). Required when related_object_type is set.

Example:

"019d04a5-invoice-uuid"

integration_params
object

Provider-specific passthrough fields. Encoded as a JSON-stringified value when sent over multipart.

Response

Attachment uploaded.