## Cancel vector store file batch

`VectorStoreFileBatch vectorStores().fileBatches().cancel(FileBatchCancelParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**post** `/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel`

Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.

### Parameters

- `FileBatchCancelParams params`

  - `String vectorStoreId`

  - `Optional<String> batchId`

### Returns

- `class VectorStoreFileBatch:`

  A batch of files attached to a vector store.

  - `String id`

    The identifier, which can be referenced in API endpoints.

  - `long createdAt`

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

  - `FileCounts fileCounts`

    - `long cancelled`

      The number of files that where cancelled.

    - `long completed`

      The number of files that have been processed.

    - `long failed`

      The number of files that have failed to process.

    - `long inProgress`

      The number of files that are currently being processed.

    - `long total`

      The total number of files.

  - `JsonValue; object_ "vector_store.files_batch"constant`

    The object type, which is always `vector_store.file_batch`.

    - `VECTOR_STORE_FILES_BATCH("vector_store.files_batch")`

  - `Status status`

    The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`.

    - `IN_PROGRESS("in_progress")`

    - `COMPLETED("completed")`

    - `CANCELLED("cancelled")`

    - `FAILED("failed")`

  - `String vectorStoreId`

    The ID of the [vector store](/api/reference/resources/vector_stores) that the [File](/api/reference/resources/files) is attached to.

### Example

```java
package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.vectorstores.filebatches.FileBatchCancelParams;
import com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        FileBatchCancelParams params = FileBatchCancelParams.builder()
            .vectorStoreId("vector_store_id")
            .batchId("batch_id")
            .build();
        VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().cancel(params);
    }
}
```

#### Response

```json
{
  "id": "id",
  "created_at": 0,
  "file_counts": {
    "cancelled": 0,
    "completed": 0,
    "failed": 0,
    "in_progress": 0,
    "total": 0
  },
  "object": "vector_store.files_batch",
  "status": "in_progress",
  "vector_store_id": "vector_store_id"
}
```
