Skip to main content

Merge Agent Ticket

POST 

/api/support/agent/tickets/:ticket/merge

Folds this ticket (the source) into another ticket (the target) and returns the target. Everything moves to the target and the source is closed:

  • every message (public replies, internal notes, system messages) and every attachment is moved to the target
  • the source's participants join the target: a user who was the source's requester becomes a watcher on the target, other users keep their role, email-only CCs are copied; anyone who already is the target's requester or a participant is skipped. The source keeps only its requester.
  • the source's links are moved to the target, and a ticket link labelled "Merged #<source>" pointing at the source is added to the target
  • the target's last_customer_message_at / last_agent_message_at become the later of the two tickets'
  • the source gets merged_into_ticket_id (and merged_into) set, any snooze cleared, and its status changed to closed (a status_changed event with reason merged, plus resolved_at / closed_at)
  • a merged event is recorded on both timelines
Required scope: support:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Neither ticket may already have been merged away, and a ticket cannot be merged into itself — those are rejected with 422. Merging is not reversible.

Path parameters

  • ticket (integer) — the source ticket id (the one that closes).

Request body

  • into_ticket_id (integer, required) — the target ticket id; must exist.

Responsedata is the full agent view of the target ticket after the merge:

  • id (integer), number (string, e.g. #2451), tenant_id (string, nullable), subject (string)
  • type (string, nullable) — one of: bug, question, feature_request, billing; type_label (string, nullable)
  • status (string) — one of: open, in_progress, waiting_on_customer, awaiting_release, resolved, closed; status_label (string) — the agent-facing label
  • priority (string) — one of: low, medium, high, urgent
  • source (string) — one of: app, email, api, assistant, agent, import
  • visibility (string) — tenant or requester
  • requester ({id, name, email}; id is null when the requester is not a user) and assignee ({id, name, email}, nullable)
  • context (object, nullable) — what the app captured when the ticket was raised; tags[] (array of strings)
  • slafirst_response_due_at, resolution_due_at, first_responded_at, resolved_at, closed_at (ISO-8601, each nullable)
  • first_response_sla_status / resolution_sla_status (string) — one of: on_track, breaching_soon (past the policy's warning fraction of the target), breached, paused (the ticket is waiting on the customer), met
  • merged_into ({id, number}, nullable) — set once this ticket was merged into another
  • public_messages_count (integer), note_count (integer) — customer-visible messages and internal notes
  • last_customer_message_at, last_agent_message_at (ISO-8601, nullable), reopened_count (integer)
  • csat ({score, comment, at}, nullable)
  • participants[] — {id, user_id, name, email, role (requester | cc | watcher), notify}
  • links[] — {id, kind (jira | sentry | deploy | record | ticket | url), ref, url, label, created_at}
  • group_key (string, nullable), external_ref (string, nullable — the id in the previous help desk, e.g. FD-9184), merged_into_ticket_id (integer, nullable), sla_policy_id (integer, nullable), created_by_user_id (integer, nullable)
  • sla_paused_at (ISO-8601, nullable) — set while the resolution clock is paused
  • snoozed_until (ISO-8601, nullable) and is_snoozed (boolean — true while snoozed_until is in the future)
  • follow_up_at (ISO-8601, nullable) — the agent's own reminder, never customer-facing
  • ai[] — the latest completed, non-withheld AI run of each kind: {id, kind (triage | draft), status, model, output, withheld, withheld_reason, accepted, created_at}
  • created_at, updated_at (ISO-8601)

Authentication: Bearer token with the support:write scope, or an authenticated session, from a caller with an active support role that can work tickets (the viewer role is read-only). No tenant context — this endpoint is central.

Request

Responses

OK

Response Headers
    Content-Type