Contents
On this page

Update Member - Plugixa Team

PUT /plugixateam/v1/members/{id}

Change a member’s fields, groups and custom field values.

Needs a signed-in WordPress user with the plugixa_team_edit capability, which administrators and editors get when the plugin is activated, or manage_options.

Note. Most fields are only written when you send them, but four are not: first_name must always be sent, and an omitted status becomes published, an omitted is_featured becomes false and an omitted display_order becomes 0. Sending only {"first_name": "Amira", "job_title": "Design Director"} therefore publishes a draft member and unfeatures them. Read the member first with Get Member and send those four back. To change only the status, use Update Member Status.

Note. The id is not checked. Updating a member that does not exist answers 200 with that id and changes nothing.

Request

PUT https://your-site.example/wp-json/plugixateam/v1/members/57

Path parameters

Name Type Description
id integer The member’s id

Request body

Content type: application/json

Field Type Required Description
first_name string Yes Must not be blank.
last_name string No
slug string No Made unique by appending -1, -2, … Empty or omitted keeps the current slug.
job_title string No
department string No Free text. Members with the same text share a department.
bio string No HTML. Tags not allowed in a post are stripped.
short_bio string No Plain text.
photo_id integer|null No A media library attachment id. null or 0 removes the photo.
email string No Stored as plain text: the format is not checked.
phone string No
mobile string No
website_url string|null No A URL. Anything that is not a safe URL is emptied.
location string No
social_links array No { "platform": "linkedin", "url": "https://..." } objects. An item without a URL is dropped; one without a platform gets website.
skills array No Stored as sent. The front end reads { "name": "...", "percentage": 0-100 } objects.
ribbon_text, ribbon_color string No The ribbon shown on the card.
is_featured boolean No Omitted means false: the member is unfeatured.
status string No published, draft or hidden. Omitted means published.
display_order integer No Omitted means 0.
parent_id integer|null No Another member’s id, for a reporting line. Not checked.
hire_date string|null No YYYY-MM-DD.
groups array No Replaces the member’s groups with exactly these ids. [] removes the member from every group. Omit it to leave the groups alone. A group the member was already in keeps its position in that group.
meta object|null No Custom field values PRO, keyed by field key: { "pronouns": "she/her" }. Only the keys you send are written; other keys keep their values. An array or object value is stored as JSON text. Values are not checked against the field definitions.
custom_fields object|null No Older free-form data kept on the member row. Send custom field values in meta instead.
source string No Changed only when sent.
language_code string No Ignored on update.

Every other field keeps its value when you leave it out; send an empty string to clear it.

{
  "first_name": "Amira",
  "job_title": "Design Director",
  "status": "published",
  "is_featured": true,
  "display_order": 0,
  "groups": [3, 5]
}

Responses

200 OK. The member was updated.

{
  "success": true,
  "message": "Member updated successfully",
  "data": {
    "id": 57
  }
}
Field Type Meaning
data.id integer The id from the URL

Errors

Status Code When
400 rest_invalid_param A field has the wrong type, or status is not published, draft or hidden.
400 rest_error Validation failed: first_name is missing or blank. data.errors names the field.
500 rest_error The database refused the change.

Plus the errors every endpoint can return.

Examples

curl -s -X PUT "https://your-site.example/wp-json/plugixateam/v1/members/57" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"first_name":"Amira","job_title":"Design Director","status":"published","is_featured":true,"display_order":0,"groups":[3,5]}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixateam/v1/members/57');
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([
        'first_name'    => 'Amira',
        'job_title'     => 'Design Director',
        'status'        => 'published',
        'is_featured'   => true,
        'display_order' => 0,
        'groups'        => [3, 5],
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixateam/v1/members/57', {
  method: 'PUT',
  headers: {
    'Authorization': `Basic ${auth}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    first_name: 'Amira',
    job_title: 'Design Director',
    status: 'published',
    is_featured: true,
    display_order: 0,
    groups: [3, 5],
  }),
});
const { data } = await response.json();

Quick Links

Share