---
title: "POST /backfill-contact-analysis-data"
method: POST
path: "/backfill-contact-analysis-data"
---

# POST /backfill-contact-analysis-data

`POST /backfill-contact-analysis-data`

## Request

- Base URL: `https://api.retellai.com`
- URL: `https://api.retellai.com/backfill-contact-analysis-data`
- Auth: HTTP bearer

Trigger a backfill job that re-applies analysis data mappings to contacts using historical call and SMS chat data. Only one backfill job can run per organization at a time. Select contact_memory to rewrite memory from matching ended phone calls and SMS chats in chronological order, one conversation at a time, with no conversation-count cap. Backfill starts with the contact's existing memory. Each rewrite builds on the previous result, and the final successful result is saved once per contact. When mapped analysis fields and contact_memory are selected together, they are saved together in one contact update. Memory rewrites use the currently stored contact fields.

## Request body

- object
  - `backfill_call_filter` object: Optional filter to scope which conversations are processed. Supports agent and start_timestamp from the standard call filter. The same filter applies to phone calls and SMS chats for both analysis data mappings and contact_memory.
    - `agent` AgentFilter[]: Filter conversations by agent. Agents are OR-connected.
      - `agent_id` string, required: The agent ID to filter on.
      - `version` number[]: Specific versions to filter on. If omitted or empty, all versions are included.
    - `start_timestamp` union: Filter conversations by start timestamp (epoch ms).
      - NumberFilter
        - `type` 'number', required
        - `op` 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le', required: eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less than, le: less than or equal
        - `value` number, required
      - RangeFilter
        - `type` 'range', required
        - `op` 'bt', required: bt: between
        - `value` number[], required: [lower_bound, upper_bound]
  - `backfill_attributes` string[], required: Contact fields to recompute. Each one must still exist as a contact field and have an analysis data mapping configured, except for the built-in contact_memory attribute, which requires no mapping and supports requests on its own or alongside mapped fields. Memory backfill skips conversations without retained transcripts.

## Response `201`

Backfill job started.

- JobStatus
  - `status` 'queued' | 'running' | 'idle', required
  - `start_timestamp` number: Epoch milliseconds when the job started.
  - `succeeded` number: Number of items processed successfully so far.
  - `failed` number: Number of items that errored so far.
  - `triggered_by` 'manual' | 'cron': Whether the job was started by an explicit API call (`manual`) or by the scheduled sync (`cron`).

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `429`: Too Many Requests
- `500`: Internal Server Error

## Changes

- **2026-10-16** `ca41f0dbb297`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/retellai/apis/retell-sdk/changes/backfill-contact-analysis-data/post.md)

---

[API](https://skmtc.dev/retellai/apis/retell-sdk.md) - [All operations](https://skmtc.dev/retellai/apis/retell-sdk/llms.txt) - [OpenAPI document](https://skmtc.dev/retellai/apis/retell-sdk/revisions/e482acaa292c?raw)
