API Reference / Contacts

POST /contacts/{contact_id}/relationships

Create a relationships for a specific contact

Links this contact to another. related_contacts must hold exactly two entries — one of them this contact — each with the variant_id for its end. No reverse record is created; the relationship is a single document covering both. A contact can hold at most one relationship with any given other contact.

Path parameters

Name Type Description
contact_id req string Contact ID

Request body

  • relationship_type_idstringbson-id

    ID of the relationship type

  • related_contactsarray<object>

    Related contacts with relationship variant names

    array item fields →
    • contact_idstringbson-id

      ID of the contact

    • variant_idstringbson-id

      ID of the relationship variant

Responses

201 Created
  • statusintegerint32

    Response code

  • messagestring

    Response message

  • timestampintegerunix-timestamp

    Response time

  • dataobject
    object fields →
    • relationshipobject

      The relationship mapping between contacts

      object fields →
      • idstringbson-id

        ID of the relationship

      • relationship_type_idstringbson-idrequired

        ID of the relationship type

      • related_contactsarray<object>required

        The contacts participating in the relationship along with their associated variant names

        array item fields →
        • variant_idstringbson-id

          ID of the relationship variant

        • variant_namestring

          The name of the variant

        • contact_idstringbson-id

          ID of the contact

        • first_namestring

          The first name of the contact

        • last_namestring

          The last name of the contact

        • photo_urlstring

          URL of the contact’s photo

        • company_idstringbson-id

          ID of the company, to which the contact belongs

        • company_namestring

          Name of the company, to whom the contact belongs

        • owner_idstringbson-id

          ID of the user, to whom the contact belongs

      • created_atstringdate-time

        Creation time of the relationship

      • modified_atstringdate-time

        Last modification time of the relationship

Standard error responses: 400 · 401 · 403 · 404 · 409 · 500 — shared across the API. See Errors.

Related guides