Create contacts in Chatfuel via API

You can transfer contacts from your current CRM to Chatfuel. It’s useful when you want to sync your marketing activities with automated messaging.
For example, you can sync phone numbers from your CRM to Chatfuel and then automatically send a broadcast 🡽 to each new contact.

API request


Use this POST request to sync contacts from your CRM to Chatfuel.
html
https://panel.chatfuel.com/api/contacts/{automation_id}/whatsapp/
You’ll need <automation_id> and API token. Both are required. This is what they look like:
Parameter
Example value
{automation_id}
62ed0d816esd77079f07db49
API token
u9A49DLBrABP2okJybkoYNjmwks26PnKhYP1hZMF1yZfKkIHXQ2zv5I41loZ1TKR

How to get API token

1. Open SettingsAPI.
Image without caption
2. Click Copy API key to get your API token.
Image without caption

How to get your automation_id

Get your {automation_id} from the address bar of your browser.
Simply open your automation and copy the ID from the URL.
Image without caption
Image without caption

How to use your API token

Add your API token in the Authorization header of your request:
json
Authorization: Bearer {your_api_token}
Example:
plain text
Authorization: Bearer u9A49DLBrABP2okJybkoYNjmwks26PnKhYP1hZMF1yZfKkIHXQ2zv5I41loZ1TKR
Header with API token in Postman
Header with API token in Postman

Payload


This is what your payload structure looks like:
phones – List of phone numbers with country codes. Maximum 1,000 numbers per request.
contact_dataproperties – Properties that will be assigned to all imported contacts. All contacts in the request will receive the same properties.
json
{ "phones": ["+1234567890", "+0987654321"], "contact_data": { "properties": { "pricingPlan": "business", "subscribed": "true" } } }
Here is an example payload that imports 3 contacts and assigns them business pricing plan, subscription status, and source tracking:
json
{ "phones": ["+14154449977", "+15551234567", "+16047891234"], "contact_data": { "properties": { "pricingPlan": "business", "subscribed": "true", "source": "crm_import" } } }

How to trigger broadcasts


1. Open AI & Automation.
Image without caption
2. Create a new WhatsApp flow.
Image without caption
3. Add message upon trigger broadcast.
Image without caption
4. Add a property from your payload (e.g. subscribed). And set the Trigger to After property is changed.
Image without caption
Done. Now, all the imported contacts with that property will be automatically added to the Message upon trigger.

Powered by Notaku