Contents
On this page

Update Lead - Plugixa Chat

PUT /plugixa-chat/v1/leads/{id}

Mark a lead as read, or as new again. The status is the only thing that can change. PUT and PATCH behave the same.

The signed-in user needs the plugixa_chat_edit capability. Administrators have it.

Note. An id that does not exist, or a lead in the trash, answers 200 with data set to null rather than 404. Check data before trusting the result.

Request

PUT https://your-site.example/wp-json/plugixa-chat/v1/leads/41

Path parameters

Name Type Description
id integer The lead’s id

Request body

Content type: application/json

Field Type Required Description
status string Yes new or read.

Any other field is ignored.

{
  "status": "read"
}

Responses

200 OK. data is the updated lead.

{
  "success": true,
  "data": {
    "id": 41,
    "widget_id": 2,
    "channel_slug": "contact_form",
    "name": "Jane Doe",
    "email": "jane@example.com",
    "phone": "",
    "message": "Do you ship to Canada?",
    "consent": true,
    "subscribed": false,
    "page_url": "https://your-site.example/shop/",
    "status": "read",
    "deleted_at": null,
    "created_at": "2026-11-12 09:30:00",
    "modified_at": "2026-11-12 09:30:00",
    "created_by": "0",
    "modified_by": "0",
    "widget_name": "Main widget",
    "created_label": "2026-11-12 10:30"
  }
}
Field Type Meaning
data.status string The new status
data.modified_at string UTC datetime of this change

Errors

Status Code When
400 plugixa_chat_bad_status status is missing, or is not new or read.

Plus the errors every endpoint can return.

Examples

curl -s -X PATCH "https://your-site.example/wp-json/plugixa-chat/v1/leads/41" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"status":"read"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chat/v1/leads/41');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'PATCH',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => [
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => json_encode([
        'status' => 'read',
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-chat/v1/leads/41', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ status: 'read' }),
});
const { data } = await response.json();

Quick Links

Share