Create contact and add custom field values V3 api

V2 had option to set create subscriber → add them to a list → add custom field values in a single request.
Will v3 ever have that or it already does and I’m missing something?

1 Like

Hi there, Amy from ActiveCampaign’s Customer Experience Team. We’re just refreshing our forum page and I wanted to add some help here for anyone who comes across this page/question/post.

ActiveCampaign’s API v3 does support creating a contact, adding them to a list, and setting custom field values in a single request using the contact/sync endpoint. This endpoint allows you to synchronise a contact’s information, including custom field values, and optionally subscribe them to a list.

Here’s how you can achieve this:

http

Copy code

POST /api/3/contact/sync
Content-Type: application/json
Api-Token: YOUR_API_KEY

{
  "contact": {
    "email": "example@example.com",
    "firstName": "John",
    "lastName": "Doe",
    "phone": "1234567890",
    "fieldValues": [
      {
        "field": "field_key_1",
        "value": "Value 1"
      },
      {
        "field": "field_key_2",
        "value": "Value 2"
      }
    ]
  },
  "listIds": [
    LIST_ID_1,
    LIST_ID_2
  ]
}

In this example:

  • Replace YOUR_API_KEY with your ActiveCampaign API key.
  • Replace example@example.com with the contact’s email address.
  • Replace "field_key_1" and "field_key_2" with the keys of your custom fields, and "Value 1" and "Value 2" with the respective values you want to set.
  • Replace LIST_ID_1 and LIST_ID_2 with the IDs of the lists you want to subscribe the contact to.

This request will create the contact if they do not already exist, update their information if they do, add them to the specified lists, and set the custom field values accordingly.

Any questions or additional ideas, thread them below!