取消批处理

Cancels an in-progress batch. The batch will be in status `cancelling` for up to 10 minutes, before changing to `cancelled`, where it will have partial results (if any) available in the output file.

post
/batches/{batch_id}/cancel
Authorizations
x-portkey-api-keystringRequired
x-portkey-virtual-keystringRequired
Path parameters
batch_idstringRequired

The ID of the batch to cancel.

Responses
chevron-right
200

Batch is cancelling. Returns the cancelling batch's details.

application/json
idstringRequired
objectstring · enumRequired

The object type, which is always batch.

Possible values:
endpointstringRequired

The Portkey API endpoint used by the batch.

input_file_idstringRequired

The ID of the input file for the batch.

completion_windowstringRequired

The time frame within which the batch should be processed.

statusstring · enumRequired

The current status of the batch.

Possible values:
output_file_idstringOptional

The ID of the file containing the outputs of successfully executed requests.

error_file_idstringOptional

The ID of the file containing the outputs of requests with errors.

created_atintegerRequired

The Unix timestamp (in seconds) for when the batch was created.

in_progress_atintegerOptional

The Unix timestamp (in seconds) for when the batch started processing.

expires_atintegerOptional

The Unix timestamp (in seconds) for when the batch will expire.

finalizing_atintegerOptional

The Unix timestamp (in seconds) for when the batch started finalizing.

completed_atintegerOptional

The Unix timestamp (in seconds) for when the batch was completed.

failed_atintegerOptional

The Unix timestamp (in seconds) for when the batch failed.

expired_atintegerOptional

The Unix timestamp (in seconds) for when the batch expired.

cancelling_atintegerOptional

The Unix timestamp (in seconds) for when the batch started cancelling.

cancelled_atintegerOptional

The Unix timestamp (in seconds) for when the batch was cancelled.

metadataobject · nullableOptional

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

post
/batches/{batch_id}/cancel
200

Batch is cancelling. Returns the cancelling batch's details.

Last updated