Contents
On this page

Get Widget - Plugixa Chat

GET /plugixa-chat/v1/widgets/{id}

Read one widget, with its appearance, every channel row and every rule.

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

Request

GET https://your-site.example/wp-json/plugixa-chat/v1/widgets/2

Path parameters

Name Type Description
id integer The widget’s id

Responses

200 OK. data is the widget.

{
  "success": true,
  "data": {
    "id": 2,
    "name": "Main widget",
    "status": "active",
    "appearance": {
      "position": "right",
      "layout": "vertical",
      "animation": "none",
      "trigger": "click",
      "size": 56,
      "offset_x": 24,
      "offset_y": 24,
      "color": "#0f766e",
      "icon_color": "#ffffff",
      "cta": "",
      "label": "",
      "icon": null,
      "badge": 0,
      "show_delay": 0,
      "show_scroll": 0,
      "show_exit": false
    },
    "sort_order": 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",
    "channels": [
      {
        "id": 31,
        "widget_id": 2,
        "slug": "whatsapp",
        "label": "",
        "value": "+15550001234",
        "message": "Hi! I'm on {title}",
        "is_active": true,
        "sort_order": 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",
        "color": "#25d366",
        "new_tab": false,
        "devices": "all",
        "icon": null,
        "hover": "",
        "qr": false,
        "settings": []
      }
    ],
    "rules": [
      {
        "id": 8,
        "widget_id": 2,
        "kind": "url",
        "mode": "hide",
        "operator": "contains",
        "value": "[\"\\/checkout\"]",
        "sort_order": "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",
        "values": [
          "/checkout"
        ]
      }
    ],
    "channel_count": 1
  }
}
Field Type Meaning
data.id integer The widget’s id
data.name string Its name, shown only in the admin
data.status string active or inactive
data.appearance object The launcher’s look and display triggers. See Create Widget
data.sort_order integer Position among the widgets
data.channels array Every channel row, switched on or not, in display order
data.channels[].id integer The row’s id. Rows get new ids each time the channels are saved
data.channels[].is_active boolean Whether the row shows
data.channels[].settings object|array A panel channel’s own settings (the contact form’s fields, for example). An empty array for the others
data.rules array The targeting rules, in evaluation order
data.rules[].values array The rule’s values, as a list of strings. value holds the same list as a JSON string
data.channel_count integer How many channel rows the widget has
data.created_by string The id of the user who created it, as a string
data.created_at string UTC datetime
data.deleted_at string|null null unless the widget is in the trash

Errors

Status Code When
404 plugixa_chat_not_found No widget has this id, or it is in the trash.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-chat/v1/widgets/2" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chat/v1/widgets/2');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-chat/v1/widgets/2', {
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
  },
});
const { data } = await response.json();

Quick Links

Share