Archive a user
Permanently delete a user
The archive action will not perform a 'hard' delete. If you want to permanently delete your user then you will need to use the Permanently delete a user endpoint.
Example ID Archive Request
$ curl \\\n-s https://api.intercom.io/users/5321a20f72cdbb4192000013 \\\n-X DELETE \\\n-H 'Authorization:Bearer <Your access token>' \\\n-H 'Accept:application/json'
HTTP/1.1 200 Ok\n\n{\n \"type\": \"user\",\n \"id\": \"5714dd359a3fd47136000001\",\n \"user_id\": \"25\",\n \"anonymous\": false,\n \"email\": \"email@example.com\",\n \"phone\": \"555671243\",\n \"name\": \"Joe Example\",\n \"pseudonym\": null,\n ...\n}\n# NB: Full User objects are returned
Example User ID Archive Request
$ curl \
-s https://api.intercom.io/users?user_id=25 \
-X DELETE \
-H 'Authorization:Bearer <Your access token>' \
-H 'Accept:application/json'
HTTP/1.1 200 Ok
{
"type": "user",
"id": "5714dd359a3fd47136000001",
"user_id": "25",
"anonymous": false,
"email": "email@example.com",
"phone": "555671243",
"name": "Joe Example",
"pseudonym": null,
...
}
# NB: Full User objects are returned
user = intercom.users.find(:user_id => "1")
intercom.users.delete(user)
Map<String, String> params = Maps.newHashMap();
params.put("user_id", "1");
user = User.find(params);
User.delete(user.getId());
<?php
$intercom->users->deleteUser("", ["user_id" => "5087"]);
?>
Example User Email Archive Request
$ curl \
-s https://api.intercom.io/users?email=wash%40example.com \
-X DELETE \
-H 'Authorization:Bearer <Your access token>' \
-H 'Accept:application/json'
HTTP/1.1 200 Ok
{
"type": "user",
"id": "5714dd359a3fd47136000001",
"user_id": "25",
"anonymous": false,
"email": "email@example.com",
"phone": "555671243",
"name": "Joe Example",
"pseudonym": null,
...
}
# NB: Full User objects are returned
user = intercom.users.find(:email => "foo@bar.com")
intercom.users.delete(user)
Map<String, String> params = Maps.newHashMap();
params.put("email", "malcolm@example.com");
user = User.find(params);
User.delete(user.getId());
<?php
$intercom->users->deleteUser("", ["email" => "test@example.com"]);
?>
A user can be archived by sending a DELETE request to its URL using the user's id
field as part of the path -
https://api.intercom.io/users/{id}
Alternatively, you can archive a user by sending a DELETE request using the email
or user_id
as query parameters -
https://api.intercom.io/users?email={email}
https://api.intercom.io/users?user_id={user_id}
Request Parameters
Parameter | Required | Description |
---|---|---|
no | The email you have defined for the user | |
user_id | no | The user id you have defined for the user |
Please note that when a user is archived, all of their conversations and message history will also be archived.
Returns
A User object.