Get the tags of a conversation
Get the tags a conversation has right now, including the ones added from the live chat or by a flow.
Endpoint
GET https://api.p.2chat.io/open/tags/sessions/<session-key>
<session-key> is the session_key of the conversation, e.g. WA-WAN8fd3442f-e111-4fed-9323-1824fd7546c9-14085550176. See where to get it.
Authentication
Include your API key in the X-User-API-Key header. Learn more about authentication.
Invocation
- cURL
- Python
- JavaScript
- PHP
curl --location 'https://api.p.2chat.io/open/tags/sessions/WA-WAN8fd3442f-e111-4fed-9323-1824fd7546c9-14085550176' \
--header 'X-User-API-Key: your_api_key_here'
import requests
session_key = "WA-WAN8fd3442f-e111-4fed-9323-1824fd7546c9-14085550176"
url = f"https://api.p.2chat.io/open/tags/sessions/{session_key}"
headers = {
"X-User-API-Key": "your_api_key_here"
}
response = requests.get(url, headers=headers)
print(response.json())
const axios = require('axios');
const sessionKey = 'WA-WAN8fd3442f-e111-4fed-9323-1824fd7546c9-14085550176';
const response = await axios.get(`https://api.p.2chat.io/open/tags/sessions/${sessionKey}`, {
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/sessions/WA-WAN8fd3442f-e111-4fed-9323-1824fd7546c9-14085550176',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
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)
data is an empty list when the conversation has no tags, and also when the session_key doesn't match any conversation of your account.
{
"success": true,
"data": [
{
"uuid": "TAGd37f22fa-fe01-4a90-b57d-7e83ccc6a05a",
"name": "Hot lead",
"color": "#378ADD",
"exclude_from_campaigns": false,
"created_at": "2026-10-28T17:55:04Z",
"updated_at": "2026-10-28T18:02:11Z",
"created_by_user_id": 4809
},
{
"uuid": "TAG84e188bf-b78c-4edb-8c4f-4b1b25b7edf6",
"name": "Do not contact",
"color": "#E24B4A",
"exclude_from_campaigns": true,
"created_at": "2026-10-26T19:41:19Z",
"updated_at": "2026-10-26T19:45:58Z",
"created_by_user_id": 4809
}
]
}
| Field | Description |
|---|---|
success | true when the request succeeded |
data | The tags of the conversation. See the tag object. |