---
title: "Merge Tickets into Target Ticket"
method: POST
path: "/api/v2/tickets/{ticket_id}/merge"
tags: ["Tickets"]
---

# Merge Tickets into Target Ticket

`POST /api/v2/tickets/{ticket_id}/merge`

Merges one or more tickets into the ticket with the specified id.

See [Merging tickets](https://support.zendesk.com/hc/en-us/articles/203690916)
in the Support Help Center for ticket merging rules.

Any attachment to the source ticket is copied to the target ticket.

This endpoint returns a `job_status` [JSON object](/api-reference/ticketing/ticket-management/job_statuses/#json-format) and queues a background job to do the work. Use the [Show Job Status](/api-reference/ticketing/ticket-management/job_statuses/#show-job-status) endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See [Job limit](/api-reference/introduction/rate-limits/#job-limit) for more information.

#### Allowed For

* Agents

Agents in the Enterprise account must have merge permissions.
See [Creating custom roles and assigning agents (Enterprise)](https://support.zendesk.com/hc/en-us/articles/203662026)
in the Support Help Center.

#### Available parameters

The request takes a data object with the following properties:

| Name                     | Type    | Required | Comments                                                |
| ------------------------ | ------- | -------- | ------------------------------------------------------- |
| ids                      | array   | yes      | Ids of tickets to merge into the target ticket          |
| target_comment           | string  | no       | Private comment to add to the target ticket. This comment is optional but strongly recommended |
| source_comment           | string  | no       | Private comment to add to the source ticket. This comment is optional but strongly recommended |
| target_comment_is_public | boolean | no       | Whether comments in the target ticket are public or private   |
| source_comment_is_public | boolean | no       | Whether comments in the source tickets are public or private |

`target_comment` and `source_comment` can be used to provide a reason for the merge for recordkeeping purposes. If the source ticket has attachments, they are included in `target_comment`.

Comments are private and can't be modified in the following cases:

  * Any of the sources or target tickets are private
  * Any of the sources or target tickets were created through X (formerly Twitter), Facebook or the Channel framework

In any other case, comments default to private but can be modified with the comment privacy parameters.

## Path parameters

- `ticket_id` integer, required

## Request body

- TicketMergeInput
  - `ids` integer[], required — Ids of tickets to merge into the target ticket
  - `source_comment` string — Private comment to add to the source ticket
  - `source_comment_is_public` boolean — Whether comment in source tickets are public or private
  - `target_comment` string — Private comment to add to the target ticket
  - `target_comment_is_public` boolean — Whether comment in target ticket is public or private

## Response `200`

Successful response

- JobStatusResponse
  - `job_status` JobStatusObject
    - `id` string — Automatically assigned when the job is queued
    - `job_type` string — The type of the job
    - `message` string, nullable — Message from the job worker, if any
    - `progress` integer, nullable — Number of tasks that have already been completed
    - `results` union — Result data from processed tasks. See [Results](#results) below
      - JobStatusResultObject[], nullable
        - union
          - object
            - `id` integer, required — the id of the new resource
            - `index` integer, required — the index number of the resul
          - object
            - `action` string, required — the action the job attempted (`"action": "update"`)
            - `id` integer, required — the id of the resource the job attempted to update
            - `status` string, required — the status (`"status": "Updated"`)
            - `success` boolean, required — whether the action was successful or not (`"success": true`)
          - object
            - `action` string, required — The action the job attempted (`"action": "update"`)
            - `details` string, required — The details of the error
            - `error` string, required — The error message
            - `id` integer, required — The id of the resource the job attempted to update
            - `success` boolean, required — Whether the action was successful or not (`"success": true`)
      - object
        - `success` boolean, required — Whether the action was successful or not
    - `status` string — The current status. One of the following: "queued", "working", "failed", "completed"
    - `total` integer, nullable — The total number of tasks this job is batching through
    - `url` string — The URL to poll for status updates

---

[API](https://skmtc.dev/botbrains-io/apis/support-api.md) · [All operations](https://skmtc.dev/botbrains-io/apis/support-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/botbrains-io/support-api/revisions/d53eac07ba68/schema)
