Contents
On this page
Create CRM Connection - Plugixa Chat
POST /plugixa-chat/v1/crm
Connect a list, so new leads are added to it as contacts.
Needs Plugixa Chat Pro. The signed-in user needs the plugixa_chat_create capability. Administrators have it.
Note. The key and the list are not checked when you save. Call Check CRM Connection afterwards.
Request
POST https://your-site.example/wp-json/plugixa-chat/v1/crm
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
provider |
string |
Yes | mailchimp, brevo or fluentcrm. See List CRM Providers. |
list_id |
string |
Yes | The list to add contacts to. Get the ids with List CRM Lists. |
api_key |
string |
Mailchimp, Brevo | The account’s API key. Stored apart from the connection and never returned. FluentCRM needs none. |
list_name |
string |
No | The list’s name, for display. |
name |
string |
No | Your label. Defaults to list_name, else the service’s name. |
tags |
array |
No | Up to 10 tags of up to 100 characters. Kept for Mailchimp and FluentCRM only. |
double_optin |
boolean |
No | Ask the contact to confirm. Kept for Mailchimp and FluentCRM only. |
audience |
string |
No | subscribed (the default) or everyone. |
widget_id |
integer |
No | Only send leads from this widget. 0 (the default) for all. |
is_active |
boolean |
No | Defaults to true. |
{
"provider": "mailchimp",
"api_key": "YOUR_MAILCHIMP_KEY-us21",
"list_id": "a1b2c3d4e5",
"list_name": "Newsletter",
"tags": [
"chat-lead"
],
"double_optin": true,
"audience": "subscribed"
}
Responses
201 Created. data is the new connection.
{
"success": true,
"data": {
"id": 6,
"provider": "mailchimp",
"name": "Newsletter",
"list_id": "a1b2c3d4e5",
"list_name": "Newsletter",
"tags": [
"chat-lead"
],
"double_optin": true,
"audience": "subscribed",
"widget_id": 0,
"is_active": true,
"last_status": 0,
"last_error": "",
"last_sent_at": null,
"failures": 0,
"deleted_at": null,
"created_at": "2026-11-12 09:30:00",
"modified_at": "2026-11-12 09:30:00",
"created_by": "1",
"modified_by": "1",
"has_key": true
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
integer |
The connection’s id |
data.provider |
string |
mailchimp, brevo or fluentcrm |
data.list_id |
string |
The list contacts are added to |
data.list_name |
string |
Its name, as you sent it |
data.tags |
array |
Tags added to each contact |
data.double_optin |
boolean |
Whether the service asks the contact to confirm |
data.audience |
string |
subscribed (only leads who ticked the newsletter box) or everyone |
data.widget_id |
integer |
Only leads from this widget, 0 for all |
data.is_active |
boolean |
Whether leads are sent |
data.last_status |
integer |
HTTP status of the last delivery, 0 before the first |
data.last_error |
string |
Why the last delivery failed, empty otherwise |
data.last_sent_at |
string|null |
When the last delivery was made, or null |
data.failures |
integer |
Failures in a row |
data.has_key |
boolean |
Whether an API key is stored. The key itself is never returned |
Errors
| Status | Code | When |
|---|---|---|
400 |
plugixa_chat_crm_provider |
provider is not mailchimp, brevo or fluentcrm. |
400 |
plugixa_chat_crm_list |
list_id is missing or blank. |
400 |
plugixa_chat_crm_key_missing |
Mailchimp or Brevo, and no api_key. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-chat/v1/crm" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"provider":"mailchimp","api_key":"YOUR_MAILCHIMP_KEY-us21","list_id":"a1b2c3d4e5","list_name":"Newsletter","tags":["chat-lead"],"double_optin":true,"audience":"subscribed"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chat/v1/crm');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'provider' => 'mailchimp',
'api_key' => 'YOUR_MAILCHIMP_KEY-us21',
'list_id' => 'a1b2c3d4e5',
'list_name' => 'Newsletter',
'tags' => ['chat-lead'],
'double_optin' => true,
'audience' => 'subscribed',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-chat/v1/crm', {
method: 'POST',
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
'Content-Type': 'application/json',
},
body: JSON.stringify({ provider: 'mailchimp', api_key: 'YOUR_MAILCHIMP_KEY-us21', list_id: 'a1b2c3d4e5', list_name: 'Newsletter', tags: ['chat-lead'], double_optin: true, audience: 'subscribed' }),
});
const { data } = await response.json();
Quick Links
Share