Contents
On this page

Update Contact - Plugixa CRM

PUT /plugixa-crm/v1/contacts/{id}

Change some of a contact’s fields. Only the fields you send change. PATCH works the same way.

Any user with access to Plugixa CRM. With Plugixa CRM Pro roles, the user’s role must also allow editing this contact.

email and phone change the primary value only. On update they are not added to the contact’s e-mail and phone lists, so email can end up different from the address marked primary in emails. Create is the only call that adds them to the lists.

Request

PUT https://your-site.example/wp-json/plugixa-crm/v1/contacts/31

Path parameters

Name Type Description
id integer The contact’s id

Request body

Content type: application/json

Field Type Required Description
first_name string No full_name is rebuilt when either name changes.
last_name string No full_name is rebuilt when either name changes.
salutation string No Free text, such as Ms.
title string No Job title.
account_id integer No Must be an existing account. It becomes the primary link, created if needed. 0 clears account_id and the primary flag, but keeps the link.
email string No The primary e-mail address. A value that is not one is stored empty.
phone string No The primary phone number.
do_not_call boolean No true or false.
birthday string No YYYY-MM-DD. Anything else is stored as null.
status string No Free text.
address_street string No Postal address.
address_city string No Postal address.
address_state string No Postal address.
address_postal_code string No Postal address.
address_country string No Postal address.
description string No HTML. Tags not allowed in post content are stripped.
user_id integer No The contact’s own WordPress user, if they have one.
avatar_attachment_id integer No A media library attachment used as the photo.
assigned_user_id integer No The WordPress user who owns the contact. 0 or nothing means none.
modified_at string No The modified_at you read. When sent, the update is refused if the contact changed since: see Avoiding lost updates.

A field you leave out keeps its value. A field you send empty is stored empty. Sending both names empty is accepted.

{
  "title": "Head of purchasing",
  "do_not_call": true
}

Responses

200 OK. data is the updated contact.

{
  "success": true,
  "data": {
    "id": "31",
    "salutation": "Ms",
    "first_name": "Maria",
    "last_name": "Anders",
    "full_name": "Maria Anders",
    "account_id": "12",
    "title": "Head of purchasing",
    "email": "maria@northwind.example",
    "phone": "+1 202 555 0177",
    "description": "",
    "avatar_attachment_id": null,
    "user_id": null,
    "status": "active",
    "assigned_user_id": "3",
    "created_by": "1",
    "modified_by": "1",
    "created_at": "2026-11-12 09:30:00",
    "modified_at": "2026-11-12 10:15:00",
    "deleted_at": null,
    "do_not_call": "1",
    "birthday": null,
    "address_street": "",
    "address_city": "Seattle",
    "address_state": "",
    "address_postal_code": "",
    "address_country": "United States",
    "emails": [
      {
        "id": 58,
        "parent_type": "contact",
        "parent_id": 31,
        "address": "maria@northwind.example",
        "type": "office",
        "is_primary": 1,
        "opted_out": 0,
        "is_invalid": 0,
        "created_at": "2026-11-12 09:30:00"
      }
    ],
    "phones": [
      {
        "id": 44,
        "parent_type": "contact",
        "parent_id": 31,
        "number": "+1 202 555 0177",
        "type": "office",
        "is_primary": 1,
        "created_at": "2026-11-12 09:30:00",
        "digits": "12025550177",
        "opted_out": 0,
        "is_invalid": 0
      }
    ],
    "affiliations": [
      {
        "id": 7,
        "account_id": 12,
        "contact_id": 31,
        "role": "Buyer",
        "is_primary": 1,
        "is_inactive": 0,
        "created_at": "2026-11-12 09:30:00",
        "account_name": "Northwind Traders",
        "account_type": "customer"
      }
    ]
  }
}
Field Type Meaning
data.id string The contact’s id. Contact fields come back as strings, numbers included
data.full_name string First and last name, kept in step with them
data.account_id string|null The primary account
data.email string The primary e-mail address
data.do_not_call string "1" or "0"
data.modified_at string UTC datetime of the last change

Errors

Status Code When
404 plugixa_crm_not_found No contact with that id, or it is in the trash.
422 plugixa_crm_unknown_account account_id is not an existing account.
409 plugixa_crm_conflict You sent modified_at and the contact changed since.

Plus the errors every endpoint can return.

Examples

curl -s -X PUT "https://your-site.example/wp-json/plugixa-crm/v1/contacts/31" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"title":"Head of purchasing","do_not_call":true}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-crm/v1/contacts/31');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'PUT',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'title'       => 'Head of purchasing',
        'do_not_call' => true,
    ]),
]);
$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/contacts/31', {
  method: 'PUT',
  headers: {
    'Authorization': auth,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ title: 'Head of purchasing', do_not_call: true }),
});
const { data } = await response.json();

Quick Links

Share