Contents
On this page

Create Case - Plugixa CRM

POST /plugixa-crm/v1/cases

Open a support case. It is given the next case number.

Any user with access to Plugixa CRM. With Plugixa CRM Pro roles, the user’s role must also allow creating cases.

Note. An empty string is accepted for status, priority and type and stored empty rather than replaced by the default.

Request

POST https://your-site.example/wp-json/plugixa-crm/v1/cases

Request body

Content type: application/json

Field Type Required Description
name string Yes The subject. Must not be blank.
description string No HTML. Tags not allowed in post content are stripped.
status string No new, assigned, pending, closed, rejected or duplicate. Defaults to new.
priority string No low, normal, high or urgent. Defaults to normal.
type string No question, incident or problem. Defaults to empty.
account_id integer No The account. Not checked.
contact_id integer No The main contact. Not checked.
lead_id integer No A lead. Not checked.
contacts array No Contact ids involved in the case. Replaces the whole list.
is_internal boolean No Defaults to false.
assigned_user_id integer No The WordPress user who owns the case. 0 means none.

A closing status (closed, rejected, duplicate) stamps closed_at. Fields not in this table are ignored.

{
  "name": "Invoice shows the wrong VAT number",
  "description": "<p>The October invoice carries the old VAT number.</p>",
  "status": "assigned",
  "priority": "high",
  "type": "problem",
  "account_id": 12,
  "contact_id": 31,
  "contacts": [
    31
  ],
  "assigned_user_id": 3
}

Responses

201 Created. data is the new case.

{
  "success": true,
  "data": {
    "id": 42,
    "name": "Invoice shows the wrong VAT number",
    "status": "assigned",
    "priority": "high",
    "type": "problem",
    "description": "<p>The October invoice carries the old VAT number.</p>",
    "account_id": 12,
    "contact_id": 31,
    "lead_id": null,
    "is_internal": false,
    "closed_at": null,
    "assigned_user_id": 3,
    "created_by": "1",
    "modified_by": "1",
    "created_at": "2026-11-12 09:30:00",
    "modified_at": "2026-11-12 09:30:00",
    "deleted_at": null,
    "number": "C-00042",
    "number_value": 42,
    "is_closed": false,
    "account_name": "Northwind Traders",
    "contact_name": "Maria Anders",
    "assigned_user_name": "Jordan Lee",
    "contacts": [
      31
    ]
  }
}
Field Type Meaning
data.id integer The case’s id
data.number string The case reference, C- and a padded sequence number
data.number_value integer The sequence number alone
data.name string The subject
data.status string new, assigned, pending, closed, rejected or duplicate
data.priority string low, normal, high or urgent
data.type string question, incident, problem, or empty
data.is_internal boolean Whether the case is internal
data.is_closed boolean true for closed, rejected and duplicate
data.closed_at string|null When the case was closed, in the site’s time zone
data.account_name string The account’s name, empty when none
data.contact_name string The contact’s name, empty when none
data.assigned_user_name string The owner’s display name, empty when none
data.contacts array The ids of the contacts involved

Errors

Status Code When
422 plugixa_crm_invalid_name name is missing or blank.
422 plugixa_crm_invalid_status status is not a case status.
422 plugixa_crm_invalid_priority priority is not a priority.
422 plugixa_crm_invalid_type type is not a case type.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-crm/v1/cases" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"name":"Invoice shows the wrong VAT number","description":"<p>The October invoice carries the old VAT number.</p>","status":"assigned","priority":"high","type":"problem","account_id":12,"contact_id":31,"contacts":[31],"assigned_user_id":3}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-crm/v1/cases');
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([
        'name'             => 'Invoice shows the wrong VAT number',
        'description'      => '<p>The October invoice carries the old VAT number.</p>',
        'status'           => 'assigned',
        'priority'         => 'high',
        'type'             => 'problem',
        'account_id'       => 12,
        'contact_id'       => 31,
        'contacts'         => [31],
        'assigned_user_id' => 3,
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixa-crm/v1/cases', {
  method: 'POST',
  headers: {
    'Authorization': auth,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Invoice shows the wrong VAT number',
    description: '<p>The October invoice carries the old VAT number.</p>',
    status: 'assigned',
    priority: 'high',
    type: 'problem',
    account_id: 12,
    contact_id: 31,
    contacts: [31],
    assigned_user_id: 3,
  }),
});
const { data } = await response.json();

Quick Links

Share