---
title: "Merge topics"
method: POST
path: "/topics/merge"
tags: ["Topics"]
---

# Merge topics

`POST /topics/merge`

## Request

- Base URL: `https://api.modem.dev/v1`
- URL: `https://api.modem.dev/v1/topics/merge`
- Auth: HTTP bearer

Not supported yet: the call changes nothing and returns 501 NOT_IMPLEMENTED, or 404 with data.reason archived_in_v1_to_v2_migration when an ID names a topic archived in the v1 to v2 migration. Merging will return with a v2 topic merge. To retire a duplicate topic, archive it with POST /topics/{topicId}/archive.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `sourceTopicIds` union[], required: IDs of topics to merge into the target. Must not include the target topic ID.
    - union
      - string, uuid
      - string, uuid
  - `targetTopicId` union, required: ID of the topic to merge into. Must not be in the sourceTopicIds array.
    - string, uuid
    - string, uuid

## Response `200`

OK

- object
  - `mergedCount` number, required: Number of topics that were merged into the target.
  - `targetTopicId` union, required: ID of the topic that received the merged content.
    - string, uuid
    - string, uuid

## Other responses

- `400`: Invalid request (validation failed).
- `401`: Missing or invalid API key.
- `403`: The API key does not have access to this resource.
- `404`: The requested resource was not found.
- `409`: The request conflicts with an existing resource or idempotency operation.
- `429`: Rate limit exceeded.
- `500`: Internal server error.

---

[API](https://skmtc.dev/modem/apis/modem-api.md) · [All operations](https://skmtc.dev/modem/apis/modem-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modem/apis/modem-api/revisions/f889038a1048?raw)
