Create chunked upload session
const url = 'https://api.cardio.ai/v3/uploads';const options = { method: 'POST', headers: {'X-Api-Token': '<X-Api-Token>', 'Content-Type': 'application/json'}, body: '{"total_size":1,"hash_sum":"example"}'};
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.cardio.ai/v3/uploads \ --header 'Content-Type: application/json' \ --header 'X-Api-Token: <X-Api-Token>' \ --data '{ "total_size": 1, "hash_sum": "example" }'Creates a new session for uploading a file in chunks.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Chunked upload request.
Request payload for initializing a chunked upload.
object
Total size of the file to be uploaded in bytes.
SHA-256 hash of the full file, encoded with standard padded Base64.
Examplegenerated
{ "total_size": 1, "hash_sum": "example"}Responses
Section titled “Responses”Successful response containing the upload session ID.
Response payload for a chunked upload initialization.
object
Unique identifier for the upload session.
Examplegenerated
{ "upload_id": "example"}Bad Request - missing or invalid parameters.
Error payload carried by every non-2xx response.
object
Human-readable description of the failure. The wording is not part of the API contract; do not match on it programmatically.
Stable machine-readable failure code in snake_case, e.g. “api_token_missing” or “invalid_task_id”. Omitted for 500 responses.
Examplegenerated
{ "message": "example", "reason": "example"}Unauthorized - missing, expired, or invalid token.
Error payload carried by every non-2xx response.
object
Human-readable description of the failure. The wording is not part of the API contract; do not match on it programmatically.
Stable machine-readable failure code in snake_case, e.g. “api_token_missing” or “invalid_task_id”. Omitted for 500 responses.
Examplegenerated
{ "message": "example", "reason": "example"}Unsupported Media Type - Content-Type must be application/json.
Error payload carried by every non-2xx response.
object
Human-readable description of the failure. The wording is not part of the API contract; do not match on it programmatically.
Stable machine-readable failure code in snake_case, e.g. “api_token_missing” or “invalid_task_id”. Omitted for 500 responses.
Examplegenerated
{ "message": "example", "reason": "example"}Too Many Requests - rate limit exceeded.
Error payload carried by every non-2xx response.
object
Human-readable description of the failure. The wording is not part of the API contract; do not match on it programmatically.
Stable machine-readable failure code in snake_case, e.g. “api_token_missing” or “invalid_task_id”. Omitted for 500 responses.
Examplegenerated
{ "message": "example", "reason": "example"}