Contents
Export Leads - Plugixa Chat
GET /plugixa-chat/v1/leads/export
Download every lead as a CSV file, newest first. Leads in the trash are left out.
The signed-in user needs the plugixa_chat_export capability. Administrators have it.
This is not JSON. The response is the CSV file itself, with
Content-Type: text/csv; charset=utf-8, aContent-Dispositionnaming itleads-YYYY-MM-DD.csv, and a UTF-8 byte order mark at the start so spreadsheet programs read accents correctly.
Request
GET https://your-site.example/wp-json/plugixa-chat/v1/leads/export?status=new
Query parameters
| Name | Type | Default | Description |
|---|---|---|---|
status |
string |
new or read. Empty exports both. |
widget_id is ignored here: the export always covers every widget.
Responses
200 OK. The body is the CSV file.
Date,Name,Email,Phone,Message,Consent,Newsletter,"Sent from",Widget,Status
"2026-11-12 10:30","Jane Doe",jane@example.com,,"Do you ship to Canada?",Yes,,https://your-site.example/shop/,"Main widget",New
The columns are Date (in the site’s timezone and the plugin’s date format), Name, Email, Phone, Message, Consent, Newsletter, Sent from, Widget and Status. The header row is in the site’s language. A cell that starts with =, +, -, @, a tab or a carriage return gets a leading ', so a spreadsheet does not run it as a formula.
Errors
| Status | Code | When |
|---|---|---|
400 |
rest_invalid_param |
status is not new, read or empty. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-chat/v1/leads/export?status=new" \
-u "admin:$WP_APP_PASSWORD" \
-o leads.csv
<?php
$query = http_build_query([
'status' => 'new',
]);
$ch = curl_init('https://your-site.example/wp-json/plugixa-chat/v1/leads/export?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$csv = curl_exec($ch);
curl_close($ch);
const query = new URLSearchParams({ status: 'new' });
const response = await fetch(`https://your-site.example/wp-json/plugixa-chat/v1/leads/export?${query}`, {
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
},
});
const csv = await response.text();
Quick Links
Share