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

# Merge contacts

> Merge two contact records. The contact ID in the URL will be treated as the primary contact, and the contact ID in the request body will be treated as the secondary contact. For more details about what happens when you merge two contact records, please see this knowledge article. Note: Merging contacts cannot be undone. The data from the secondary contact will be merged into the primary contact, and while you can see the combined history of the two records in the resulting single contact, there is not a way to separate the contacts after the merge.

export const ScopesList = ({scopes = [], description = "この API には、次のいずれかのスコープが必要です。"}) => {
  if (!scopes || scopes.length === 0) {
    return null;
  }
  const sortedScopes = scopes.sort((a, b) => a.localeCompare(b));
  return <div>
      <div className="text-sm mb-2">{description}</div>
      <div>
        {sortedScopes.map((scope, index) => <div key={index}>
            <code>
              <span className="text-xs">{scope}</span>
            </code>
          </div>)}
      </div>
    </div>;
};

<Accordion title="Scope requirements">
  <ScopesList scopes={['crm.objects.contacts.read', 'content', 'crm.objects.contacts.write']} />
</Accordion>


## OpenAPI

````yaml specs/legacy/v1/crm-contacts-v1.json POST /contacts/v1/contact/merge-vids/{contact_id}/
openapi: 3.0.0
info:
  title: CRM Contacts API v1
  version: 1.0.0
  description: Use the contact lists API to create and manage contact lists.
  x-hubspot-introduction: Use the contact lists API to create and manage contact lists.
  x-hubspot-api-use-case: >-
    Retrieve a contact list by ID to bring that contact data into your external
    system.
servers:
  - url: https://api.hubapi.com
    description: HubSpot API Server
security: []
paths:
  /contacts/v1/contact/merge-vids/{contact_id}/:
    post:
      summary: Merge contacts
      description: >-
        Merge two contact records. The contact ID in the URL will be treated as
        the primary contact, and the contact ID in the request body will be
        treated as the secondary contact. For more details about what happens
        when you merge two contact records, please see this knowledge article.
        Note: Merging contacts cannot be undone. The data from the secondary
        contact will be merged into the primary contact, and while you can see
        the combined history of the two records in the resulting single contact,
        there is not a way to separate the contacts after the merge.
      operationId: postcontactsv1contactmergevidscontactid
      parameters:
        - name: contact_id
          in: path
          required: true
          description: >-
            Unique identifier for a particular contact. In HubSpot's contact
            system, contact ID's are called "vid".
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - vidToMerge
              properties:
                vidToMerge:
                  type: string
                  description: >-
                    Unique identifier for the contact to merge into the primary
                    contact.
      responses:
        '200':
          description: Successful response - Merge two contact records
          content:
            application/json:
              schema:
                type: object
              examples:
                example1:
                  summary: Update a secondary email address - Example 1
                  value:
                    vidToMerge: 1343774
      security:
        - oauth2:
            - crm.objects.contacts.write
        - oauth2_legacy: []
        - private_apps:
            - crm.objects.contacts.write
        - private_apps_legacy: []
components: {}

````