Contents
On this page

Delete Members - Plugixa Team

DELETE /plugixateam/v1/members/bulk

Delete several members in one request, 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 and no confirmation: the members are gone. Unknown ids are ignored.

Request

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

Request body

Content type: application/json

Field Type Required Description
ids array Yes Member ids.
{
  "ids": [57, 58, 61]
}

Responses

200 OK. The members were deleted.

{
  "success": true,
  "message": "3 members deleted successfully",
  "data": {
    "deleted": 3
  }
}
Field Type Meaning
data.deleted integer How many members were actually deleted

Errors

Status Code When
400 rest_error ids is missing, empty or not an array.
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/bulk" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"ids":[57,58,61]}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixateam/v1/members/bulk');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'ids' => [57, 58, 61],
    ]),
]);
$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/bulk', {
  method: 'DELETE',
  headers: {
    'Authorization': `Basic ${auth}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ ids: [57, 58, 61] }),
});
const { data } = await response.json();

Quick Links

Share