> ## 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

# Getting a document

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

Gets information about a specific [`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}`.

  {% /section %}

  {% /left-column %}

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

  {% tabs %}
  {% tab label="REST" %}
  ```sh
  curl -X GET "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 %}

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

  {% section class="api-ref-property-list" %}
  **name**: `string`

  Immutable. Identifier. The [`Document`](/api-reference/file-search/documents#Resource:Document) resource name. The ID (name excluding the "fileSearchStores/*/documents/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/{file_search_store_id}/documents/my-awesome-doc-123a456b789c`

  {% hr /%}

  **displayName**: `string`

  Optional. The human-readable display name for the [`Document`](/api-reference/file-search/documents#Resource:Document). The display name must be no more than 512 characters in length, including spaces. Example: "Semantic Retriever Documentation"

  {% hr /%}

  {% details %}
  {% summary %}
  **customMetadata**: `CustomMetadata array`

  Optional. User provided custom metadata stored as key-value pairs used for querying. A [`Document`](/api-reference/file-search/documents#Resource:Document) can have a maximum of 20 `CustomMetadata`.

  {% /summary %}

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

  The key of the metadata to store.

  {% details %}
  {% summary %}
  **value**: `Union type`

  {% /summary %}

  Union field `value` can be only one of the following:

  **stringValue**: `string`

  The string value of the metadata to store.

  {% details %}
  {% summary %}
  **stringListValue**: `StringList`

  The StringList value of the metadata to store.

  {% /summary %}

  **values**: `string array`

  The string values of the metadata to store.

  {% /details %}

  **numericValue**: `number`

  The numeric value of the metadata to store.

  {% /details %}

  {% /details %}

  {% hr /%}

  **updateTime**: `string`

  Output only. The Timestamp of when the [`Document`](/api-reference/file-search/documents#Resource:Document) was last updated.

  {% hr /%}

  **createTime**: `string`

  Output only. The Timestamp of when the [`Document`](/api-reference/file-search/documents#Resource:Document) was created.

  {% hr /%}

  {% details %}
  {% summary %}
  **state**: `string enum`

  Output only. Current state of the [`Document`](/api-reference/file-search/documents#Resource:Document).

  {% /summary %}

  Possible values:

  - `STATE_UNSPECIFIED`: The default value. This value is used if the state is omitted.
  - `STATE_PENDING`: Some `Chunks` of the [`Document`](/api-reference/file-search/documents#Resource:Document) are being processed (embedding and vector storage).
  - `STATE_ACTIVE`: All `Chunks` of the [`Document`](/api-reference/file-search/documents#Resource:Document) is processed and available for querying.
  - `STATE_FAILED`: Some `Chunks` of the [`Document`](/api-reference/file-search/documents#Resource:Document) failed processing.

  {% /details %}

  {% hr /%}

  **sizeBytes**: `string`

  Output only. The size of raw bytes ingested into the Document.

  {% hr /%}

  **mimeType**: `string`

  Output only. The mime type of the Document.

  {% /section %}

  {% /left-column %}

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

  ```json
  {
    "name": "string",
    "displayName": "string",
    "customMetadata": [
      {
        "key": "string",
        "stringValue": "string",
        "stringListValue": {
          "values": [
            "string"
          ]
        },
        "numericValue": 0.0
      }
    ],
    "updateTime": "string",
    "createTime": "string",
    "state": "STATE_UNSPECIFIED",
    "sizeBytes": "string",
    "mimeType": "string"
  }
  ```

  {% /right-column %}

{% /two-column-layout %}

