Customer Users
List Users Search and retrieve customer users
GET https://api.perform.chat/rest/v1/customer-users
{
"keyId" : "your-key-id" ,
"keySecret" : "your-key-secret" ,
"name" : "John" , // Optional: filter by name
"email" : "john@example.com" , // Optional: filter by email
"external_id" : "user_123" // Optional: filter by your user ID
}
Parameter Type Default Description pagenumber 1 Page number limitnumber 20 Items per page (max 100)
{
"data" : [
{
"id" : "cu_123" ,
"external_id" : "user_123" ,
"name" : "John Doe" ,
"email" : "john@example.com" ,
"metadata" : {
"plan" : "premium" ,
"country" : "US"
},
"active" : true ,
"created_at" : "2025-01-10T08:20:00Z" ,
"last_seen_at" : "2025-01-15T14:30:00Z"
}
],
"pagination" : {
"page" : 1 ,
"limit" : 20 ,
"total" : 150 ,
"total_pages" : 8
}
}
Field Type Description idstring Internal customer user ID external_idstring Your system's user ID namestring User's display name emailstring User's email address metadataobject Custom JSON data activeboolean Whether user is active created_atstring ISO 8601 timestamp of creation last_seen_atstring ISO 8601 timestamp of last activity
async function listCustomerUsers ( page = 1 , limit = 20 ) {
const response = await axios. get (
'https://api.performchat.com/rest/v1/v1/customer-users' ,
{
params: { page, limit },
data: {
keyId: process.env. API_KEY_ID ,
keySecret: process.env. API_KEY_SECRET
}
}
)
return response.data
}
async function findUserByEmail ( email ) {
const response = await axios. get (
'https://api.performchat.com/rest/v1/v1/customer-users' ,
{
params: { page: 1 , limit: 1 },
data: {
keyId: process.env. API_KEY_ID ,
keySecret: process.env. API_KEY_SECRET ,
email: email
}
}
)
return response.data.data[ 0 ] || null
}
async function findUserByExternalId ( externalId ) {
const response = await axios. get (
'https://api.performchat.com/rest/v1/v1/customer-users' ,
{
params: { page: 1 , limit: 1 },
data: {
keyId: process.env. API_KEY_ID ,
keySecret: process.env. API_KEY_SECRET ,
external_id: externalId
}
}
)
return response.data.data[ 0 ] || null
}
Status Description 401 Invalid API credentials 400 Invalid query parameters 500 Internal server error
Use external_id for lookups - Fastest way to find specific users
Cache user data - Reduce API calls by caching user information
Limit search scope - Use specific filters to reduce result size
Handle pagination - Use appropriate page sizes for your use case