---
title: "Bulk upsert corpus entries"
method: POST
path: "/tenants/{slug}/corpus/bulk"
tags: ["corpus"]
---

# Bulk upsert corpus entries

`POST /tenants/{slug}/corpus/bulk`

## Request

- Base URL: `https://api.animam.ai`
- URL: `https://api.animam.ai/tenants/{slug}/corpus/bulk`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`
  - OAuth 2 (authorization code, authorization URL `https://api.animam.ai/oauth/authorize`, token URL `https://api.animam.ai/oauth/token`, scopes: `corpus:write`)

Up to 50 entries per call. Each entry must include `externalId` for idempotent upsert. Used by the WordPress plugin full-resync flow.

## Path parameters

- `slug` string, required: Tenant slug (URL-safe identifier).

## Request body

- BulkCorpusBody
  - `entries` CreateCorpusBody[], required: Up to 50 entries per call. Idempotent on externalId.
    - `title` string, required
    - `content` string, required: Full body of the entry.
    - `summary` string: Short summary surfaced in prompt; full content fetched on-demand via EXPLORE_CORPUS.
    - `segmentSlug` string
    - `priority` integer
    - `isActive` boolean
    - `externalId` string: Idempotency key from caller (e.g. wp-post-42). Upserts on conflict.
    - `source` string
    - `sourceUrl` string, uri
    - `locale` string: 2-letter ISO language code of the entry (en, fr, es, …). Used to scope retrieval per visitor locale on multilingual sites.

## Response `200`

Bulk operation summary.

- object
  - `created` integer, required
  - `updated` integer, required
  - `skipped` integer, required
  - `errors` object[], required
    - `externalId` string, required
    - `reason` string, required

---

[API](https://skmtc.dev/animam/apis/animam-api.md) · [All operations](https://skmtc.dev/animam/apis/animam-api/llms.txt) · [OpenAPI document](https://skmtc.dev/animam/apis/animam-api/revisions/138c3cf374f1?raw)
