Skip to content

Commit ceb0380

Browse files
author
amburke
committed
Add method for deleting a user
There wasn't a very explicit way to delete a user available for customers. They seemed confused by this.
1 parent 09fc0ce commit ceb0380

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ $client->users->create([
4747
"email" => "[email protected]"
4848
]);
4949

50+
// Delete a user by ID
51+
$client->users->deleteUser("570680a8a1bcbca8a90001b9");
52+
5053
// Add companies to a user
5154
$client->users->create([
5255
"email" => "[email protected]",

src/IntercomUsers.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,15 @@ public function getUsers($options)
2121
{
2222
return $this->client->get("users", $options);
2323
}
24+
25+
public function deleteUser($id, $options = [])
26+
{
27+
$path = $this->userPath($id);
28+
return $this->client->delete($path, $options);
29+
}
30+
31+
public function userPath($id)
32+
{
33+
return "users/" . $id;
34+
}
2435
}

0 commit comments

Comments
 (0)