Upload File
https://api.cargopanel.co/v1/files/uploadhttps://sandbox-api.cargopanel.co/v1/files/uploadUploads files (Invoice, MSDS, FDA forms, etc.) associated with shipments. This endpoint requires requests formatted as multipart/form-data. The file is always saved under the user of the API token; a userId sent in the body is ignored. The returned fileName is signed and cannot be guessed, so store the url or fileName from the response to access the file later.
Request Fields
filerequiredFileThe binary file content to upload.
documentTyperequiredstringThe classification of the document (e.g., invoice, packing_list, label, identity).
shipmentIdrequiredstringThe shipment identifier associated with the document.
Example Response
{
"status": "success",
"message": "Dosya başarıyla yüklendi ve kaydedildi.",
"file": {
"originalName": "invoice.pdf",
"fileName": "48213907Xk3fP9qLmZ2vQa",
"url": "https://api.cargopanel.co/v1/files/48213907Xk3fP9qLmZ2vQa",
"path": "/files/48213907Xk3fP9qLmZ2vQa",
"id": "48213907",
"userId": "usr_xyz789",
"shipmentId": "12345678",
"documentType": "E-Arşiv Fatura"
},
"fileUrl": "https://api.cargopanel.co/v1/files/48213907Xk3fP9qLmZ2vQa",
"fileId": "48213907"
}Response Fields
statusstringStatus label indicating success or failure.
messagestringUser friendly status message.
fileobjectThe uploaded file's metadata record.
idstringUnique numeric identifier of the file.
fileNamestringSigned, non-guessable file name. Use it with GET /files/:filename to download the file.
urlstringPublic gateway proxy API URL to view or download the file.