> ## Documentation Index
> Fetch the complete documentation index at: https://developers.ambersearch.de/llms.txt
> Use this file to discover all available pages before exploring further.

# Get document metadata

> Retrieve metadata for a specific document.

This endpoint returns the metadata for a document identified by its ID. Optionally, it can include the document’s text content.


<RequestExample>
  ```bash cURL theme={null}
  curl "https://customerName.ambersearch.de/api/beta/document/{document_id}/metadata" \
  -H "Authorization: Bearer ambrs-exampletoken"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://customerName.ambersearch.de/api/beta/document/{document_id}/metadata",
      headers = {
          "Authorization": "Bearer ambrs-exampletoken"
      }
  )
  print(response.json())
  ```

  ```javascript Javascript theme={null}
  const axios = require("axios");

  axios
      .get("https://customerName.ambersearch.de/api/beta/document/{document_id}/metadata", {
          headers: {
              Authorization: "Bearer ambrs-exampletoken",
          }
      })
      .then((res) => console.log(res.data));
  ```
</RequestExample>


## OpenAPI

````yaml get /api/beta/document/{document_id}/metadata
openapi: 3.1.0
info:
  title: amber
  version: v0.1.46
servers:
  - url: https://{customerDomain}.ambersearch.de
    variables:
      customerDomain:
        default: customerDomain
security: []
paths:
  /api/beta/document/{document_id}/metadata:
    get:
      tags:
        - Public REST API
      summary: Get Document Metadata
      description: >-
        Retrieve metadata for a specific document.


        This endpoint returns the metadata for a document identified by its ID.
        Optionally,

        it can include the document's text content.


        ## Returns


        A dictionary containing the document's metadata with the following
        structure:


        ```json

        {
            "id": "string",
            "title": "string",
            "path": "string",
            "path_preview": "string",
            "parent_path": "string",
            "data_source": "string",
            "data_source_sub": "string",
            "data_source_sub_sub": "string",
            "file_type": "string",
            "document_type": "string",
            "last_modified": "string",
            "file_size": "integer",
            "author": "string",
            "highlights": "array",
            "summary": "string",
            "suffix": "string",
            "similar_docs": "array",
            "duplicates": "array",
            "same_thread_docs": "array",
            "text": "string"  // Only included if provide_text_attribute is true
        }

        ```


        ## Raises


        - **HTTPException**: If the document is not found or if the user is not
        authenticated
      operationId: Get Document Metadata
      parameters:
        - name: document_id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            description: The unique identifier of the document
            examples:
              - doc_123456
            title: Document Id
          description: The unique identifier of the document
        - name: provide_text_attribute
          in: query
          required: false
          schema:
            type: boolean
            description: Whether to include the document's text content in the response
            examples:
              - false
            default: false
            title: Provide Text Attribute
          description: Whether to include the document's text content in the response
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Bearer: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````