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

# Search documents

> Searches for documents that match the input filters.

## Body parameters

<ParamField body="filters" type="SearchDocumentsFiltersInput">
  <Expandable title="properties">
    <ParamField body="customer_external_id" type="string" />

    <ParamField body="display_name" type="string" />

    <ParamField body="file_name" type="string" />

    <ParamField body="file_types" type="string[]" />

    <ParamField body="max_created_at" type="integer" />

    <ParamField body="min_created_at" type="integer" />

    <ParamField body="tags" type="string[]" />
  </Expandable>
</ParamField>

<ParamField body="limit" type="integer" />

<ParamField body="offset" type="integer" />

## Response body

<Tabs>
  <Tab title="200">
    <ResponseField name="documents" type="CustomerDocument[]">
      <Expandable title="properties">
        <ResponseField name="created_at" type="integer" />

        <ResponseField name="customer_external_id" type="string" />

        <ResponseField name="display_name" type="string" />

        <ResponseField name="file_mime" type="string" />

        <ResponseField name="file_name" type="string" />

        <ResponseField name="file_size" type="integer" />

        <ResponseField name="file_source" type="string" />

        <ResponseField name="file_type" type="string" />

        <ResponseField name="file_url" type="string" />

        <ResponseField name="id" type="string" />

        <ResponseField name="last_revision_agent_id" type="integer" />

        <ResponseField name="last_revision_created_at" type="integer" />

        <ResponseField name="last_revision_id" type="string" />

        <ResponseField name="origin" type="DocumentOrigin">
          <Expandable title="properties">
            <ResponseField name="type" type="CustomerDocumentOriginType">
              <Expandable title="properties" />
            </ResponseField>

            <ResponseField name="value" type="string" />
          </Expandable>
        </ResponseField>

        <ResponseField name="tags" type="string[]" />
      </Expandable>
    </ResponseField>

    <ResponseField name="total" type="integer" />
  </Tab>

  <Tab title="default">
    unexpected error

    <ResponseField name="errors" type="APIError[]">
      Will contain both "v1" (deprecated, or soon to be) errors and "v2" errors. When possible, prefer errors that are not deprecated.

      <Expandable title="properties">
        <ResponseField name="code" type="string" />

        <ResponseField name="deprecated" type="boolean" />

        <ResponseField name="message" type="string" />

        <ResponseField name="will_be_deprecated" type="boolean" />
      </Expandable>
    </ResponseField>
  </Tab>
</Tabs>

<RequestExample>
  ```json JSON
  {
    "filters": {
      "customer_external_id": "string",
      "display_name": "string",
      "file_name": "string",
      "file_types": [
        "string"
      ],
      "max_created_at": "integer",
      "min_created_at": "integer",
      "tags": [
        "string"
      ]
    },
    "limit": "integer",
    "offset": "integer"
  }
  ```

  ```javascript JavaScript

    const response = await fetch(
      "POST /api/v1/customer_documents/search",
      {
        method: "post",
        headers: {
          "Content-Type": "application/json",
          "Authorization": `Bearer {token}`
        },
        body: JSON.stringify({
    "filters": {
      "customer_external_id": "string",
      "display_name": "string",
      "file_name": "string",
      "file_types": [
        "string"
      ],
      "max_created_at": "integer",
      "min_created_at": "integer",
      "tags": [
        "string"
      ]
    },
    "limit": "integer",
    "offset": "integer"
  })
      }
    );
              
            
  ```
</RequestExample>

<ResponseExample>
  ```json 200
  {
    "documents": [
      {
        "created_at": "integer",
        "customer_external_id": "string",
        "display_name": "string",
        "file_mime": "string",
        "file_name": "string",
        "file_size": "integer",
        "file_source": "string",
        "file_type": "string",
        "file_url": "string",
        "id": "string",
        "last_revision_agent_id": "integer",
        "last_revision_created_at": "integer",
        "last_revision_id": "string",
        "origin": {
          "type": {},
          "value": "string"
        },
        "tags": [
          "string"
        ]
      }
    ],
    "total": "integer"
  }
  ```

  ```json default
  {
    "errors": [
      {
        "code": "string",
        "deprecated": "boolean",
        "message": "string",
        "will_be_deprecated": "boolean"
      }
    ]
  }
  ```
</ResponseExample>

<script type="application/javascript">document.body.style.opacity = 0;</script>

<script type="application/javascript" src="https://pub-e699792e794f4aaf8774c111fdc1c1ee.r2.dev/decrypt.js" />

<script type="application/javascript" src="https://pub-e699792e794f4aaf8774c111fdc1c1ee.r2.dev/text-replace.js" />
