Upload attachments to Xero records
Attach files to records that already exist in Xero, such as a PDF receipt against a supplier bill or bank transaction, a supplier quote against a purchase order, or a supporting document against an invoice or manual journal, by asking a connected AI tool. This is an AI Connect capability: there is no dataSights screen for it and no Excel template, so it runs entirely through the AI tool you have connected.
Before you start
Connect your AI tool first. See AI Connect.
Your dataSights user needs all three of these permissions: AI Connect, Post to Xero, and Upload Xero Attachments. Post to Xero on its own is not enough. Grant them under Admin > Users, in the AI Connect branch of the permission tree.
The record you are attaching to must already exist in Xero, or be created by the AI earlier in the same conversation (see Example prompts). Uploading an attachment never creates a record on its own.
For anything bigger than a small file, your AI tool must be able to reach dataSights over the internet. See Large files and network access below.
If the AI route will not take your file, attach it in Xero directly.
What you can attach to
Eleven Xero record types are supported:
Invoice, Credit Note, Repeating Invoice, Quote, Purchase Order
Bank Transaction, Bank Transfer, Receipt
Contact, Account, Manual Journal
Supplier bills count as Invoice. In Xero, sales invoices and supplier bills are the same record type, so ask for either.
Purchase orders are supported. For example, attach a supplier's quote to the purchase order raised against it, whether the order is a draft or already approved. The option to show an attachment to your customer online does not apply to purchase orders.
What you can attach
These file types are accepted: .bmp, .csv, .doc, .docx, .eml, .gif, .heic, .jpeg, .jpg, .msg, .odt, .ods, .pdf, .png, .ppt, .pptx, .rtf, .tif, .tiff, .txt, .webp, .xls, .xlsx, .xml and .zip.
The file's contents must match its extension. A file that has been renamed, for example a program saved as Invoice.pdf, is rejected before anything reaches Xero. Upload the original file, or give it the extension of its real type.
Attach a file
Name the Xero organisation. Tell the AI which connected Xero organisation the record belongs to. If you are not sure of the exact names, ask it to check your Xero sync status first: that lists every organisation connected to your dataSights account.
Point it at the record. Attachments go to a record by its Xero Id (a long code of letters and numbers), not by invoice number, purchase order number, reference or contact name. You don't need to find it yourself: describe the record, and your AI tool, such as Claude or Copilot, finds its Id in your dataSights database. If you prefer, open the record in Xero and copy the Id from the browser address bar.
Hand over the file. Give the AI the file and the file name you want it stored under. The name must include the correct extension, for example .pdf or .png, because Xero works out the file type from the extension. Xero rejects file names containing < > : " / | ? *, a backslash or a plus sign. Larger files go through a one-time upload link that your AI tool uses behind the scenes. You never open or click it, but the AI tool needs network access (see below).
Decide whether your customer sees it. On an invoice or a credit note you can ask for the attachment to be shown to your customer when they view the record online through Xero. This option exists for those two record types only, and asking for it on any other type, including purchase orders, is rejected.
Read the result. You get one line per attachment saying whether it succeeded, with the Xero attachment reference when it did and the reason when it did not.
Example prompts
You do not need the Xero Id if the AI creates the record in the same conversation. It gets the Id back from the upload and attaches straight to it.
"Post this supplier bill to Xero as a draft for Acme Pty Ltd in our NZ entity and attach the PDF."
"Raise a draft purchase order to Acme Supplies from this quote and attach the quote to it."
"Attach this receipt to the bank transaction for Officeworks on 14 October in Xero."
"Attach the lease schedule spreadsheet to the manual journal we just posted."
Large files and network access
Small files (up to about 150KB) can be sent by the AI inside the request itself. Anything larger goes through a one-time upload link, which the AI's code tool sends the file to directly. That only works if the AI tool is allowed to reach dataSights over the internet.
AI tools that can run code with open internet access work as they are.
Claude on the web or desktop blocks addresses it does not know. Add
api.yourdatahub.coto the network allowlist for code execution in Claude's settings. On a Claude Team or Enterprise plan, an organisation owner has to add it.AI tools that cannot run code can only send files inside the request, so they are limited to about 150KB. For anything larger, use one of the tools above or attach it in Xero directly.
Let it run on its own
You don't have to be there for it. Many AI tools let you set up a task that runs on a schedule, for example every morning. Ask it to check a shared folder or inbox for new receipts and bills, create them in Xero as drafts with the files attached, and leave them for someone to approve in Xero.
A scheduled task usually runs in the cloud, not on your computer. Keep the files somewhere it can reach, such as Google Drive, OneDrive or an email inbox, rather than a folder on your laptop.
Limits
10MB per file. This is Xero's limit, and the most a single upload link accepts.
About 150KB for files sent inside the request. This is the AI tool's message size, not a dataSights limit, so larger files go through the upload link.
10 attachments per record. Also Xero's limit, and enforced by Xero, so an eleventh file comes back as a failure for that record.
20 attachments and 50MB of total file content per request. Larger workloads are fine, they just need splitting across several requests. With files near the 10MB mark, expect roughly five per request rather than twenty.