List account users
Agent Skill
Automate this endpoint with an AI agent using the 2chat-users skill:
npx skills add 2ChatCo/agent-skills -s 2chat-users
This endpoint returns the active users that belong to the 2Chat account associated with your API key. It's the canonical way to discover user UUIDs — for example, when minting per-user JWTs for the Voice SDK.
Only users with status ACTIVE are returned. Pending invites, suspended users, and deleted users are filtered out.
Endpoint
GET https://api.p.2chat.io/open/users
Authentication
Include your API key in the X-User-API-Key header. Learn more about authentication.
Parameters
This endpoint takes no parameters.
Invocation
- cURL
- Python
- JavaScript
- PHP
curl --location --request GET 'https://api.p.2chat.io/open/users' \
--header 'X-User-API-Key: your_api_key_here'
import requests
url = "https://api.p.2chat.io/open/users"
headers = {
"X-User-API-Key": "your_api_key_here"
}
response = requests.get(url, headers=headers)
print(response.json())
const axios = require('axios');
const response = await axios.get('https://api.p.2chat.io/open/users', {
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/users',
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": {
"users": [
{
"uuid": "USR4f1c8a73-2e91-4d6b-9c44-1a72bfe0d521",
"first_name": "Ada",
"last_name": "Lovelace",
"email": "ada@example.com"
},
{
"uuid": "USRb2d7e6c0-5f3a-4811-87ce-c9d208a1f4e2",
"first_name": "Grace",
"last_name": "Hopper",
"email": "grace@example.com"
}
]
}
}
| Field | Description |
|---|---|
success | true when the request was successful |
data.users | Array of active users on the account |
data.users[].uuid | The user's UUID — use this when minting per-user JWTs |
data.users[].first_name | The user's first name |
data.users[].last_name | The user's last name |
data.users[].email | The user's email address |
Error
{
"success": false,
"error": true,
"error_message": "Description of what went wrong"
}
| Field | Description |
|---|---|
error | true when the request failed |
error_message | A description of what went wrong |