Custom Field Groups via API

We can create custom fields via api with https://youraccountname.api-us1.com/api/3/fields but what is the trick to create a custom field group and add these custom fields to a group? Thx!

2 Likes

No response since 2019… hmmm anyone from ActiveCampaign monitoring this forum?

Hi Fred - I’m Kelly on the ActiveCampaign Product team here. We do have a way to create a custom field group and add custom fields via API. It’s currently undocumented, but I’ll work with the team to ensure it gets documented!

To create a field group, send a POST to /api/3/groupDefinitions with the payload:
{“groupDefinition”:{
“label”:“[group name]”,
“ordernum”:“[order value among groups]”,
“groupType”:“[1 for contact group, 2 for deal group, 3 for account group]”
}
}
(use PUT to edit it, DELETE to delete it)

Fields are assigned to groups using the regular field endpoint by adding a group parameter, or by using the groupMembers endpoint

To change a field to a new group, given the id of the groupMember that associates the field to a group, send a PUT to /api/3/groupMembers with the payload:
{“groupMember”: {
“rel_id”:“[field id]”,
“ordernum”:[order number within the group],
“group_id”:“[group id]”
}
}

Let us know if this helps!

Hello Kelly, how are you?

I saw that this endpoint is already documented, but it is not working.

Whenever I use it, it says that Member [ID] already has a related group of the same type.

Do you know what could be happening?