{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Documents & Files","description":"The operational transportation management API. Full access to planning, tracking, invoicing, and integrations — built on the OTM5 open data standard.","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"documents--files","__idx":0},"children":["Documents & Files"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Manage documents, file uploads, and email processing. Documents track transport-related paperwork (CMR, proof of delivery, photos), while files handle the underlying storage."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"documents","__idx":1},"children":["Documents"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Documents are metadata records that wrap files and can be attached to transport entities."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-document","__idx":2},"children":["Create a Document"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.otms.transportial.com/api/document \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"name\": \"CMR - Shipment RTD-AMS\",\n    \"type\": \"CMR\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"get-a-document","__idx":3},"children":["Get a Document"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X GET \"https://api.otms.transportial.com/api/document/{id}\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"verify--unverify-a-document","__idx":4},"children":["Verify / Unverify a Document"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Mark documents as verified (e.g., after manual review):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Verify\ncurl -X GET \"https://api.otms.transportial.com/api/document/{id}/verify\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n\n# Unverify\ncurl -X GET \"https://api.otms.transportial.com/api/document/{id}/unverify\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"list-documents","__idx":5},"children":["List Documents"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X GET \"https://api.otms.transportial.com/api/documents/0/20\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"search-documents","__idx":6},"children":["Search Documents"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"https://api.otms.transportial.com/api/documents/0/20\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"type\": \"CMR\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"attach-documents-to-entities","__idx":7},"children":["Attach Documents to Entities"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Documents can be attached to trips and consignments:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Attach to a trip\ncurl -X PUT \"https://api.otms.transportial.com/api/trip/{tripId}/documents\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"documents\": [{ \"id\": \"document-uuid\" }]\n  }'\n\n# Attach to a consignment\ncurl -X PUT \"https://api.otms.transportial.com/api/consignment/{consignmentId}/documents\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"documents\": [{ \"id\": \"document-uuid\" }]\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"file-upload--download","__idx":8},"children":["File Upload & Download"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"upload-a-file","__idx":9},"children":["Upload a File"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.otms.transportial.com/api/file/upload \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -F \"file=@/path/to/document.pdf\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"get-file-metadata","__idx":10},"children":["Get File Metadata"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X GET \"https://api.otms.transportial.com/api/file/{id}\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"download-a-file","__idx":11},"children":["Download a File"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X GET \"https://api.otms.transportial.com/api/file/{id}/download\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -o downloaded-file.pdf\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"convert-file-to-html","__idx":12},"children":["Convert File to HTML"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Useful for previewing file contents in a browser:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.otms.transportial.com/api/file/toHtml \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"fileId\": \"file-uuid\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"convert-file-to-matrix","__idx":13},"children":["Convert File to Matrix"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Extract structured data from files (CSV, Excel):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.otms.transportial.com/api/file/toMatrix \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"fileId\": \"file-uuid\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"email-mail-management","__idx":14},"children":["Email (Mail) Management"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Transportial can process incoming emails to create transport entities."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"process-an-email","__idx":15},"children":["Process an Email"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.otms.transportial.com/api/mail \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -d '{\n    \"from\": \"customer@example.com\",\n    \"subject\": \"Transport request - 20 pallets\",\n    \"body\": \"Please arrange pickup at...\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"convert-email-to-transport-order","__idx":16},"children":["Convert Email to Transport Order"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X GET \"https://api.otms.transportial.com/api/mail/{id}/toTransportOrder\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"archive--unarchive-emails","__idx":17},"children":["Archive / Unarchive Emails"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Archive\ncurl -X GET \"https://api.otms.transportial.com/api/mail/{id}/archive\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n\n# Unarchive\ncurl -X GET \"https://api.otms.transportial.com/api/mail/{id}/unarchive\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"list-emails","__idx":18},"children":["List Emails"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X GET \"https://api.otms.transportial.com/api/mails/0/20\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"document-types","__idx":19},"children":["Document Types"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CMR"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["International consignment note"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["WAYBILL"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Waybill document"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["INVOICE"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invoice document"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["QUOTE"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Quote document"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TRANSPORT_ORDER"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transport order document"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TRIP"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Trip document"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CUSTOM"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom document type"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PDF"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Generic PDF file"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PHOTO"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Photo (proof of delivery, damage, etc.)"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":20},"children":["Next Steps"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Generate documents from transport entities with the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis"},"children":["API Reference"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Attach documents to consignments when ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/examples/managing-transport-orders"},"children":["Managing Transport Orders"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["See the full ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis"},"children":["API Reference"]}," for all document and file endpoints"]}]}]},"headings":[{"value":"Documents & Files","id":"documents--files","depth":1},{"value":"Documents","id":"documents","depth":2},{"value":"Create a Document","id":"create-a-document","depth":3},{"value":"Get a Document","id":"get-a-document","depth":3},{"value":"Verify / Unverify a Document","id":"verify--unverify-a-document","depth":3},{"value":"List Documents","id":"list-documents","depth":3},{"value":"Search Documents","id":"search-documents","depth":3},{"value":"Attach Documents to Entities","id":"attach-documents-to-entities","depth":3},{"value":"File Upload & Download","id":"file-upload--download","depth":2},{"value":"Upload a File","id":"upload-a-file","depth":3},{"value":"Get File Metadata","id":"get-file-metadata","depth":3},{"value":"Download a File","id":"download-a-file","depth":3},{"value":"Convert File to HTML","id":"convert-file-to-html","depth":3},{"value":"Convert File to Matrix","id":"convert-file-to-matrix","depth":3},{"value":"Email (Mail) Management","id":"email-mail-management","depth":2},{"value":"Process an Email","id":"process-an-email","depth":3},{"value":"Convert Email to Transport Order","id":"convert-email-to-transport-order","depth":3},{"value":"Archive / Unarchive Emails","id":"archive--unarchive-emails","depth":3},{"value":"List Emails","id":"list-emails","depth":3},{"value":"Document Types","id":"document-types","depth":2},{"value":"Next Steps","id":"next-steps","depth":2}],"frontmatter":{"seo":{"title":"Documents & Files"}},"lastModified":"2026-03-22T21:04:26.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/documents-and-files","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}