For AI agents: markdown of this page — /docs-content-en/storage/upload/complete.md documentation index — /llms.txt

Complete upload

POST /v1/storage/objects/complete

Temporarily disabled. This fail-closed method returns 503 STORAGE_PRESIGNED_UPLOAD_DISABLED and does not publish bytes from a PENDING reservation.

The second step of the presigned-URL upload — captures the actual file size and type from storage and moves the object to status COMPLETED.

Request fields (body)

Field Type Required Default Description
FieldobjectId Typestring Requiredyes Default— DescriptionObject identifier from the POST /v1/storage/objects response

Examples

curl — personal key

Terminal
curl -X POST https://vibecode.bitrix24.com/v1/storage/objects/complete \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"objectId":"cmpf9b1gp003omr0zkc0qjojn"}'

curl — OAuth application

Terminal
curl -X POST https://vibecode.bitrix24.com/v1/storage/objects/complete \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"objectId":"cmpf9b1gp003omr0zkc0qjojn"}'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/storage/objects/complete', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ objectId: 'cmpf9b1gp003omr0zkc0qjojn' }),
})

if (!res.ok) {
  const { error } = await res.json()
  console.error(error.code, error.message)
  return
}
const { object } = await res.json()
console.log('Upload complete, key:', object.key)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/storage/objects/complete', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ objectId: 'cmpf9b1gp003omr0zkc0qjojn' }),
})

const { object } = await res.json()

Response fields

Field Type Description
Fieldobject.id Typestring DescriptionObject identifier
Fieldobject.key Typestring DescriptionLogical object key
Fieldobject.contentType Typestring DescriptionActual file MIME type (captured from storage)
Fieldobject.sizeBytes Typestring DescriptionActual file size in bytes (string)
Fieldobject.sha256 Typestring DescriptionFile SHA-256 hash or null
Fieldobject.visibility Typestring DescriptionVisibility: PRIVATE or PUBLIC
Fieldobject.uploadStatus Typestring DescriptionUpload status: COMPLETED
Fieldobject.createdAt Typestring DescriptionCreation date (ISO 8601)
Fieldobject.deletedAt Typestring DescriptionDeletion date or null
Fieldobject.contentUpdatedAt Typestring (ISO 8601) DescriptionWhen the content last became current: a replacement, or the first completion of the upload. Service updates do not move it. null for objects last written before this field existed

Response example

JSON
{
  "object": {
    "id": "cmpf9b1gp003omr0zkc0qjojn",
    "key": "users/42/avatar.png",
    "contentType": "image/png",
    "sizeBytes": "20480",
    "sha256": null,
    "visibility": "PRIVATE",
    "uploadStatus": "COMPLETED",
    "createdAt": "2026-05-21T08:56:32.809Z",
    "deletedAt": null
  }
}

Error response example

409 — the file was not sent to the presigned URL:

JSON
{
  "success": false,
  "error": {
    "code": "STORAGE_UPLOAD_NOT_FOUND_IN_BUCKET",
    "message": "..."
  }
}

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_OBJECT_ID_REQUIRED DescriptionThe objectId field was not provided
HTTP404 CodeSTORAGE_OBJECT_NOT_FOUND DescriptionNo object found with the given objectId
HTTP409 CodeSTORAGE_UPLOAD_NOT_PENDING DescriptionThe object was already completed earlier
HTTP409 CodeSTORAGE_UPLOAD_NOT_FOUND_IN_BUCKET DescriptionThe file was not sent to the presigned URL
HTTP415 CodeSTORAGE_FORBIDDEN_CONTENT_TYPE DescriptionFor PUBLIC objects, a MIME type was detected that is disallowed for security reasons; the object is deleted
HTTP503 CodeSTORAGE_FEATURE_DISABLED DescriptionStorage is disabled for the portal
HTTP503 CodeSTORAGE_PRESIGNED_UPLOAD_DISABLED DescriptionPath B is temporarily disabled; the PENDING reservation stays fail-closed
HTTP503 CodeSTORAGE_STS_UNAVAILABLE DescriptionThe temporary credentials issuance service is unavailable
HTTP502 CodeSTORAGE_BUCKET_ERROR DescriptionError while interacting with storage

Full list of common API errors — Errors.

Known specifics

Type check for PUBLIC objects. The actual MIME type is determined from the storage data, not from the contentType field passed at the object-creation step. The types a browser renders as a page, runs or sniffs are forbidden: HTML and XHTML, SVG, JavaScript, any XML (*/xml, *+xml), XSL, multipart/*, message/*, unknown/unknown, application/unknown, */*, with or without parameters.

See also