Delete a tag
Delete a tag from your account. It is also removed from every conversation that has it. This can't be undone.
To take a tag off a single conversation and keep it in the account, use Remove Tag from Conversation instead.
Endpoint
DELETE https://api.p.2chat.io/open/tags/<tag-uuid>
<tag-uuid> is the UUID of the tag, e.g. TAGd37f22fa-fe01-4a90-b57d-7e83ccc6a05a.
Authentication
Include your API key in the X-User-API-Key header. Learn more about authentication.
Invocation
- cURL
- Python
- JavaScript
- PHP
curl --location --request DELETE 'https://api.p.2chat.io/open/tags/TAGd37f22fa-fe01-4a90-b57d-7e83ccc6a05a' \
--header 'X-User-API-Key: your_api_key_here'
import requests
url = "https://api.p.2chat.io/open/tags/TAGd37f22fa-fe01-4a90-b57d-7e83ccc6a05a"
headers = {
"X-User-API-Key": "your_api_key_here"
}
response = requests.delete(url, headers=headers)
print(response.json())
const axios = require('axios');
const response = await axios.delete('https://api.p.2chat.io/open/tags/TAGd37f22fa-fe01-4a90-b57d-7e83ccc6a05a', {
headers: {
'X-User-API-Key': 'your_api_key_here'
}
});
console.log(response.data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.p.2chat.io/open/tags/TAGd37f22fa-fe01-4a90-b57d-7e83ccc6a05a',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'X-User-API-Key: your_api_key_here'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response
Success (HTTP 200 OK)
{
"success": true
}
Error (HTTP 404 Not Found)
There is no tag with that UUID in your account.
{
"success": false,
"error": true,
"error_message": "Resource Not Found"
}