List tags
List the tags of your account, sorted by name.
Endpoint
GET https://api.p.2chat.io/open/tags
Authentication
Include your API key in the X-User-API-Key header. Learn more about authentication.
Parameters
These parameters go in the query string.
| Field | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page to return, starting at 0. Defaults to 0. |
page_size | integer | No | Tags per page, between 1 and 50. Defaults to 10. |
Invocation
- cURL
- Python
- JavaScript
- PHP
curl --location 'https://api.p.2chat.io/open/tags?page=0&page_size=20' \
--header 'X-User-API-Key: your_api_key_here'
import requests
url = "https://api.p.2chat.io/open/tags"
headers = {
"X-User-API-Key": "your_api_key_here"
}
params = {
"page": 0,
"page_size": 20
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
const axios = require('axios');
const response = await axios.get('https://api.p.2chat.io/open/tags', {
params: {
page: 0,
page_size: 20
},
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?page=0&page_size=20',
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)
{
"success": true,
"data": [
{
"uuid": "TAGf83afe08-cbd3-4f8d-b919-1d2fb4c71d13",
"name": "Follow up",
"color": "#EF9F27",
"exclude_from_campaigns": false,
"created_at": "2026-09-14T13:20:41Z",
"updated_at": "2026-09-14T13:20:41Z",
"created_by_user_id": 4809
},
{
"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
}
],
"pagination": {
"page": 0,
"page_size": 20,
"total": 2,
"pages": 1
}
}
| Field | Description |
|---|---|
success | true when the request succeeded |
data | The tags on this page. See the tag object. |
pagination.page | The page returned |
pagination.page_size | Tags per page |
pagination.total | Number of tags in the account |
pagination.pages | Number of pages with the current page_size |
Error (HTTP 400 Bad Request)
{
"success": false,
"error": true,
"error_message": "Payload is invalid. Make sure all required fields are present and with valid values: `page_size` must be between 1 and 50"
}
| Field | Description |
|---|---|
error | true when the request failed |
error_message | What went wrong. A negative page or a page_size outside 1–50 return HTTP 400. |