Skip to main content
POST
Merge sessions
Merging is irreversible. Sources are permanently closed and cannot be reopened or replied to. Continue the merged work through the primary session’s channel and recipients, including when contacts differ.
Requires merge-sessions:write. The organization’s ticketing system must be open or zendesk_v2. API callers execute directly; there is no acknowledgment field. Choose closed_resolved or closed_unresolved for each source. Every source receives closed_by_merge and becomes a subsession of the primary. The primary retains its status, assignee, contact, channel, fields, and tags. Internal merge entries link the original histories; messages are not interleaved chronologically.
Use a fresh idempotencyKey for each merge. If a request times out or its response is lost, retry with the same primary, sources, closure choices, and key. A key reused for a different operation is rejected. Eligibility failures close none of the selected sources. Closure workflows are dispatched only by the request that newly completes the merge. A retry returns the saved merge without dispatching them again. If dispatch is interrupted after the merge is saved, retrying does not recover missed workflows. All sessions must belong to the same organization. Self-merges, repeated sources, circular hierarchies, previously merged sources, AI-owned sessions, and active calls are rejected. A primary that has received sources may later be merged into another primary. Messages addressed to a specific source, such as replies to its original email thread, stay there and mirror internally into the final primary without reopening either session. Native WhatsApp, Messenger, Instagram, and SMS keep normal routing to an open session or a new session; incoming messages are not redirected by the merge. Redaction preserves merge links while hiding sensitive content. See Merge sessions for dashboard warnings, history viewing, and reporting behavior.
Finish pending replies and avoid simultaneous status changes to the selected sessions before merging. An in-flight reply or status change may still complete after the merge. Concurrent merges and new parent links are serialized within the organization; if another merge makes a selected session ineligible, the waiting merge is rejected.
For Zendesk organizations, the response does not wait for Zendesk. OpenCX attempts to set every linked source ticket to Closed, regardless of its OpenCX closure status, and add private merge notes in the background without retries or field filling. A source that shares the primary’s Zendesk ticket closes only in OpenCX; the shared ticket receives private notes without a status change. Missing or permanently closed tickets do not block merging. Zendesk tickets remain separate, and later Zendesk reopens cannot reopen an OpenCX merged source. Replies received on the original source ticket are preserved and mirrored internally. Replies to a Closed Zendesk ticket create a new follow-up ticket that does not automatically inherit the merge relationship. See Zendesk merge behavior.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

session_id
string<uuid>
required
Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$

Body

application/json
sources
object[]
required
Minimum array length: 1
idempotencyKey
string<uuid>
Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$

Response

Default Response

mergeId
string<uuid>
required
Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
primarySessionId
string<uuid>
required
Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
sources
object[]
required