Skip to content

Merge one or more duplicate tickets into this one

POST
/tickets/{id}/merge
Code sample: Shell / cURL
curl --request POST \
--url https://example.com/api/v1/tickets/example/merge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "sourceTicketIds": [ "example" ] }'

Folds each ticket in sourceTicketIds into {id} (the target): moves the source’s conversation and scheduled replies onto the target, closes the source and takes it out of the ticket lists, links it to the target, and leaves an internal note on both. Repeating the call for a source already merged into the same target folds in anything not yet moved. {id} and every source must fall inside the caller’s ticket scope or the whole request 404s before anything merges. The batch is never all-or-nothing: each source is attempted independently, so merged lists the ids that folded in and failed lists the rest with why. Requires the tickets.manage permission.

id
required

Resource identifier (CUID2).

string
>= 1 characters

Resource identifier (CUID2).

Media typeapplication/json
object
sourceTicketIds
required

Duplicate tickets to merge into {id}, 1 to 20.

Array<string>
>= 1 items <= 20 items

Example generated

{
"sourceTicketIds": [
"example"
]
}

Which source tickets merged and why the others did not.

Media typeapplication/json
object
data
required

Outcome of merging several tickets into one.

object
failed
required

Source ticket ids that could not merge, with why.

Array<object>
object
id
required
string
reason
required
string
merged
required

Source ticket ids that merged successfully.

Array<string>
targetTicketId
required
string

Example generated

{
"data": {
"failed": [
{
"id": "example",
"reason": "example"
}
],
"merged": [
"example"
],
"targetTicketId": "example"
}
}

Validation error. Parse failures include field paths and expectations.

Media typeapplication/json

Validation error with safe field paths and expected values; submitted values are never returned.

object
error
required
object
code
required

Stable machine-readable error code.

string
issues
Array<object>
object
expected
required
string
message
required
string
path
required
Array<string | number>
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Not found.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.