Skip to main content
POST
Cancel a batch
Cancel queued and running tasks in a batch that is open or processing. This does not undo tasks that have already completed. The response has batch_id, status and cancelled_count. It also has the fields of the batch: name, mode, counts, cost, created_at, completed_at, output_formats, results_ready and task_defaults. It has no success field. Retrieve batch status and individual task states afterward so your application shows the actual outcome.

Authorizations

X-API-Key
string
header
required

API key for authentication. Get yours at platform.valyu.ai.

Path Parameters

id
string
required

Batch ID.

Response

Batch cancelled.

batch_id
string
required

ID of the cancelled batch.

Example:

"batch_a1b2c3d4-e5f6-7890-abcd-ef1234567890"

status
enum<string>
required

Batch status after cancellation.

Available options:
cancelled
Example:

"cancelled"

cancelled_count
integer
required

Number of tasks cancelled.

Example:

3

name
string

Name of the batch.

mode
string

Research mode of the batch.

counts
object

Task count breakdown for a batch.

cost
number

Cost across the tasks of the batch.

created_at
string<date-time>

ISO 8601 timestamp of batch creation.

completed_at
string<date-time>

ISO 8601 timestamp. Present when the batch has finished.

output_formats
(string | object)[]

Output formats of the batch.

results_ready
boolean

Whether the results of the batch are ready.

task_defaults
object

Shared settings that the tasks of the batch use.