Get contacts
GET
/v1/contacts
This endpoint allows you to retrieve your contacts list from Protocol. You can optionally filter and paginate the results.
Optional query parameters
page
•integerThe page number for pagination. Defaults to 1.
per_page
•integerNumber of contacts per page. Defaults to 20, maximum is 100.
username
•stringFilter contacts by username.
Request example
fetch('https://api.protocol.chat/v1/contacts', {
headers: {
'Authorization': 'Bearer {token}'
}
})
{
"data": [
{
"id": "WAz8eIbvDR60rouK",
"username": "johndoe",
"phone_number": "+1 (555) 123-4567",
"avatar_url": "https://assets.protocol.chat/avatars/johndoe.jpg",
"display_name": "John Doe",
"created_at": 692233200
},
{
"id": "hSIhXBhNe8X1d8Et"
// ... more contacts
}
],
"pagination": {
"total": 35,
"per_page": 20,
"current_page": 1,
"total_pages": 2
}
}