---
url: https://docs.app-in.io/operations/indexContentBatch.md
---

# Index content (batch)

`POST https://api.app-in.io/v1/index/{collection}/batch`

Index up to 20 documents in a single request. Returns `202 Accepted` — items are queued as one batch job.

Max 2 concurrent index jobs per site. Use `X-Platform: woocommerce` header for WooCommerce-specific fields.

## OpenAPI operation

```json
{
  "operationId": "indexContentBatch",
  "summary": "Index content (batch)",
  "description": "Index up to 20 documents in a single request. Returns `202 Accepted` — items are queued as one batch job.\n\nMax 2 concurrent index jobs per site. Use `X-Platform: woocommerce` header for WooCommerce-specific fields.",
  "tags": [
    "Indexing"
  ],
  "parameters": [
    {
      "name": "collection",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "enum": [
          "products",
          "pages",
          "docs"
        ]
      }
    },
    {
      "name": "X-Platform",
      "in": "header",
      "required": false,
      "schema": {
        "type": "string",
        "enum": [
          "product",
          "page",
          "doc",
          "woocommerce"
        ]
      },
      "description": "Platform type. Applies to all items in the batch."
    },
    {
      "name": "X-Site-Language",
      "in": "header",
      "required": false,
      "schema": {
        "type": "string",
        "example": "nl"
      },
      "description": "Optional. The store's default language as an ISO 639-1 code (2-3 letters, optional region, max 5 characters). The API stores it as the site's default language only when none is set. The API never overwrites a value an admin set. An invalid value is ignored."
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/IndexBatchRequest"
        },
        "examples": {
          "products": {
            "summary": "Batch index products",
            "value": {
              "items": [
                {
                  "id": "prod_001",
                  "url": "/products/red-shoes",
                  "title": "Red Running Shoes",
                  "content": "Comfortable lightweight running shoes.",
                  "price": 99.99,
                  "in_stock": true,
                  "category": "footwear"
                },
                {
                  "id": "prod_002",
                  "url": "/products/blue-hat",
                  "title": "Blue Baseball Hat",
                  "content": "Classic cotton baseball hat.",
                  "price": 24.99,
                  "in_stock": true,
                  "category": "accessories"
                }
              ]
            }
          }
        }
      }
    }
  },
  "responses": {
    "202": {
      "description": "Batch queued for indexing",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "example": "queued"
              },
              "count": {
                "type": "integer",
                "example": 2
              },
              "collection": {
                "type": "string",
                "example": "products"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "description": "Collection not allowed, or the site is paused (the site is beyond the number of sites the plan allows — nothing is deleted, raising the plan unpauses it)"
    },
    "422": {
      "$ref": "#/components/responses/ValidationError"
    },
    "429": {
      "$ref": "#/components/responses/RateLimited"
    }
  }
}
```

## Referenced components

```json
{
  "#/components/schemas/IndexBatchRequest": {
    "type": "object",
    "required": [
      "items"
    ],
    "properties": {
      "items": {
        "type": "array",
        "minItems": 1,
        "maxItems": 20,
        "description": "Array of documents to index. Each item follows the same schema as the single index endpoint.",
        "items": {
          "type": "object",
          "required": [
            "id",
            "url",
            "title",
            "content"
          ],
          "properties": {
            "id": {
              "type": "string"
            },
            "url": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "content": {
              "type": "string"
            }
          },
          "additionalProperties": true
        }
      }
    }
  },
  "#/components/responses/Unauthorized": {
    "description": "Missing or invalid API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ErrorResponse"
        },
        "example": {
          "error": "Invalid API key."
        }
      }
    }
  },
  "#/components/schemas/ErrorResponse": {
    "type": "object",
    "description": "Error body for authentication (401), authorization (403), and service (502) errors.",
    "properties": {
      "error": {
        "type": "string",
        "description": "Human-readable error message"
      }
    }
  },
  "#/components/responses/ValidationError": {
    "description": "Validation error",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ValidationErrorResponse"
        },
        "example": {
          "message": "The query field is required.",
          "errors": {
            "query": [
              "The query field is required."
            ]
          }
        }
      }
    }
  },
  "#/components/schemas/ValidationErrorResponse": {
    "type": "object",
    "description": "Validation error body (422).",
    "properties": {
      "message": {
        "type": "string"
      },
      "errors": {
        "type": "object",
        "description": "Map of field name to an array of error messages"
      }
    }
  },
  "#/components/responses/RateLimited": {
    "description": "Rate limit exceeded",
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "message": {
              "type": "string"
            }
          }
        },
        "example": {
          "message": "Too many requests. Please try again later."
        }
      }
    }
  }
}
```

Full specification: https://docs.app-in.io/openapi.json
