Contents
On this page

Update Contact Account Link - Plugixa CRM

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

Change the role on one of a contact’s account links, or make it the primary one. 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.

Note. is_primary: false does nothing: to move the primary flag, set it on another link.

Request

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

Path parameters

Name Type Description
id integer The contact’s id
link_id integer The link’s id, from List Contact Accounts

Request body

Content type: application/json

Field Type Required Description
role string No The new role. Sent empty, it clears the role.
is_primary boolean No true makes this the primary link and the contact’s account_id.
{
  "role": "Technical advisor",
  "is_primary": true
}

Responses

{
  "success": true,
  "data": [
    {
      "id": 9,
      "account_id": 15,
      "contact_id": 31,
      "role": "Technical advisor",
      "is_primary": 1,
      "is_inactive": 0,
      "created_at": "2026-11-12 10:15:00",
      "account_name": "Initech",
      "account_type": "partner"
    },
    {
      "id": 7,
      "account_id": 12,
      "contact_id": 31,
      "role": "Buyer",
      "is_primary": 0,
      "is_inactive": 0,
      "created_at": "2026-11-12 09:30:00",
      "account_name": "Northwind Traders",
      "account_type": "customer"
    }
  ]
}
Field Type Meaning
data[].id integer The link’s id, used to update or remove it
data[].account_id integer The account
data[].role string|null The contact’s role at that account
data[].is_primary integer 1 for the primary account. A contact has at most one
data[].is_inactive integer 1 when the link is marked inactive
data[].account_name string The account’s name
data[].account_type string The account’s type

Errors

Status Code When
404 plugixa_crm_not_found No such link on this contact.

Plus the errors every endpoint can return.

Examples

curl -s -X PUT "https://your-site.example/wp-json/plugixa-crm/v1/contacts/31/accounts/9" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"role":"Technical advisor","is_primary":true}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-crm/v1/contacts/31/accounts/9');
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([
        'role'       => 'Technical advisor',
        'is_primary' => 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/accounts/9', {
  method: 'PUT',
  headers: {
    'Authorization': auth,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ role: 'Technical advisor', is_primary: true }),
});
const { data } = await response.json();

Quick Links

Share