Skip to content

Delete group

Endpoint

DELETE /organizations/{org_id}/groups/{group_id}

This endpoint deletes an existing group from the organization. This typically does not delete the members or guests themselves, only the group association.

Request

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

Headers

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

Body

No request body is needed for this DELETE request.

Code Samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const groupId = 'GROUP_ID_TO_DELETE';
const apiUrl = `https://api.tallyfy.com/organizations/${orgId}/groups/${groupId}`;
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('Accept', 'application/json');
headers.append('X-Tallyfy-Client', 'APIClient');
fetch(apiUrl, {
method: 'DELETE',
headers: headers
})
.then(response => {
// Expect 200 OK or 204 No Content
if (response.status === 200 || response.status === 204) {
console.log(`Successfully deleted group ${groupId}. Status: ${response.status}`);
if (response.status === 200) {
return response.json(); // Might return deleted group details
}
return null;
} else {
// Error handling...
return response.json().then(errData => { throw new Error(/*...*/); }).catch(() => { throw new Error(/*...*/); });
}
})
.then(data => {
if (data) {
console.log('Deleted group details (if returned):');
console.log(JSON.stringify(data, null, 2));
}
})
.catch(error => {
console.error(`Error deleting group ${groupId}:`, error);
});

Response

A successful request typically returns a 200 OK or 204 No Content status code.

  • If 200 OK, the body might contain details of the deleted group.
  • If 204 No Content, the deletion was successful, and there is no response body.

If the group ID is not found, a 404 Not Found error will be returned.