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

# Pushing Content

> Push custom documents into a Cludo search index using the Index Management API, including payload structure, batching, updates, and deletions.

Push custom content to your search index when you need to index content that isn't available via web crawling, such as database records, CMS content, or internal documents.

## v4 Index Management (recommended)

**Auth:** Basic (API Key)

The request body for document operations is a **plain JSON array** of document objects.

### Create or replace documents

Upsert documents. If a document with the same ID exists, it's replaced.

Each document may optionally include a top-level `type` (`"PageContent"` or `"FileContent"`) as a sibling of `id` and `fields` — not inside `fields`. It defaults to `"PageContent"`; use `"FileContent"` for files such as PDFs or DOCX so they are treated as file results in the index.

<CodeGroup>
  ```bash EU theme={null}
  curl -X PUT "https://api.cludo.com/api/v4/{customerId}/index/{crawlerId}/documents" \
    -H "Authorization: Basic {base64(customerId:apiKey)}" \
    -H "Content-Type: application/json" \
    -d '[
      {
        "id": "product-123",
        "type": "PageContent",
        "fields": {
          "Title": "Widget Pro",
          "Description": "Our most popular widget...",
          "Url": "https://example.com/products/widget-pro",
          "Category": "Products",
          "Price": "99.00"
        }
      },
      {
        "id": "product-456",
        "type": "FileContent",
        "fields": {
          "Title": "Widget Basic",
          "Description": "Great for getting started...",
          "Url": "https://example.com/products/widget-basic",
          "Category": "Products",
          "Price": "49.00"
        }
      }
    ]'
  ```

  ```bash US theme={null}
  curl -X PUT "https://api-us1.cludo.com/api/v4/{customerId}/index/{crawlerId}/documents" \
    -H "Authorization: Basic {base64(customerId:apiKey)}" \
    -H "Content-Type: application/json" \
    -d '[
      {
        "id": "product-123",
        "type": "PageContent",
        "fields": {
          "Title": "Widget Pro",
          "Description": "Our most popular widget...",
          "Url": "https://example.com/products/widget-pro",
          "Category": "Products",
          "Price": "99.00"
        }
      },
      {
        "id": "product-456",
        "type": "FileContent",
        "fields": {
          "Title": "Widget Basic",
          "Description": "Great for getting started...",
          "Url": "https://example.com/products/widget-basic",
          "Category": "Products",
          "Price": "49.00"
        }
      }
    ]'
  ```
</CodeGroup>

### Partial update

Update specific fields without replacing the entire document. The optional top-level `type` works the same way here as on replace — omit it to keep the existing kind, or send `"PageContent"` / `"FileContent"` to set it.

<CodeGroup>
  ```bash EU theme={null}
  curl -X PATCH "https://api.cludo.com/api/v4/{customerId}/index/{crawlerId}/documents" \
    -H "Authorization: Basic {base64(customerId:apiKey)}" \
    -H "Content-Type: application/json" \
    -d '[
      {
        "id": "product-123",
        "fields": {
          "Price": "89.00"
        }
      }
    ]'
  ```

  ```bash US theme={null}
  curl -X PATCH "https://api-us1.cludo.com/api/v4/{customerId}/index/{crawlerId}/documents" \
    -H "Authorization: Basic {base64(customerId:apiKey)}" \
    -H "Content-Type: application/json" \
    -d '[
      {
        "id": "product-123",
        "fields": {
          "Price": "89.00"
        }
      }
    ]'
  ```
</CodeGroup>

### Delete documents

<CodeGroup>
  ```bash EU theme={null}
  # Single document
  curl -X DELETE "https://api.cludo.com/api/v4/{customerId}/index/{crawlerId}/documents?documentId=product-123" \
    -H "Authorization: Basic {base64(customerId:apiKey)}"

  # Bulk delete by filter (filters are ANDed together)
  curl -X POST "https://api.cludo.com/api/v4/{customerId}/index/{crawlerId}/documents/bulk-delete" \
    -H "Authorization: Basic {base64(customerId:apiKey)}" \
    -H "Content-Type: application/json" \
    -d '{
      "Category": { "operator": "Eq", "values": ["Discontinued"] },
      "Date_date": { "operator": "Lt", "values": ["2024/01/01"] }
    }'
  ```

  ```bash US theme={null}
  # Single document
  curl -X DELETE "https://api-us1.cludo.com/api/v4/{customerId}/index/{crawlerId}/documents?documentId=product-123" \
    -H "Authorization: Basic {base64(customerId:apiKey)}"

  # Bulk delete by filter (filters are ANDed together)
  curl -X POST "https://api-us1.cludo.com/api/v4/{customerId}/index/{crawlerId}/documents/bulk-delete" \
    -H "Authorization: Basic {base64(customerId:apiKey)}" \
    -H "Content-Type: application/json" \
    -d '{
      "Category": { "operator": "Eq", "values": ["Discontinued"] },
      "Date_date": { "operator": "Lt", "values": ["2024/01/01"] }
    }'
  ```
</CodeGroup>

***

## Queue URLs for ccrawling

Instead of pushing document fields directly, you can queue URLs for the crawler to fetch:

<CodeGroup>
  ```bash EU theme={null}
  curl -X POST "https://api.cludo.com/api/v4/{customerId}/crawler/{crawlerId}/paths" \
    -H "Authorization: Basic {base64(customerId:apiKey)}" \
    -H "Content-Type: application/json" \
    -d '[
      "https://example.com/new-page",
      "https://example.com/updated-page"
    ]'
  ```

  ```bash US theme={null}
  curl -X POST "https://api-us1.cludo.com/api/v4/{customerId}/crawler/{crawlerId}/paths" \
    -H "Authorization: Basic {base64(customerId:apiKey)}" \
    -H "Content-Type: application/json" \
    -d '[
      "https://example.com/new-page",
      "https://example.com/updated-page"
    ]'
  ```
</CodeGroup>
