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

# Download document

> Download a document by its ID.

This endpoint allows downloading a document’s content using its unique identifier. The response will be the actual file content with appropriate content type headers.


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

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

  response = requests.get(
      "https://customerName.ambersearch.de/api/beta/document/{document_id}/download",
      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}/download", {
          headers: {
              Authorization: "Bearer ambrs-exampletoken",
          }
      })
      .then((res) => console.log(res.data));
  ```
</RequestExample>


## OpenAPI

````yaml get /api/beta/document/{document_id}/download
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}/download:
    get:
      tags:
        - Public REST API
      summary: Download Document
      description: >-
        Download a document by its ID.


        This endpoint allows downloading a document's content using its unique
        identifier.

        The response will be the actual file content with appropriate content
        type headers.


        ## Returns


        A FileResponse object containing:

        - The document's content as a downloadable file

        - Appropriate content type headers

        - File name and other metadata


        ## Raises


        - **HTTPException**: If the document is not found or if the user is not
        authenticated
      operationId: Download Document
      parameters:
        - name: document_id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            description: The unique identifier of the document to download
            examples:
              - doc_123456
            title: Document Id
          description: The unique identifier of the document to download
      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

````