Upload a document to a shipment
upload_documentChanges data: attaches one file (a PDF, a JPEG, PNG or TIFF image, or an Excel or CSV spreadsheet, 50 MB at most) to a shipment, as the person who connected this app, and records it in the organization's audit log. Trackberry then reads it for extraction like any document uploaded on the site, so what it finds (parties, dates, goods) can show up on the shipment; use list_documents and get_document_data afterwards. Say which shipment and which file before calling, and only on the user's request. Name the shipment with shipment_id, or with container_number to use the live shipment that carries it; with neither, or with a container number no shipment carries, the file starts an untracked draft shipment. Give the file in exactly one way. In ChatGPT, pass the attached file as file. Otherwise give file_url, a public HTTPS link that Trackberry downloads once with no credentials. A link that needs a sign-in cannot be fetched (Microsoft 365, SharePoint and OneDrive links, Google Drive and Docs links that ask for a login, and similar share pages) and is refused with file_url_needs_sign_in; a direct download link that is public works. file_base64 with filename is a last resort for small files, 256 KB at most, because you would have to write out every byte. When you have no public URL and the file is not small, or you only hold such a sign-in link or an attachment you cannot pass (a Claude.ai or Microsoft Copilot chat attachment, say), call request_upload_link instead and give the user that link. Safe to repeat: the same file for the same shipment comes back as the document already attached, with created false. Answers with the document.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "upload_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | ChatGPT's attached-file object. Pass the file the user attached as it is given to you. | |
| file_url | No | A public HTTPS link to the file. Trackberry downloads it without credentials, so a link that needs a sign-in (SharePoint, OneDrive, Google Drive) does not work: use request_upload_link for those. | |
| filename | No | The file's name with its extension, such as "invoice.pdf". Required with file_base64; optional with file_url. | |
| file_base64 | No | The file's bytes, base64 encoded, 256 KB at most when decoded. A last resort for small files: it costs you the whole file as output. | |
| shipment_id | No | The shipment to attach the file to, such as "shp_123", as returned by search_shipments. Not together with container_number. | |
| container_number | No | Instead of shipment_id: an ISO 6346 container number such as "MSCU1234566". Uses the one live shipment that carries it, or starts a draft for it. |