Skip to content

List members

Endpoint

GET /organizations/{org_id}/users

This endpoint retrieves a list of registered members (users) within the specified organization.

Request

Replace {org_id} with your Organization ID.

Headers

  • Authorization: Bearer {your_access_token}
  • Accept: application/json
  • X-Tallyfy-Client: APIClient

Query Parameters (Optional)

  • with (string): Include related data, e.g., groups.
  • Pagination parameters (page, per_page) may also be available (check Swagger).

Code Samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const queryParams = '?with=groups'; // Example: Include group info
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/users${queryParams}`;
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('Accept', 'application/json');
headers.append('X-Tallyfy-Client', 'APIClient');
fetch(apiUrl, {
method: 'GET',
headers: headers
})
.then(response => {
if (!response.ok) {
// Error handling...
return response.json().then(errData => { throw new Error(/*...*/); }).catch(() => { throw new Error(/*...*/); });
}
return response.json();
})
.then(data => {
console.log('Successfully listed members:');
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error('Error listing members:', error);
});

Response

A successful request returns a 200 OK status code and a JSON object containing a data array. Each element in the array represents a member user.

{
"data": [
{
"id": 1001,
"email": "alice@example.com",
"username": "alice",
"first_name": "Alice",
"last_name": "Smith",
"full_name": "Alice Smith",
"profile_pic": "https://.../profile.jpg",
"active": true,
"is_suspended": false,
"created_at": "2023-01-15T09:00:00Z",
"last_updated": "2024-05-10T11:00:00Z",
"last_login_at": "2024-05-20T10:30:00Z",
"status": "active",
"user_role": "Admin", // Role within the current organization
// Included if requested with 'with=groups':
"groups": [
{ "id": "group_id_1", "name": "Sales Team" },
{ "id": "group_id_2", "name": "Support" }
]
// ... other user properties ...
},
{
"id": 1002,
"email": "bob@example.com",
// ... details for another member ...
}
]
// Potential meta object for pagination if supported
}