Merge a client into another
curl --request POST \ --url https://example.com/api/v1/clients/example/merge \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "confirm": true, "targetClientId": "example" }'Re-points every relation of client {id} (projects, orders, invoices, estimates, tasks, contacts, tags, direct access, responsibles, teams, roles, custom field values, commissions, referrals, affiliate link, order form submissions, resources, impersonations, import mappings) onto targetClientId in one transaction, then deletes client {id}. Where a unique constraint would collide the target’s row wins, and a person on both clients blocks the merge; referrals between the two clients are dropped. Responsibles are combined by member, retaining an existing target assignment. Access and responsibility counts are reported separately as directAccess and responsibles. The target keeps its name — rename it afterwards with PATCH /clients/{id}. When 1Password is connected, the 1Password groups of the teams that moved get access to the target’s vault in the background; the source’s vault link goes away with it and the vault stays in 1Password. Cannot be undone. Requires the clients.edit permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Resource identifier (CUID2).
Resource identifier (CUID2).
Request Body
Section titled “Request Body”object
Must be true — the merge deletes the source client and cannot be undone.
The client that survives; every relation of the merged client moves onto it.
Responses
Section titled “Responses”What the merge moved and dropped.
object
What merging one client into another moves, drops and leaves a remark about.
object
Rows discarded because the target already holds an equivalent.
object
Rows re-pointed from the source client to the target, per relation.
object
Remarks about conflict resolutions worth reading before merging.
object
object
Example generated
{ "data": { "dropped": { "affiliateLinks": 1, "directAccess": 1, "fieldValues": 1, "referrals": 1, "responsibles": 1, "roles": 1, "tags": 1, "teams": 1 }, "moved": { "affiliateLinks": 1, "commissions": 1, "contacts": 1, "deals": 1, "directAccess": 1, "estimates": 1, "fieldValues": 1, "impersonations": 1, "importMappings": 1, "invoices": 1, "orderFormSubmissions": 1, "orders": 1, "paymentRequests": 1, "projects": 1, "referralCommissions": 1, "referralsMade": 1, "referralsReceived": 1, "resources": 1, "responsibles": 1, "roles": 1, "tags": 1, "tasks": 1, "tasksCreated": 1, "teams": 1 }, "notes": [ "example" ], "source": { "id": "example", "name": "example" }, "target": { "id": "example", "name": "example" } }}Validation error. Parse failures include field paths and expectations.
Validation error with safe field paths and expected values; submitted values are never returned.
object
object
Stable machine-readable error code.
object
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Unauthorized.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Forbidden.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Source or target client not found in this workspace.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Conflict.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}The target is the source itself, or is archived.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Rate limit exceeded. Wait for Retry-After before retrying.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Headers
Section titled “Headers”Maximum requests in the current quota window.
Quota policy in requests and window seconds, for example 60;w=60.
Requests left in this quota window (zero when blocked).
Seconds until the current quota window resets, when available from the rate-limit store.
Seconds until another request may be attempted.
Chelsea is operated by Arepa Labs LLC