For AI agents: markdown of this page — /docs-content-en/storage/upload/multipart-abort.md documentation index — /llms.txt
Abort multipart upload
POST /v1/storage/objects/multipart/abort
Aborts an incomplete multipart upload session and frees the uploaded parts. For a first upload, the PENDING record is deleted. During replacement, the existing object and its previous content are preserved; only the session fields are cleared. Session state is cleared only after a successful abort or a storage response confirming that the exact uploadId is already absent. On a timeout, 5xx, throttling, or unknown abort error, the server retains the session for retry and returns 502 STORAGE_BUCKET_ERROR. If finalization owns the session, abort returns 409 STORAGE_KEY_CONFLICT: retry complete with the same parts; a journalled response finishes locally, while an unconfirmed outcome requires operator reconciliation. Aborted parts cannot be recovered.
Request fields (body)
The request body is JSON.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ParameterobjectId |
Typestring | Requiredyes | Default— | DescriptionObject identifier obtained from the /multipart/create response |
Examples
curl — personal key
curl -X POST https://vibecode.bitrix24.com/v1/storage/objects/multipart/abort \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"objectId": "cmpfg012a01aco510mrr6u632"}'
curl — OAuth application
curl -X POST https://vibecode.bitrix24.com/v1/storage/objects/multipart/abort \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"objectId": "cmpfg012a01aco510mrr6u632"}'
JavaScript — personal key
const res = await fetch(
'https://vibecode.bitrix24.com/v1/storage/objects/multipart/abort',
{
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ objectId: 'cmpfg012a01aco510mrr6u632' }),
}
)
const { aborted } = await res.json()
console.log('Aborted:', aborted) // true
JavaScript — OAuth application
const res = await fetch(
'https://vibecode.bitrix24.com/v1/storage/objects/multipart/abort',
{
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({ objectId: 'cmpfg012a01aco510mrr6u632' }),
}
)
const { aborted } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldaborted |
Typeboolean | Descriptiontrue on successful abort |
Response example
{
"aborted": true
}
Error response example
404 — the object was not found or the session is already finalized:
{
"success": false,
"error": {
"code": "STORAGE_OBJECT_NOT_FOUND",
"message": "StorageObject cmpfg012a01aco510mrr6u632 not found"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP403 | CodeSTORAGE_SCOPE_REQUIRED |
DescriptionThe API key lacks the vibe:storage scope |
| HTTP401 | CodeSTORAGE_NO_AUTH_CONTEXT |
DescriptionThe request was made without authorization |
| HTTP400 | CodeSTORAGE_INVALID_PATH |
DescriptionThe caller identifier contains invalid path characters |
| HTTP400 | CodeSTORAGE_OBJECT_ID_REQUIRED |
DescriptionThe objectId field was not provided |
| HTTP404 | CodeSTORAGE_OBJECT_NOT_FOUND |
DescriptionThe object with the given objectId was not found, does not belong to the current caller, or the session is already finalized |
| HTTP409 | CodeSTORAGE_KEY_CONFLICT |
DescriptionIf the address is briefly busy before finalization, retry abort after it is released. If finalization owns the session, retry complete with the same parts: a journalled response finishes locally, while an unconfirmed provider outcome requires operator reconciliation |
| HTTP502 | CodeSTORAGE_BUCKET_ERROR |
DescriptionThe provider abort was not confirmed, so the session was retained. Retry the same abort operation |
| HTTP503 | CodeSTORAGE_FEATURE_DISABLED |
DescriptionStorage is disabled for the portal |
| HTTP503 | CodeSTORAGE_STS_UNAVAILABLE |
DescriptionThe temporary credentials issuance service is unavailable |
Full list of common API errors — Errors.
Known specifics
Incomplete sessions are processed automatically after 24 hours. For a first upload, the PENDING row is deleted, while a replacement preserves the existing object and its previous content, but only after the provider abort is confirmed. If /abort returns 502 STORAGE_BUCKET_ERROR, retry it: the cleanup obligation and uploadId were retained.