Delete Group
Delete an existing group from your Traccar server.
WARNING
Deleting a group is irreversible. Ensure you target the correct group ID. Devices in the group will be ungrouped but not deleted.
Usage
php
use ThingsTelemetry\Traccar\Dto\StatusData;
use ThingsTelemetry\Traccar\Facades\Group;
use ThingsTelemetry\Traccar\Enums\Status;
$groupId = 1;
$result = Group::delete(id: $groupId); // returns ThingsTelemetry\Traccar\Dto\StatusData
if ($result->status === Status::SUCCESS) {
// Successfully deleted
}Results
The response is a ThingsTelemetry\Traccar\Dto\StatusData object containing a ThingsTelemetry\Traccar\Enums\Status.
php
$result->status->value; // 'success'
$result->status->name; // 'SUCCESS'
$result->status->label(); // 'Success'Impact of Deletion
When you delete a group:
- The group is permanently removed
- Devices in the group are not deleted, but their
groupIdbecomesnull - Child groups (nested groups) are not deleted, but their
groupIdreference is removed
Related Operations
- Get All Groups - Fetch all accessible groups
- Get Group - Fetch a single group
- Create Group - Create a new group
- Update Group - Update an existing group