Skip to main content

Import a historical conversation

Import one historical conversation and its prepared transcript:
Use a tenant API key with cxm:conversations.write or a broader scope. Import stores a new conversation and all supplied messages together, then waits for the search-indexing attempt before responding. It does not send messages, start an Assistant, route work or notify agents during import. For new customer intake, use Create a conversation.

Prepare the dataset

  1. Transform source records into the fields below. Remove unsupported records, attachments and metadata, and convert voice content into plain-text transcripts.
  2. Create contacts and, if needed, create organizations. Save their returned IDs.
  3. Import each conversation with an existing contact ID, or anonymous when you intentionally do not associate a named contact. An optional organization must also already exist in the tenant.
  4. Save each returned conversation ID and any warnings. Keep a source-to-CXP ID mapping to investigate partial runs and uncertain outcomes.
Imports create records only. They cannot append to, merge with or replace an existing conversation. Each request is limited to 1 MiB and 1,000 messages; prune oversized transcripts before sending them. There is no continuation upload.

Send a conversation

contact accepts only contactId; organization accepts only organizationId. Import never updates either record. When you omit organization, the new conversation inherits the contact’s current organization, or no organization for anonymous.

Set conversation fields

All timestamps must be valid RFC 3339 strings with an explicit timezone and cannot be in the future. Message and lifecycle times cannot precede conversation creation. CXP retains millisecond precision in UTC. It does not invent missing lifecycle events or require a universal order between resolved and closed times, which can represent different close/reopen cycles. For example, external:123 is stored and returned as external123. Use the returned ID for subsequent requests and your source-to-CXP mapping. IDs that differ only by colons identify the same conversation and return the ordinary ConversationIdConflict error if it already exists. :, :. and CX:1 are invalid because their normalized values are empty, path-unsafe or reserved. This normalization applies only to imported conversation IDs; contact and organization IDs are unchanged. Agent Assist child conversations require native CX parent IDs. Omit id if that later capability is needed.

Map messages

Supported channel values are chat, voice, email, sms, web_chat, phone_call, web_audio, social, whatsapp, in_app, api and unknown. The voice media default applies to voice, phone_call and web_audio. Every array entry is retained, including identical messages. Stored history orders messages by time, preserving input order when times match. Search can order equal-time messages differently. Message IDs are generated by CXP; source message IDs, arbitrary metadata, attachments, recordings and provider threads are not accepted. Voice messages are transcripts without call playback.

Read the result and warnings

A successful import returns 201 Created:
The response waits for the indexing attempt. If storage succeeds but indexing fails, the conversation remains created and the response is still 201, with:
IndexingConflict also means creation succeeded, but an existing search projection prevented this indexing attempt. Record either warning and ask your CXP administrator or support contact to repair indexing. Search and public conversation-detail reads can remain missing or stale until repair. Do not retry the entire import solely to repair indexing. Authentication, rate limits and retry conventions are in the API overview. There is no idempotency or replay guarantee. A duplicate-ID error does not prove an earlier payload matched; a retry without a preserved ID can create another conversation.

Review imported history

The full supplied transcript and author metadata are stored. Search normally includes the most recent 500 messages and omits some author/media fields. Public history applies redaction and size limits, including 64 KiB per string and 256 KiB per record/source value, so it is not a lossless export verifier. Customer chat can display the current contact name instead of a historical author-name snapshot. Imported records follow ordinary authorization, retention and deletion rules. Later activity can reuse Open, Pending or Resolved conversations and trigger normal processing. Closed conversations can be explicitly reopened. Historical channel labels do not create provider delivery connections.