Contents
Delete Group - Plugixa Team
DELETE /plugixateam/v1/groups/{id}
Delete a group. Its members are kept; they simply stop belonging to it.
Needs the plugixa_team_delete capability, which only administrators get on activation, or manage_options.
Note. There is no trash, and the id is not checked: deleting a group that does not exist also answers
200. A shortcode or block still pointing at the group shows nothing from it.
Request
DELETE https://your-site.example/wp-json/plugixateam/v1/groups/3
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The group’s id |
Responses
200 OK. The group was deleted.
{
"success": true,
"message": "Group deleted successfully",
"data": null
}
| Field | Type | Meaning |
|---|---|---|
data |
null |
Nothing is returned |
Errors
| Status | Code | When |
|---|---|---|
403 |
rest_forbidden |
The user can edit groups 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/groups/3" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixateam/v1/groups/3');
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/groups/3', {
method: 'DELETE',
headers: {
'Authorization': `Basic ${auth}`,
},
});
const { data } = await response.json();
Quick Links
Share