> ## AI Agent Context
> - Full documentation index: https://aistudio.google.com/llms.txt
> - Gemini Docs MCP server (consistent live info): https://gemini-api-docs-mcp.dev
> - Coding agent skills & setup guide: https://aistudio.google.com/docs/coding-agents.md

# Deleting a document

{% mark class="http-delete" %}{% icon name="close" /%}`DELETE`{% /mark %} `https://generativelanguage.googleapis.com/v1beta/fileSearchStores/{fileSearchStore}/documents/{document}`

Deletes a [`Document`](/api-reference/file-search/documents#Resource:Document).

{% two-column-layout %}
  {% left-column %}
## Parameters  {% class="hide-from-toc" id="parameters" %}

  {% section class="api-ref-property-list" %}
  **document**: {% mark %}required{% /mark %} `string`

  The document ID. Forms the resource name `fileSearchStores/{fileSearchStore}/documents/{document}`.

  {% hr /%}

  **fileSearchStore**: {% mark %}required{% /mark %} `string`

  The file search store ID. Forms the resource name `fileSearchStores/{fileSearchStore}`.

  {% hr /%}

  **force**: `boolean`

  Optional. If set to true, any `Chunk`s and objects related to this [`Document`](/api-reference/file-search/documents#Resource:Document) will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if [`Document`](/api-reference/file-search/documents#Resource:Document) contains any `Chunk`s.

  {% /section %}

  {% /left-column %}

  {% right-column class="sticky" %}
  **Example request** {% class="example-heading" %}

  {% tabs %}
  {% tab label="REST" %}
  ```sh
  curl -X DELETE "https://generativelanguage.googleapis.com/v1beta/fileSearchStores/$FILE_SEARCH_STORE_ID/documents/$DOCUMENT_ID" \
    -H "x-goog-api-key: $GEMINI_API_KEY"
  ```

  {% /tab %}

  {% /tabs %}

  {% /right-column %}

{% /two-column-layout %}

## Response  {% class="hide-from-toc" id="response" %}

{% section class="api-ref-property-list" /%}

