v1

latestOpenAPI 3.0.2Apache-2.02026-07-142963051.0 MB
Uploads (Chunked)

Create upload session

Creates an upload session for a new file.

post/files/upload_sessions

Request body

folder_idstring required

The ID of the folder to upload the new file to.

file_sizeinteger required

The total number of bytes of the file to be uploaded.

file_namestring required

The name of new file.

Example request

{
  "folder_id": "0",
  "file_size": 104857600,
  "file_name": "Project.mov"
}

Response

Returns a new upload session.

idstring

The unique identifier for this session.

type'upload_session'

The value will always be upload_session.

session_expires_atstring date-time

The date and time when this session expires.

part_sizeinteger

The size in bytes that must be used for all parts of of the upload.

Only the last part is allowed to be of a smaller size.

total_partsinteger

The total number of parts expected in this upload session, as determined by the file size and part size.

num_parts_processedinteger

The number of parts that have been uploaded and processed by the server. This starts at 0.

When committing a file files, inspecting this property can provide insight if all parts have been uploaded correctly.

Example response

{
  "id": "F971964745A5CD0C001BBE4E58196BFD",
  "type": "upload_session",
  "session_expires_at": "2012-12-12T10:53:43-08:00",
  "part_size": 1024,
  "total_parts": 1000,
  "num_parts_processed": 455,
  "session_endpoints": {
    "upload_part": "https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD",
    "commit": "https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD/commit",
    "abort": "https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD",
    "list_parts": "https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD/parts",
    "status": "https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD",
    "log_event": "https://{box-upload-server}/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD/log"
  }
}