Skip to navigation

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 to the session
  3. Commit the session to finalize the upload

Authentication

AuthorizationBearer
Bearer HTTP authentication.

Headers

IB-ContextstringOptional

Typically your organization ID. See Authorization and context identification 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 headers

LocationstringOptional

The session endpoint URL to use in subsequent multipart upload requests, in the form <API-ROOT>/v2/batches/multipart-upload/sessions/<SESSION-ID>.

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

404
Not Found Error