---
title: "Cancel Indexing Job for a Knowledge Base"
method: PUT
path: "/v2/gen-ai/indexing_jobs/{uuid}/cancel"
tags: ["DigitalOcean-public.v2-new_GradientAI Platform"]
---

# Cancel Indexing Job for a Knowledge Base

`PUT /v2/gen-ai/indexing_jobs/{uuid}/cancel`

To cancel an indexing job for a knowledge base, send a PUT request to `/v2/gen-ai/indexing_jobs/{uuid}/cancel`.

## Path parameters

- `uuid` string, required

## Request body

- ApiCancelKnowledgeBaseIndexingJobInputPublic — CancelKnowledgeBaseIndexingJobInputPublic description
  - `uuid` string — A unique identifier for an indexing job.

## Response `200`

A successful response.

- ApiCancelKnowledgeBaseIndexingJobOutput — CancelKnowledgeBaseIndexingJobOutput description
  - `job` ApiIndexingJob — IndexingJob description
    - `completed_datasources` integer — Number of datasources indexed completed
    - `created_at` string, date-time — Creation date / time
    - `data_source_uuids` string[]
    - `finished_at` string, date-time
    - `knowledge_base_uuid` string — Knowledge base id
    - `phase` 'BATCH_JOB_PHASE_UNKNOWN' | 'BATCH_JOB_PHASE_PENDING' | 'BATCH_JOB_PHASE_RUNNING' | 'BATCH_JOB_PHASE_SUCCEEDED' | 'BATCH_JOB_PHASE_FAILED' | 'BATCH_JOB_PHASE_ERROR' | 'BATCH_JOB_PHASE_CANCELLED'
    - `started_at` string, date-time
    - `status` 'INDEX_JOB_STATUS_UNKNOWN' | 'INDEX_JOB_STATUS_PARTIAL' | 'INDEX_JOB_STATUS_IN_PROGRESS' | 'INDEX_JOB_STATUS_COMPLETED' | 'INDEX_JOB_STATUS_FAILED' | 'INDEX_JOB_STATUS_NO_CHANGES' | 'INDEX_JOB_STATUS_PENDING'
    - `tokens` integer — Number of tokens
    - `total_datasources` integer — Number of datasources being indexed
    - `total_items_failed` string, uint64 — Total Items Failed
    - `total_items_indexed` string, uint64 — Total Items Indexed
    - `total_items_skipped` string, uint64 — Total Items Skipped
    - `updated_at` string, date-time — Last modified
    - `uuid` string — Unique id

## Other responses

- `401` — Authentication failed due to invalid credentials.
- `404` — The resource was not found.
- `429` — The API rate limit has been exceeded.
- `500` — There was a server error.
- `default` — There was an unexpected error.

---

[API](https://skmtc.net/digitalocean/apis/digitalocean-api.md) · [All operations](https://skmtc.net/digitalocean/apis/digitalocean-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalocean/digitalocean-api/revisions/cb3bf9b21459/schema)
