---
title: "Submit Batch for Processing"
method: POST
path: "/v1/buckets/{bucket_identifier}/batches/{batch_id}/submit"
tags: ["Bucket Batches"]
---

# Submit Batch for Processing

`POST /v1/buckets/{bucket_identifier}/batches/{batch_id}/submit`

## Request

- Base URL: `https://api.mixpeek.com`
- URL: `https://api.mixpeek.com/v1/buckets/{bucket_identifier}/batches/{batch_id}/submit`
- Auth: HTTP bearer and API key in header `X-Namespace`

Submit a draft batch for asynchronous processing. The batch must be in 'DRAFT' status and contain objects.

## Path parameters

- `bucket_identifier` string, required: The unique identifier of the bucket.
- `batch_id` string, required: The unique identifier of the batch.

## Query parameters

- `force` boolean: Bypass the concurrent batch dedup check. Use when you intentionally want to reprocess the same bucket+collection combination while another batch is in flight.

## Request body

- SubmitBatchRequest: Request model for submitting a batch for processing. This model allows configuration of processing behavior for the batch, such as whether to track processing history in document metadata. Use Cases: - Submit batch with full audit trail (include_processing_history=True) - Submit batch without processing history for cleaner metadata (include_processing_history=False) - Default behavior includes processing history for debugging and lineage tracking Requirements: - include_processing_history: OPTIONAL, defaults to True
  - `include_processing_history` boolean: OPTIONAL (defaults to True). Controls whether processing operations are tracked in document internal_metadata.processing_history. When True: Each enrichment operation (taxonomy application, clustering, etc.) adds an audit trail entry. When False: Documents are enriched without processing history tracking, resulting in cleaner metadata. Use True for: Debugging, audit requirements, lineage tracking, understanding document transformations. Use False for: Production workloads where metadata size matters, simplified document structure. Processing history entries include: operation type, timestamp, and IDs of applied resources (taxonomies, clusters, etc.).
  - `collection_ids` string[], nullable: DEPRECATED submit-time compatibility field. Collection scope is resolved when the batch is created via CreateBatchRequest.collection_ids. If provided at submit time, it must match the batch's tier-0 scope; otherwise submission fails closed instead of silently processing unexpected collections.
  - `webhook_url` string, nullable: OPTIONAL. URL to receive an HTTP POST notification when the batch reaches a terminal state (COMPLETED, FAILED, or CANCELED). The payload includes batch_id, status, failure_reason, documents_written, progress, and completed_at. The webhook is fire-and-forget: delivery failures are logged but do not affect batch processing. Must be an HTTPS or HTTP URL reachable from the server.

## Response `200`

Successful Response

- TaskResponse: Task response model returned by the API. Extends TaskModel with additional convenience fields for API responses. This is the model returned when you GET /v1/tasks/{task_id}. Additional Fields: error_message: Convenience field that surfaces errors from additional_data for easier error handling in client code. Inheritance: Inherits all fields and documentation from TaskModel, including: - task_id: Unique identifier - task_type: Operation type - status: Current status - inputs: Input parameters - outputs: Output results - additional_data: Metadata and context Storage Architecture: Same as TaskModel - stored in Redis (24hr TTL) with MongoDB fallback. Usage: This model is automatically returned by task API endpoints. You don't need to construct it manually - just call GET /v1/tasks/{task_id}. Error Handling: Check the error_message field for a user-friendly error string, or additional_data['error'] for the full error details. Example Response: { "task_id": "task_abc123", "task_type": "api_buckets_batches_process", "status": "FAILED", "inputs": ["batch_xyz"], "outputs": null, "additional_data": { "error": "Failed to process batch: Object not found", "batch_id": "batch_xyz" }, "error_message": "Failed to process batch: Object not found" }
  - `task_id` string, required: Unique identifier for the task. REQUIRED. Used to poll task status via GET /v1/tasks/{task_id}. This ID is also stored on parent resources (batches, clusters, etc.) for cross-referencing. Format: UUID v4 or custom string identifier.
  - `task_type` 'api_namespaces_create' | 'api_namespaces_delete' | 'api_namespaces_snapshot_create' | 'api_namespaces_snapshot_restore' | 'api_namespaces_migrations_run' | 'api_buckets_objects_create' | 'api_buckets_delete' | 'api_buckets_batches_process' | 'api_buckets_batches_submit' | 'api_buckets_uploads_create' | 'api_buckets_uploads_confirm' | 'api_buckets_uploads_batch_confirm' | 'api_collections_documents_create' | 'api_collections_documents_bulk_update' | 'api_collections_documents_bulk_delete' | 'api_collections_reembed' | 'api_collections_extraction_artifacts' | 'api_taxonomies_create' | 'api_taxonomies_execute' | 'api_taxonomies_materialize' | 'api_evaluations_run' | 'api_evaluations_dataset_create' | 'api_retrievers_publish' | 'api_manifest_apply' | 'api_retrievers_execute' | 'api_collections_export' | 'api_collections_trigger' | 'engine_feature_extractor_run' | 'engine_inference_run' | 'engine_object_processing' | 'engine_cluster_build' | 'thumbnail' | 'video_segment' | 'audio_segment' | 'converted_video' | 'materialize' | 'plugin_custom' | 'model_custom', required: Types of asynchronous tasks that can be performed in the system. Task types identify the specific operation being performed. This helps with tracking, debugging, and filtering tasks by operation type. Categories: API Tasks: User-initiated operations via API endpoints Engine Tasks: Background processing tasks Inference Tasks: Specialized inference operations API Task Types: API_NAMESPACES_CREATE: Creating a new namespace API_NAMESPACES_MIGRATIONS_RUN: Running a namespace migration API_BUCKETS_OBJECTS_CREATE: Creating objects in a bucket API_BUCKETS_DELETE: Deleting a bucket and its contents API_BUCKETS_BATCHES_PROCESS: Processing a batch of objects API_BUCKETS_BATCHES_SUBMIT: Submitting a batch for processing API_BUCKETS_UPLOADS_CREATE: Creating an upload session API_BUCKETS_UPLOADS_CONFIRM: Confirming an upload completion API_BUCKETS_UPLOADS_BATCH_CONFIRM: Confirming batch upload completion API_TAXONOMIES_CREATE: Creating a new taxonomy API_TAXONOMIES_EXECUTE: Executing taxonomy classification API_TAXONOMIES_MATERIALIZE: Materializing taxonomy results API_RETRIEVERS_PUBLISH: Publishing retriever assets (OG images, etc.) Engine Task Types: ENGINE_FEATURE_EXTRACTOR_RUN: Running feature extraction on data ENGINE_INFERENCE_RUN: Running inference operations ENGINE_OBJECT_PROCESSING: Processing object data ENGINE_CLUSTER_BUILD: Building clusters from data Inference Task Types: THUMBNAIL: Generating thumbnails MATERIALIZE: Materializing processed data Usage: Task types are automatically assigned when tasks are created. You can filter tasks by type when listing or searching for specific operations.
  - `status` 'PENDING' | 'QUEUED' | 'IN_PROGRESS' | 'PROCESSING' | 'COMPLETED' | 'COMPLETED_WITH_ERRORS' | 'FAILED' | 'CANCELED' | 'INTERRUPTED' | 'UNKNOWN' | 'SKIPPED' | 'DRAFT' | 'ACTIVE' | 'ARCHIVED' | 'SUSPENDED' | 'DEACTIVATED', required: Enumeration of task statuses for tracking asynchronous operations. Task statuses indicate the current state of asynchronous operations like batch processing, object ingestion, clustering, and taxonomy execution. Status Categories: Operation Statuses: Track progress of async operations Lifecycle Statuses: Track entity state (buckets, collections, namespaces) Values: PENDING: Task is queued but has not started processing yet IN_PROGRESS: Task is currently being executed PROCESSING: Task is actively processing data (similar to IN_PROGRESS) COMPLETED: Task finished successfully with no errors COMPLETED_WITH_ERRORS: Task finished but some items failed (partial success) FAILED: Task encountered an error and could not complete CANCELED: Task was manually canceled by a user or system UNKNOWN: Task status could not be determined SKIPPED: Task was intentionally skipped DRAFT: Task is in draft state and not yet submitted ACTIVE: Entity is active and operational (for buckets, collections, etc.) ARCHIVED: Entity has been archived SUSPENDED: Entity has been temporarily suspended Terminal Statuses: COMPLETED, COMPLETED_WITH_ERRORS, FAILED, CANCELED are terminal statuses. Once a task reaches these states, it will not transition to another state. Partial Success Handling: COMPLETED_WITH_ERRORS indicates that the operation completed but some documents/items failed. The task result includes: - List of successful items - List of failed items with error details - Success rate percentage This allows clients to handle partial success scenarios appropriately. Polling Guidance: - Poll tasks in PENDING, QUEUED, IN_PROGRESS, or PROCESSING states - Stop polling when task reaches COMPLETED, COMPLETED_WITH_ERRORS, FAILED, or CANCELED - Use exponential backoff (1s → 30s) when polling
  - `inputs` union[], nullable: Input parameters or data used to start the task. OPTIONAL. May include IDs, configuration objects, or file references. Useful for debugging and understanding what data the task processed. Format: List of strings (IDs) or objects (configuration). Example: ['batch_id_123'] or [{'bucket_id': 'bkt_abc', 'config': {...}}]
    - union
      - string
      - object
  - `outputs` union[], nullable: Output results produced by the task. OPTIONAL. Populated when task completes successfully. May include processed file IDs, result metrics, or status summaries. Check this field after task reaches COMPLETED status to get results. Format: List of strings (output IDs) or objects (result data).
    - union
      - string
      - object
  - `additional_data` object, nullable: Additional metadata and context for the task. OPTIONAL. Contains job IDs, error details, progress info, and other task-specific metadata. Common fields (all task types): - 'error': Error message if task failed - 'job_id': Ray job ID for engine tasks - 'from_mongodb': True if retrieved from MongoDB fallback (not Redis) Batch-specific fields (task_type=api_buckets_batches_process): - 'batch_id': Batch identifier (REQUIRED) - 'bucket_id': Source bucket identifier (REQUIRED) - 'namespace_id': Namespace identifier (REQUIRED) - 'current_tier': Currently processing tier number, 0-indexed (OPTIONAL, None if not started) - 'total_tiers': Total number of tiers in the batch pipeline (REQUIRED) - 'collection_ids': Array of ALL collection IDs across all tiers (REQUIRED) - 'object_count': Number of objects being processed (REQUIRED) - 'sample_object_ids': First 5 object IDs for debugging/display (OPTIONAL) Performance Note: Full object_ids array is NOT stored in task metadata to avoid bloating task documents (batches with 10k+ objects would add 200KB+ per task). For full object list, query the batch directly via GET /v1/buckets/{bucket_id}/batches/{batch_id}. Note: For detailed per-tier status, use GET /v1/buckets/{bucket_id}/batches/{batch_id} to access the tier_tasks[] array which contains individual tier statuses, collection_ids, and timestamps for each tier.
  - `error` string, nullable: Flattened error message for convenient error handling. OPTIONAL. Automatically populated from additional_data['error'] when the task has FAILED status. This is a convenience field - the full error details are always available in additional_data['error']. Use this field for displaying errors to users or logging. Will be None if task has not failed or if no error details are available. Serialized as 'error' in API responses for backward compatibility.
  - `cancellation` CancellationOutcome: What a cancel request actually reached, as opposed to what it asked for. A cancel used to answer HTTP 200 whether or not a single worker was reached, so a caller could not tell "the jobs are stopping" from "the request was accepted and nothing was dispatched". A client showing "successfully cancelled" on that 200 is guessing. The three counters are dispatch outcomes and do not describe the batch's final state: jobs can be accepted and still take time to wind down, so a fully accepted cancellation is not a claim that work has stopped. Present-and-zero is meaningful and differs from absent. All zeroes means the cancel path ran and had nothing to dispatch. The field being absent means the response came from a path that never ran a dispatch at all.
    - `ray_jobs_requested` integer: Ray jobs this cancel attempted to stop: accepted plus refused. Zero means the batch had no Ray jobs to stop, which is normal for a batch that had not been dispatched yet.
    - `ray_jobs_accepted` integer: Ray jobs that accepted the stop. This reports DISPATCH, not completion: an accepted job may still be winding down.
    - `ray_jobs_refused` integer: Ray jobs that refused or errored on the stop. Non-zero means some work may still be running, and the caller should not report the cancellation as complete.
  - `queue_position` integer, nullable: 1-based position in the Ray processing waitlist. None if the batch was dispatched immediately (no queue). Position 1 means this batch will be processed next.
  - `estimated_wait_minutes` number, nullable: Estimated minutes until this batch starts processing, based on queue position and average batch duration. None if the batch was dispatched immediately.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `422`: Unprocessable Entity
- `429`: Too Many Requests
- `500`: Internal Server Error
- `503`: Service Unavailable

## Changes

- **2026-10-09** `61a175e8eb9a`: 1 warning, 5 info
  - removed the optional property `detail` from the response with the `422` status
  - added the non-success response with the status `429`
  - added the non-success response with the status `503`
  - added the optional property `success` to the response with the `422` status
  - …2 more
- **2026-10-06** `b75474e978ff`: 1 warning
  - added the new `api_manifest_apply` enum value to the `task_type` response property for the response status `200`
- **2026-09-29** `a564bf7a060b`: 1 warning
  - added the new `api_collections_reembed` enum value to the `task_type` response property for the response status `200`
- **2026-09-19** `4bbfcce2371b`: 1 info
  - added the optional property `cancellation` to the response with the `200` status
- **2026-09-04** `0c7a1c6ab9c0`: 2 warning
  - added the new `api_collections_documents_bulk_delete` enum value to the `task_type` response property for the response status `200`
  - added the new `api_collections_documents_bulk_update` enum value to the `task_type` response property for the response status `200`

[Operation history](https://skmtc.dev/mixpeek/apis/mixpeek-api/changes/v1/buckets/:bucket_identifier/batches/:batch_id/submit/post.md)

---

[API](https://skmtc.dev/mixpeek/apis/mixpeek-api.md) - [All operations](https://skmtc.dev/mixpeek/apis/mixpeek-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mixpeek/apis/mixpeek-api/revisions/790bc16455f6?raw)
