Skip to content

Update group

Endpoint

PUT /organizations/{org_id}/groups/{group_id}

This endpoint updates the details (name, description) and/or the membership (members, guests) of an existing group.

Request

Replace {org_id} with your Organization ID and {group_id} with the ID of the group to update.

Headers

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

Body (JSON)

The request body requires a JSON object containing the group properties you wish to modify. You only need to include the fields you want to change.

Refer to the #definitions/createGroupInput schema (often similar to update) in Swagger. Key fields:

  • name (string): New name for the group.
  • description (string): New description.
  • members (array of integers): Replaces the current list of member IDs in the group.
  • guests (array of strings): Replaces the current list of guest emails in the group.

Example Body (Updating name and members):

{
"name": "Project Alpha Core Team",
"members": [1001, 1008, 1010] // User 1005 removed, 1008/1010 added
}

Code samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const groupId = 'GROUP_ID_TO_UPDATE';
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/groups/${groupId}`;
const updateData = {
description: "Updated team description.",
// Example: Set specific members (replaces existing list)
members: [1001, 1003, 1005], // Use actual member IDs
guests: [] // Example: Remove all guests from this group
};
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('Accept', 'application/json');
headers.append('X-Tallyfy-Client', 'APIClient');
headers.append('Content-Type', 'application/json');
fetch(apiUrl, {
method: 'PUT',
headers: headers,
body: JSON.stringify(updateData)
})
.then(response => {
return response.json().then(data => { // Attempt to parse JSON regardless of status
if (!response.ok) {
console.error(`Failed to update group ${groupId}:`, data);
throw new Error(`HTTP error! status: ${response.status}`);
}
return data; // Pass successful data along
});
})
.then(data => {
console.log(`Successfully updated group ${groupId}:`);
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error(`Error updating group ${groupId}:`, error.message);
});

Response

A successful request returns a 200 OK status code and a JSON object containing the full details of the group after the update.

{
"data": {
"id": "GROUP_ID_TO_UPDATE",
"name": "Project Alpha Core Team", // Updated name
"description": "Updated team description.", // Updated description
"members": [1001, 1008, 1010], // Updated members list
"guests": [], // Updated guests list
// ... other group properties ...
"updated_at": "2024-05-21T19:00:00Z" // Reflects update time
}
}

If the group ID is not found, you lack permission, or the request body is invalid, an appropriate error status code (404, 403, 400, 422) will be returned.


Groups > Create group

A POST endpoint that creates organizational groups by accepting JSON data containing group name description members and guests while providing code samples in multiple programming languages and returning the newly created group details.

Guests > Update guest

The PUT endpoint allows modification of existing guest user details through their email address with updated information like name phone and company details while maintaining the original email address.

Members > Update member

A PUT endpoint that modifies organization member profiles by accepting JSON data containing updated fields and returning the complete updated profile upon success.

Tags > Update tag

The PUT endpoint enables updating an existing tag’s properties like title and color within an organization by sending a JSON request with the new values and receiving the updated tag details in response.