Can't create contacts collection even following documentation

Hello all,

When I try to create contacts as a collection, the data isn’t recognized and the API returns an error.
I’m following the schema and same example shown at the documentation, but it doesn’t work in /contacts endpoint nor contact/sync endpoint.

The data I’m trying to send:

{
"contacts": [
	{
		"email": "jsmith@example.com",
		"firstName": "John",
		"lastName": "Smith"
	},
	{
		"email": "alice@example.com",
		"firstName": "Alice",
		"lastName": "Jones"
	}
],
"meta": {
	"total": "2"
}
}

The error that is returned:

{
  "errors": [
    {
      "title": "O e-mail é necessário.",
      "detail": "",
      "code": "field_missing",
      "error": "contact_email_não_foi_fornecido",
      "source": {
        "pointer": "\/data\/attributes\/email"
      }
    }
  ]
}

The error response is in portuguese, but basically says that the e-mail is required. Can anyone point what is wrong? Collection requests would greatly improve our API.

Hello,
the “/contact” endpoint is used to create a single contact at a time.
Fortunately this year ActiveCampaign released a “Bulk Import” endpoint that can be used to create or synchronize a batch of up to 250 contacts
Here the link to the documentation

hope this can help you,
Isacco

1 Like

Thanks for the answer!

Following the documentation, we should use “/contact/sync” endpoint for less than 10 contacts. Although this works with the Bulk Import, it isn’t recommended for few contacts, so I’m trying to make it work using collection of resources, as suggested in the Schema section.

I know, for less than 10 contacts they suggest to use multiple calls of the contact sync endpoint.
I tried for a couple of year to sync multiple contact with a single call, using the suggested schema section and asking to ActiveCampaign support but it was not supported.

They released this bulk import endpoint at the beginning of this year so at least now we have a way to do it, i doubt they changed the “contact/sync” behavior too.

1 Like