POST/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel

Cancel a vector store file batch

Attempts to stop processing files in a vector store file batch as soon as possible. Check the returned batch status to see whether processing has been cancelled.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

2 parameters
vector_store_idstringrequired
The ID of the vector store that contains the file batch.
batch_idstringrequired
The ID of the file batch to cancel.

5 status codes
200Returns the file batch object with its current status and file counts after the cancellation request.
idstringrequired
The identifier, which can be referenced in API endpoints.
objectstringrequired
The object type, which is always `vector_store.file_batch`.
Allowed:vector_store.file_batch
created_atintegerrequired
The Unix timestamp (in seconds) for when the vector store files batch was created.
vector_store_idstringrequired
The ID of the [vector store](https://developers.openai.com/api/reference/resources/vector_stores) that the [File](https://developers.openai.com/api/reference/resources/files) is attached to.
statusstringrequired
The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`.
Allowed:in_progresscompletedcancelledfailed
file_countsobjectrequired
400Returned when the file batch identifier is invalid or the vector store has expired.
errorobjectrequired
404Returned when the vector store or file batch was not found.
errorobjectrequired
409Returned when the vector store is temporarily unavailable for this change or was modified concurrently.
errorobjectrequired
429Returned when the request rate limit is exceeded.
errorobjectrequired

Error handling

A 400 is returned when the batch_id path parameter is invalid or the vector store has expired; a 404 is returned when the vector store or file batch is not found. A 409 indicates the vector store is temporarily unavailable or was modified concurrently, and a 429 indicates the request rate limit was exceeded. The vector_store_id and batch_id path parameters must identify the store and batch to cancel.