Contacts

Add/update contacts

Changed on

The method adds new contacts and updates existing contacts. Asynchronous processing is used; requests may be handled in a different order or concurrently.

post/api/v1/contacts

Request

Request body

dedupeOn'email' | 'sms' | 'push' | 'email_or_sms' | 'id' | 'externalCustomerId' | 'fieldId' required

The field for determining the contact uniqueness. <b>Important</b> the field set as <b>dedupeOn</b> will not be updated

fieldIdinteger

The field for determining the contact uniqueness. This field is taken into account when dedupeOnProperty has the fieldId value.

contactFieldsstring[]

The list of contacts’ fields to be updated. All the contact fields will be updated if this parameter is not specified. The fields will be updated with the ‘null’ value if no data for updating is transmitted.

customFieldsIDsinteger[]

The list of the custom field IDs to be updated.<br> The custom fields are updated if their IDs are in this list.<br> This field is required when a contact is updated

groupNamesstring[]

The list of the segment names where the new/updated contacts will be added to.

groupNamesExcludestring[]

The list of the segment names where the new/updated contacts will be excluded from.

restoreDeletedboolean

Choose either to restore the previously deleted contacts or not.

eventKeyForNewContactsstring

The event type identification key. An event of corresponding type is generated only for contacts created by the request, not for updated ones. <br> If the system does not have an event type with such a key, a new event type is created. <br> All characters are allowed, except < ; ’ \ / | " ` ' ^ ? ! , > <br> Max length: 100 symbols

Example request

{
  "contacts": [
    {
      "firstName": "John",
      "lastName": "Smith",
      "channels": [
        {
          "device": {
            "appId": "83b77a49-fc28-409b-aeaa-68c9d544ab9d",
            "deviceModel": "iPhone 16 Pro",
            "os": "iOS",
            "locale": "en_UK",
            "clientVersion": "1.6.8",
            "appVersion": "1.23.45"
          }
        }
      ],
      "address": {
        "region": "Occitanie",
        "town": "Toulouse",
        "address": "Rue Imaginaire, 456",
        "postcode": "31000",
        "countryCode": "FR"
      },
      "fields": [
        {
          "id": 79814,
          "value": "textfield"
        }
      ],
      "addressBookId": 7200,
      "id": 23456789,
      "externalCustomerId": "TV12790",
      "groups": [
        {
          "id": 200400
        }
      ],
      "languageCode": "en",
      "timeZone": "Europe/London",
      "marketId": "kyiv"
    }
  ]
}

Response

asyncSessionIdstring

Asynchronous import session ID. Used to obtain the import status using the <i>/v1/importstatus</i> method.

errorMessagestring

Example response

{
  "failedContacts": [
    {
      "channels": [
        {
          "device": {
            "appId": "83b77a49-fc28-409b-aeaa-68c9d544ab9d",
            "deviceModel": "iPhone 16 Pro",
            "os": "iOS",
            "locale": "en_UK",
            "clientVersion": "1.6.8",
            "appVersion": "1.23.45"
          }
        }
      ],
      "address": {
        "region": "Occitanie",
        "town": "Toulouse",
        "address": "Rue Imaginaire, 456",
        "postcode": "31000",
        "countryCode": "FR"
      },
      "fields": [
        {
          "id": 79814,
          "value": "textfield"
        }
      ],
      "groups": [
        {
          "id": 200400
        }
      ]
    }
  ]
}

Changes

    • breaking

      removed the enum value inapp telegrambot of the request property ////

    • warning

      added the new inapp enum value to the //// response property for the response status

    • warning

      added the new telegrambot enum value to the //// response property for the response status

    • info

      added the new inapp enum value to the request property ////

    • info

      added the new telegrambot enum value to the request property ////

    • info

      removed the inapp telegrambot enum value from the //// response property for the response status