Start an upload
const url = 'https://api.ebitex.io/assets/management/v1/uploads';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"kind":"example","sizeBytes":1,"filename":"example","contentType":"example","visibility":"example","folderId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","assetId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","locale":"example","openInBrowser":true,"metadata":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ebitex.io/assets/management/v1/uploads \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "kind": "example", "sizeBytes": 1, "filename": "example", "contentType": "example", "visibility": "example", "folderId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "assetId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "locale": "example", "openInBrowser": true, "metadata": {} }'Plans an upload and returns where to send the bytes. Give the file’s kind (image, video or document), sizeBytes, filename and contentType, and optionally visibility and folderId. The answer carries an uploadId and a presigned PUT URL (or part URLs for a file over 100 MB): send the file there yourself, then call complete.
Nothing is stored until complete. An upload that is never completed is removed after 24 hours.
Uses the same limits as the Assets app: storage and public-image quotas, the per-type size limits, and the same checks on what a file really is (the declared type is ignored). A request that would go over a quota answers 403 quota_exceeded.
Key: an Assets management key with assets.management.write.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "kind": "example", "sizeBytes": 1, "filename": "example", "contentType": "example", "visibility": "example", "folderId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "assetId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "locale": "example", "openInBrowser": true, "metadata": {}}Responses
Section titled “ Responses ”The plan: { "uploadId": "…", "method": "put", "url": "…", "headers": {} }.
validation_failed: a member is missing or out of range.
missing_api_key or invalid_api_key: no key was sent, or it is unknown, revoked or expired.
payment_required: the organization’s subscription needs attention.
quota_exceeded: storage, video minutes or the public-image allowance would be exceeded. plan_required: public documents need a paid plan.
scope_denied: the key is not an Assets management key. permission_denied: a read key was used for a write. app_not_available: Assets is not enabled for the organization. origin_denied or ip_denied: the key was used from an origin or address outside its restrictions.
too_many_failed_authentications: too many bad keys from this address; rate_limited: too many requests from the organization. Retry-After says how long to wait.