Skip to main content
POST
/
v1
/
buckets
/
{bucket_identifier}
/
uploads
/
{upload_id}
/
confirm
Confirm Upload
curl --request POST \
  --url https://api.mixpeek.com/v1/buckets/{bucket_identifier}/uploads/{upload_id}/confirm \
  --header 'Content-Type: application/json' \
  --data '
{
  "etag": "d41d8cd98f00b204e9800998ecf8427e",
  "file_size_bytes": 10485760
}
'
{
  "upload_id": "<string>",
  "status": "PENDING",
  "etag": "<string>",
  "file_size_bytes": 123,
  "file_hash": "<string>",
  "verified_at": "2023-11-07T05:31:56Z",
  "completed_at": "2023-11-07T05:31:56Z",
  "object_id": "<string>",
  "task_id": "<string>",
  "message": "<string>"
}

Headers

Authorization
string

REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.

Examples:

"Bearer YOUR_API_KEY"

"Bearer YOUR_STRIPE_API_KEY"

X-Namespace
string

REQUIRED: Namespace identifier for scoping this request. All resources (collections, buckets, taxonomies, etc.) are scoped to a namespace. You can provide either the namespace name or namespace ID. Format: ns_xxxxxxxxxxxxx (ID) or a custom name like 'my-namespace'

Examples:

"ns_abc123def456"

"production"

"my-namespace"

Path Parameters

bucket_identifier
string
required

The unique identifier of the bucket

upload_id
string
required

The unique identifier of the upload

Query Parameters

async
boolean
default:false

Process confirmation asynchronously (recommended for files >= 100MB)

Body

application/json

Request to confirm S3 upload completion and create bucket object.

⚠️ THIS ENDPOINT IS REQUIRED AFTER UPLOADING TO S3!

S3 presigned URLs have no callback mechanism - the API cannot detect when your upload completes. You MUST call this endpoint to finalize the upload.

Why confirmation is required: - S3 doesn't notify us when uploads complete - We need to verify the file actually exists in S3 - We need to create the bucket object - We need to update quotas and tracking

The system will:

  1. Verify the S3 object exists (HeadObject call)
  2. Validate ETag matches (if provided) - RECOMMENDED for integrity
  3. Validate file size matches (if provided)
  4. Create bucket object (default, unless create_object_on_confirm=false)
  5. Update upload status to COMPLETED

If you don't call confirm: - Upload stays in PENDING status - No bucket object is created - File is orphaned in S3

etag
string | null

S3 ETag returned from the upload. OPTIONAL but RECOMMENDED. After uploading to S3, the response includes an ETag header. Providing this ensures the file wasn't corrupted during upload. If provided and doesn't match S3's ETag, confirmation will fail with error. Format: Usually an MD5 hash, may be enclosed in quotes.

Example:

"d41d8cd98f00b204e9800998ecf8427e"

file_size_bytes
integer | null

Actual file size uploaded, in bytes. OPTIONAL but RECOMMENDED. If provided, will be validated against the actual S3 object size. Mismatch indicates upload corruption or network issues. If not provided, size validation is skipped.

Required range: x >= 1
Example:

10485760

Response

Successful Response

Response from upload confirmation.

upload_id
string
required

Upload ID that was confirmed

status
enum<string>
required

Updated upload status (COMPLETED or PROCESSING)

Available options:
PENDING,
IN_PROGRESS,
PROCESSING,
COMPLETED,
COMPLETED_WITH_ERRORS,
FAILED,
CANCELED,
UNKNOWN,
SKIPPED,
DRAFT,
ACTIVE,
ARCHIVED,
SUSPENDED
etag
string | null

S3 ETag from uploaded object

file_size_bytes
integer | null

Actual file size from S3

file_hash
string | null

File content hash (from ETag)

verified_at
string<date-time> | null

When verification completed

completed_at
string<date-time> | null

When upload completed

object_id
string | null

Created bucket object ID (if create_object_on_confirm was true)

task_id
string | null

Task ID for async processing (if async=true)

message
string | null

Confirmation message