POST
/
v0.1
/
batches
Create Batch
curl --request POST \
  --url https://api.promptloop.com/v0.1/batches \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-api-key: <api-key>' \
  --form 'task_id=<string>' \
  --form batch_input_data=@example-file
{
  "status": "success",
  "data": [
    {
      "batch_id": "<string>",
      "jobs_submitted": 123,
      "jobs_added": 123,
      "jobs_failed_error_indexes": [
        {
          "error_index": 123,
          "error_message": "<string>"
        }
      ],
      "estimated_time_to_start": "2023-11-07T05:31:56Z",
      "estimated_time_to_complete": "2023-11-07T05:31:56Z"
    }
  ],
  "message": "<string>",
  "error": {
    "code": 123,
    "details": "<string>"
  }
}

Authorizations

x-api-key
string
header
required

Body

multipart/form-data
batch_input_data
file
required

the path to a JSONL file containing objects with the format: { "data_uuid": string, "inputs": array }

task_id
string
required
task_version
number

Optional - Version number of the task to be executed. Will default to latest live version.

Example:

1

batch_name
string

Optional - Name for the batch job

Example:

"Research 001"

webhook_url
string

Optional - Webhook URL to receive results and success status on completion. Data will be sent as a POST request with the data under body.data as an array of objects.

Example:

"https://api.example.com/webhook/batch-results"

Response

Batch successfully created.

status
enum<string>
required
Available options:
success,
error
Example:

"success"

data
object[]
required
message
string
required
error
object