Upload File
POST
https://api.cargopanel.co/v1/files/uploadPOST
https://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.
Request Fields
filerequiredFileThe binary file content to upload.
documentTyperequiredstringThe classification of the document (e.g., invoice, packing_list, label, identity).
userIdrequiredstringThe owner user identifier of the document.
shipmentIdrequiredstringThe shipment identifier associated with the document.
Example Response
200
{
"status": "success",
"message": "Dosya başarıyla yüklendi ve kaydedildi.",
"file": {
"originalName": "invoice.pdf",
"fileName": "e-arşiv_fatura_usr_xyz789_539103",
"url": "https://api.cargopanel.co/v1/files/e-arşiv_fatura_usr_xyz789_539103",
"path": "/files/e-arşiv_fatura_usr_xyz789_539103",
"id": "539103",
"userId": "usr_xyz789",
"shipmentId": "12345678",
"documentType": "E-Arşiv Fatura"
},
"fileUrl": "https://api.cargopanel.co/v1/files/e-arşiv_fatura_usr_xyz789_539103",
"fileId": "539103"
}Response Fields
statusstringStatus label indicating success or failure.
messagestringUser friendly status message.
fileobjectThe uploaded file's metadata record.
idstringUnique 6-digit identifier of the file.
fileNamestringThe normalized, unique filename saved in storage.
urlstringPublic gateway proxy API URL to view or download the file.
Responses
200File uploaded and saved successfully
400Bad request (e.g. missing file or parameters)
401Unauthorized (invalid or missing API key)