Skip to navigation

Create Batch

Start a batch of generations from a JSONL file. To send the records as a JSON array instead, use Create Batch from Rows.

  • Each line holds a request_id, endpoint set to /v2/generate, and a generation payload.
  • A batch holds 20 to 500 records by default, in a file of 5 MB or less.
  • Each active batch uses one slot of your plan’s batch concurrency limit; going over returns 429 concurrency_limit_reached.

Batch needs the Scale plan or above and approval for your organization. Contact support@sync.so to request access; until then this returns 403 batch_access_not_enabled. A refused record is named by its line number. See Batch Processing.

Authentication

x-api-keystring
API Key authentication via header

Request

This endpoint expects a multipart form containing a file.
inputfileRequired

The JSONL file, sent in the input field (file also works). Each non-empty line has a unique request_id, endpoint set to /v2/generate, and a generation payload. 20 to 500 records by default, 5 MB at most.

webhook_urlstringOptional

URL that receives a POST when the batch completes or fails, signed with your organization’s webhook secret in the Sync-Signature header. Omit it or leave it empty to skip notifications. A non-empty value must be an http:// or https:// URL; an invalid URL returns 400. See Webhooks.

dry_runbooleanOptionalDefaults to false

When true, validates the JSONL file and returns { "status": "VALIDATED" } without creating a batch. Requires the same organization approval and plan as batch creation.

Response

This endpoint returns an object.
Batch Responseobject
OR
Validation Responseobject

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error