Sample - Box Platform API
POST/files/upload_sessions/{upload_session_id}/plan

Plan upload session

Plan an upload session by checking which parts already exist on the server. This endpoint allows clients to optimize uploads by skipping parts that have already been uploaded (cache hits) and only uploading missing parts.

The actual endpoint URL is returned by the Create upload session and Get upload session endpoints.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 1 body field
upload_session_idstringrequired
The ID of the upload session.
partsarray<UploadPartPlan>required
The list of parts to check for existence.

3 status codes
200Returns information about which parts already exist (hits) and which parts need to be uploaded (misses).
upload_session_idstringrequired
The unique identifier for this upload session.
hitsarray<UploadPartPlanHit>required
Parts that already exist on the server and do not need to be uploaded again.
missesarray<UploadPartPlan>required
Parts that do not exist on the server and need to be uploaded.
404Returns an error if the upload session cannot be found.
typestringoptional
The value will always be `error`.
Allowed:error
statusintegeroptional
The HTTP status of the response.
codestringoptional
A Box-specific error code.
Allowed:createdacceptedno_contentredirectnot_modifiedbad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictprecondition_failed
messagestringoptional
A short message describing the error.
context_infoobjectoptional
A free-form object that contains additional context about the error. The possible fields are defined on a per-endpoint basis. `message` is only one example.
help_urlstringoptional
A URL that links to more information about why this error occurred.
request_idstringoptional
A unique identifier for this response, which can be used when contacting Box support.
defaultAn unexpected client error.
typestringoptional
The value will always be `error`.
Allowed:error
statusintegeroptional
The HTTP status of the response.
codestringoptional
A Box-specific error code.
Allowed:createdacceptedno_contentredirectnot_modifiedbad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictprecondition_failed
messagestringoptional
A short message describing the error.
context_infoobjectoptional
A free-form object that contains additional context about the error. The possible fields are defined on a per-endpoint basis. `message` is only one example.
help_urlstringoptional
A URL that links to more information about why this error occurred.
request_idstringoptional
A unique identifier for this response, which can be used when contacting Box support.

Error handling

A 404 is returned: Returns an error if the upload session cannot be found. Any other status is an error: An unexpected client error.