> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monaco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Merge Accounts

> Merges the accounts in `source_account_ids` into the account in the path. This is irreversible, like deleting an account: each source account is deleted, its contacts, opportunities, tasks, tags and domains move to the target, and its live sequences are stopped. Call `preview_account_merge` first.

When live sequences would be stopped the request is rejected with 409 `sequence_stop_confirmation_required` unless `confirm_sequence_stop` is true. If a merge fails part-way, 409 `merge_failed` says which steps already committed; retrying the same request resumes it. Retrying a merge that already completed succeeds with zero new changes and a positive `source_accounts_already_merged` count. `source_account_ids` in the response echo the ids as resolved at request time, so a retry that names an already-deleted source by its AccountICP id echoes that id rather than the account id.



## OpenAPI

````yaml https://api.monaco.com/openapi.json post /v1/accounts/{account_id}/merge
openapi: 3.2.1
info:
  title: Monaco Public API
  description: Public API for Monaco
  version: 1.0.0
servers:
  - url: https://api.monaco.com
security: []
paths:
  /v1/accounts/{account_id}/merge:
    post:
      tags:
        - Accounts
      summary: Merge Accounts
      description: >-
        Merges the accounts in `source_account_ids` into the account in the
        path. This is irreversible, like deleting an account: each source
        account is deleted, its contacts, opportunities, tasks, tags and domains
        move to the target, and its live sequences are stopped. Call
        `preview_account_merge` first.


        When live sequences would be stopped the request is rejected with 409
        `sequence_stop_confirmation_required` unless `confirm_sequence_stop` is
        true. If a merge fails part-way, 409 `merge_failed` says which steps
        already committed; retrying the same request resumes it. Retrying a
        merge that already completed succeeds with zero new changes and a
        positive `source_accounts_already_merged` count. `source_account_ids` in
        the response echo the ids as resolved at request time, so a retry that
        names an already-deleted source by its AccountICP id echoes that id
        rather than the account id.
      operationId: merge_accounts
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Account Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountMergeRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicItemResponse_AccountMergeResponse_'
        '409':
          description: Confirmation required to stop live sequences, or the merge failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountMergeErrorResponse'
        '422':
          description: The merge request is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountMergeErrorResponse'
        4XX:
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponse'
components:
  schemas:
    AccountMergeRequest:
      properties:
        source_account_ids:
          items:
            type: string
            format: uuid
          type: array
          maxItems: 100
          minItems: 1
          title: Source Account Ids
          description: >-
            IDs of the accounts to merge into the account in the path. Each is
            deleted when the merge is applied. At most 100 per request.
        confirm_sequence_stop:
          type: boolean
          title: Confirm Sequence Stop
          description: >-
            Set to true only after the user approved stopping the live sequences
            the preview lists under `blocking_sequences`. Without it, a merge
            that would stop live sequences is rejected with
            `sequence_stop_confirmation_required`.
          default: false
      additionalProperties: false
      type: object
      required:
        - source_account_ids
      title: AccountMergeRequest
    PublicItemResponse_AccountMergeResponse_:
      properties:
        data:
          $ref: '#/components/schemas/AccountMergeResponse'
        meta:
          $ref: '#/components/schemas/ResponseMeta'
      type: object
      required:
        - data
      title: PublicItemResponse[AccountMergeResponse]
    AccountMergeErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/AccountMergeErrorDetail'
      type: object
      required:
        - error
      title: AccountMergeErrorResponse
    PublicErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
        - error
      title: PublicErrorResponse
    AccountMergeResponse:
      properties:
        target_account_id:
          type: string
          title: Target Account Id
        source_account_ids:
          items:
            type: string
          type: array
          title: Source Account Ids
        contacts_moved:
          type: integer
          title: Contacts Moved
        contacts_merged:
          type: integer
          title: Contacts Merged
        source_accounts_deleted:
          type: integer
          title: Source Accounts Deleted
        source_accounts_already_merged:
          type: integer
          title: Source Accounts Already Merged
        opportunities_reassigned:
          type: integer
          title: Opportunities Reassigned
        opportunities_deduped:
          type: integer
          title: Opportunities Deduped
        tags_added:
          type: integer
          title: Tags Added
        domains_moved:
          type: integer
          title: Domains Moved
      type: object
      required:
        - target_account_id
        - source_account_ids
        - contacts_moved
        - contacts_merged
        - source_accounts_deleted
        - source_accounts_already_merged
        - opportunities_reassigned
        - opportunities_deduped
        - tags_added
        - domains_moved
      title: AccountMergeResponse
    ResponseMeta:
      properties:
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: Server timestamp of the response
      type: object
      title: ResponseMeta
    AccountMergeErrorDetail:
      properties:
        code:
          type: string
          title: Code
          description: Machine-readable error code
          examples:
            - not_found
        message:
          type: string
          title: Message
          description: Human-readable error message
          examples:
            - Resource not found
        completed_steps:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Completed Steps
          description: >-
            For `merge_failed`, the steps committed before the failure, without
            its cause
        source_accounts_deleted:
          anyOf:
            - type: integer
            - type: 'null'
          title: Source Accounts Deleted
          description: >-
            For `merge_failed`, how many source deletions committed before the
            failure
        blocking_sequence_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Blocking Sequence Count
          description: >-
            For `sequence_stop_confirmation_required`, how many live sequences
            would stop
      type: object
      required:
        - code
        - message
      title: AccountMergeErrorDetail
    ErrorDetail:
      properties:
        code:
          type: string
          title: Code
          description: Machine-readable error code
          examples:
            - not_found
        message:
          type: string
          title: Message
          description: Human-readable error message
          examples:
            - Resource not found
      type: object
      required:
        - code
        - message
      title: ErrorDetail

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.