Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to `unifi-access-api` will be documented in this file

# 1.1.2 - 2025-10-25

**New features:**
- Update visitor delete method to allow force delete

## 1.1.1 - 2025-10-23

**Breaking:**
Expand Down
6 changes: 4 additions & 2 deletions src/API/VisitorClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,15 @@ public function assignQrCode(UuidV4 $visitorId): UnifiResponse
}

/**
* @param bool $force If is_force is passed, physically delete this visitor; otherwise, update to canceled status.
*
* @throws InvalidResponseException
* @throws GuzzleException
* @throws UnifiApiErrorException
*/
public function delete(UuidV4 $visitorId): UnifiResponse
public function delete(UuidV4 $visitorId, bool $force = false): UnifiResponse
{
$response = $this->client->delete($this::ENDPOINT."/{$visitorId->getValue()}");
$response = $this->client->delete($this::ENDPOINT."/{$visitorId->getValue()}?is_force={($force ? 'true' : 'false')}");

$data = json_decode($response->getBody()->getContents(), true);

Expand Down