Start multipart upload session

Start a multipart upload session. Use this endpoint when you need to upload a file larger than 10 MB to a batch. The multipart upload process consists of three steps: 1. Create a multipart upload session (this endpoint) 2. [Upload file parts](/api-sdk/api-reference/batches/upload-multipart-part) to the session 3. [Commit the session](/api-sdk/api-reference/batches/commit-multipart-upload-session) to finalize the upload

Authentication

AuthorizationBearer
Bearer HTTP authentication.

Headers

IB-ContextstringOptional
Specify whether to use your community account or organization account to complete the request. To use your community account, define as your user ID. To use your organization account, define as your organization ID. If unspecified, defaults to community account context. See [Authorization and context identification](/api-sdk/authorization#ib-context-header) for details.

Request

This endpoint expects an object.
batch_idintegerRequired
The batch ID to upload the file to.
filenamestringRequired
A file name for the uploaded file on the AI Hub filesystem, including the file extension. Maximum of 255 characters.
file_sizeintegerRequired
The file size, in bytes. Can be an integer or a string.

Response

The multipart upload session was initiated.
session_idstring
ID of the multipart upload session.
part_sizeinteger

The number of bytes each part should be when uploading to the session. Each part should match the part_size, except for the final part, which can be smaller than the part_size.

Errors