Contents
On this page

Delete Member - Plugixa Team

DELETE /plugixateam/v1/members/{id}

Delete a member for good, with their custom field values and group memberships.

Needs the plugixa_team_delete capability, which only administrators get on activation, or manage_options. An editor can create and edit members but cannot delete them.

Note. There is no trash: the member is gone. Their photo stays in the media library. The id is not checked, so deleting a member that does not exist also answers 200.

Request

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

Path parameters

Name Type Description
id integer The member’s id

Responses

200 OK. The member was deleted.

{
  "success": true,
  "message": "Member deleted successfully",
  "data": null
}
Field Type Meaning
data null Nothing is returned

Errors

Status Code When
403 rest_forbidden The user can edit members but not delete them.
500 rest_error The database refused the delete.

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "https://your-site.example/wp-json/plugixateam/v1/members/57" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixateam/v1/members/57');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$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: 'DELETE',
  headers: {
    'Authorization': `Basic ${auth}`,
  },
});
const { data } = await response.json();

Quick Links

Share