Upload File
Upload files directly to Elept's secure object storage. The upload size limit is dictated by your workspace subscription tier.
HTTP Endpoint
POST /api/v1/files Content-Type: multipart/form-data
Request Parameters (Form Data)
| Field | Type | Required | Description |
|---|---|---|---|
| file | binary | Yes | The raw binary file upload stream. |
| visibility | string | No | private (default) or public. |
| storage_class | string | No | hot (default), public, archive, or backup. |
| folder | string | No | Virtual folder key for organization. |
| metadata | json | No | Optional JSON string of custom key-value pairs. |
Success Response
{
"success": true,
"data": {
"file_uid": "file_abc123",
"display_name": "user_contract.pdf",
"mime_type": "application/pdf",
"size_bytes": 248000,
"visibility": "private"
}
}
Code Examples
PHP cURL Request:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://elept.com/api/v1/files");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'file' => new CURLFile('/path/to/contract.pdf'),
'visibility' => 'private',
'storage_class' => 'hot'
]);
$response = curl_exec($ch);