Skip to content

List guests

Endpoint

GET /organizations/{org_id}/guests

This endpoint retrieves a list of guest users associated with 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 additional data, e.g., stats.
  • Pagination parameters (page, per_page) may also be available.

Code Samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const queryParams = ''; // e.g., '?with=stats'
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/guests${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 guests:');
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error('Error listing guests:', error);
});

Response

A successful request returns a 200 OK status code and a JSON object containing a data array. Each element represents a guest associated with the organization.

{
"data": [
{
"id": "guest_code_abc123", // Unique guest code/identifier
"email": "guest.user@external.com",
"last_accessed_at": "2024-05-15T10:00:00Z",
"last_known_ip": "192.0.2.1",
"last_known_country": "US",
"details": {
"first_name": "External",
"last_name": "Collaborator",
"status": "active", // Can be active, disabled
"phone_1": null,
"company_name": "External Inc.",
"timezone": "UTC",
"disabled_on": null,
"disabled_by": null,
// ... other detail fields ...
},
// Included if requested with 'with=stats'
"stats": {
"active_tasks": 2,
"completed_tasks": 5
// ... other stats ...
}
},
{
"id": "guest_code_def456",
"email": "another.guest@domain.com",
// ... details ...
}
]
// Potential meta object for pagination if supported
}