---
title: "Merge multiple tickets into one"
url: https://docs.gleap.ai/en/reference/rest-api/merge-tickets
method: PUT
path: "/tickets/merge"
api: "API Reference"
tag: "Ticket"
operationId: "MergeTickets"
updatedAt: "2026-11-01T18:40:15.677Z"
language: en
---

# Merge multiple tickets into one

`PUT https://api.gleap.io/v3/tickets/merge`

Merges `ticketsToMergeIds` into a target ticket and returns the resulting main ticket. `targetTicketId` is required unless `shouldCreateNewTicket` is `true`, in which case a fresh main ticket is created (and an existing target ticket, if given, is archived too). Merged tickets are archived and linked to the main ticket. `shouldMergeTasks` re-parents linked sub-tickets; `shouldMergeContacts` merges the contacts of the merged tickets.

## Authorization

- `Authorization` (header, required): `Bearer <token>`

## Headers

- `project` (string, required)

## Request body (`application/json`, required)

- `shouldMergeContacts` (boolean, required)
- `shouldMergeTasks` (boolean, required)
- `shouldCreateNewTicket` (boolean, required)
- `ticketsToMergeIds` (string[], required)
- `targetTicketId` (string)

## Example request

```bash
curl --request PUT \
  --url https://api.gleap.io/v3/tickets/merge \
  --header 'Authorization: Bearer <token>' \
  --header 'project: <project>' \
  --header 'Content-Type: application/json' \
  --data '{
  "shouldMergeContacts": true,
  "shouldMergeTasks": true,
  "shouldCreateNewTicket": true,
  "ticketsToMergeIds": [
    "<ticketsToMergeIds>"
  ]
}'
```

## Responses

### 200 (`application/json`)

Ok
