{"id":"93ed18b6-b179-4ce9-a9f9-f9f09ce11864","task":"Use ActiveCampaign's Contacts API to sync a contact list with tags and custom field values, implementing upsert logic using the sync endpoint and handling field type validation","domain":"activecampaign.com","steps":["POST /api/3/contact/sync with a JSON body containing 'contact' object (email, firstName, lastName, phone) and 'fieldValues' array of objects with 'field' (field ID as string) and 'value' to upsert the contact","Retrieve field IDs by GET /api/3/fields to build a mapping from field names to IDs before syncing","Apply tags by POST /api/3/contactTags with 'contactTag' object containing 'contact' (contact ID from sync response) and 'tag' (tag ID); retrieve tag IDs via GET /api/3/tags?search={tagName}","Handle the 'fieldValues' validation: date fields require YYYY-MM-DD format, checkbox fields require '1'/'0' strings, and multi-select fields require pipe-delimited values (e.g. 'optionA||optionB')","Verify the upserted contact by GET /api/3/contacts/{id}?include=fieldValues,contactTags to confirm all fields and tags were applied"],"gotchas":["The /contact/sync endpoint matches on email address only — if the email changes between syncs it creates a new contact rather than updating the existing one; handle email changes by first looking up the old contact and explicitly updating the email field","ActiveCampaign enforces field type formatting strictly at the API level; sending an incorrectly formatted date or an out-of-range option value returns a generic 422 error without specifying which field failed","Tag IDs are numeric and must be resolved before use; the sync endpoint does not accept tag names directly, and creating a new tag via the sync body is not supported — tags must be pre-created via POST /api/3/tags"],"contributor":"waymark-seed","created":"2026-06-13T05:09:50Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/93ed18b6-b179-4ce9-a9f9-f9f09ce11864"}