---
title: "Merge client"
method: POST
path: "/api/v1/clients/{id}/{mergeable_client_hashed_id}/merge"
tags: ["clients"]
---

# Merge client

`POST /api/v1/clients/{id}/{mergeable_client_hashed_id}/merge`

## Request

- Base URL: `https://demo.invoiceninja.com`
- URL: `https://demo.invoiceninja.com/api/v1/clients/{id}/{mergeable_client_hashed_id}/merge`
- Auth: none declared. Required headers: `X-API-TOKEN`, `X-Requested-With`, `X-API-PASSWORD`
- TypeScript: <https://skmtc.dev/invoiceninja/apis/invoice-ninja-api-reference/docs/api/v1/clients/:id/:mergeable_client_hashed_id/merge/post.ts> (a function with typed inputs; its response is checked against the schema)

##  POST /api/v1/clients/{id}/{mergeable_client_hashed_id}/merge

Handles merging 2 clients

The id parameter is the client that will be the primary client after the merge has completed. 

The mergeable_client_hashed_id is the client that will be merged into the primary client, this clients records will be updated and associated with the primary client.

> 🚨 **Important**    
This action requires elevated permissions, please note the X-API-PASSWORD header requirements for this route.

## Path parameters

- `id` string, string, required
- `mergeable_client_hashed_id` string, string, required

## Query parameters

- `index` string
- `include` string

## Headers

- `X-API-TOKEN` string, required
- `X-Requested-With` string, required
- `X-API-PASSWORD` string, required

## Response `200`

Returns the client object

## Other responses

- `401`: Authentication error
- `403`: Authorization error
- `422`: Validation error
- `429`: Rate Limit Exceeded
- `default`: Unexpected Error

## Changes

- **2024-11-17** `7cd7362d9d9f`: 1 info
  - added the new optional `query` request parameter `index`
- **2024-06-06** `8e82a2bd77e0`: 1 breaking, 2 info
  - the response's body type changed from no type to `object` for status `default`
  - added the optional property `code` to the response with the `default` status
  - added the optional property `message` to the response with the `default` status
- **2024-06-05** `e61df65649e2`: 1 breaking, 2 warning
  - the response's body type changed from `object` to no type for status `default`
  - removed the optional property `code` from the response with the `default` status
  - removed the optional property `message` from the response with the `default` status
- **2024-03-07** `71171a40d629`: 5 breaking, 9 info
  - the response's body type changed from no type to `object` for status `401`
  - the response's body type changed from no type to `object` for status `403`
  - the response's body type changed from no type to `object` for status `422`
  - the response's body type changed from no type to `object` for status `429`
  - …10 more
- **2024-02-18** `88bbc1f38ff7`: 5 breaking, 9 warning
  - the response's body type changed from `object` to no type for status `401`
  - the response's body type changed from `object` to no type for status `403`
  - the response's body type changed from `object` to no type for status `422`
  - the response's body type changed from `object` to no type for status `429`
  - …10 more

[Operation history](https://skmtc.dev/invoiceninja/apis/invoice-ninja-api-reference/changes/api/v1/clients/:id/:mergeable_client_hashed_id/merge/post.md)

---

[API](https://skmtc.dev/invoiceninja/apis/invoice-ninja-api-reference.md) - [All operations](https://skmtc.dev/invoiceninja/apis/invoice-ninja-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/invoiceninja/apis/invoice-ninja-api-reference/revisions/bcda1f823746?raw)
