Skip to content

Get group

Endpoint

GET /organizations/{org_id}/groups/{group_id}

This endpoint retrieves the details for a single group identified by its unique ID.

Request

Replace {org_id} with your Organization ID and {group_id} with the specific ID of the group you want to retrieve.

Headers

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

Query Parameters (Optional)

  • with (string): Include additional related data, e.g., assets (for group logo).

Code Samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const groupId = 'GROUP_ID_TO_GET'; // ID of the group
const queryParams = '?with=assets'; // Example
const apiUrl = `https://api.tallyfy.com/organizations/${orgId}/groups/${groupId}${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 retrieved group ${groupId}:`);
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error(`Error getting group ${groupId}:`, error);
});

Response

A successful request returns a 200 OK status code and a JSON object containing a data field with the group’s details.

{
"data": {
"id": "GROUP_ID_TO_GET",
"name": "Sales Team",
"description": "Handles all sales inquiries.",
"logo": "https://.../group_logo.png", // Included if requested with 'with=assets'
"members": [1001, 1005],
"guests": ["client.a@example.com"],
"created_at": "2023-03-10T09:00:00Z",
"updated_at": "2024-04-20T10:00:00Z",
"deleted_at": null
}
}

If the group ID is not found or you lack permission, a 404 Not Found or 403 Forbidden error will be returned.