POST/ users/ :id/ remove_tag/
Remove tag
You can remove tag from a user.
Attributes
Optional unless marked required
- id
- A unique identifier for the user which is given by User automatically.
- name
- A tag name.
Request
- cURL
- JavaScript
- PHP
- Python
curl -X POST "https://<your_app_subdomain>.user.com/api/public/users/:id/remove_tag/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"name": "Newsletter"
}'
const response = await fetch(
"https://<your_app_subdomain>.user.com/api/public/users/:id/remove_tag/",
{
method: "POST",
headers: {
Authorization: "Token <your_64_char_api_key>",
Accept: "*/*; version=2",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Newsletter",
}),
},
);
console.log(response.status);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/users/:id/remove_tag/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Token <your_64_char_api_key>",
"Accept: */*; version=2",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"name" => "Newsletter",
]),
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
response = requests.post(
"https://<your_app_subdomain>.user.com/api/public/users/:id/remove_tag/",
headers={
"Authorization": "Token <your_64_char_api_key>",
"Accept": "*/*; version=2",
},
json={
"name": "Newsletter",
},
)
print(response.status_code)
Response examples
- 204 No Content
- 404 Not Found
No response body.
{
"detail": "No ClientUser matches the given query."
}
The response is 204 even when there's nothing to remove: a tag the contact doesn't have, a tag that doesn't exist, an empty name or no name at all answer 204 too. Only a contact that doesn't exist answers 404.
note
Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.