The DELETE endpoint enables removal of organization members with optional task reassignment capabilities while preserving their global user account status.
Delete group
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.
Replace {org_id}
with your Organization ID and {group_id}
with the ID of the group to delete.
Authorization: Bearer {your_access_token}
Accept: application/json
X-Tallyfy-Client: APIClient
No request body is needed for this DELETE request.
const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';const orgId = 'YOUR_ORGANIZATION_ID';const groupId = 'GROUP_ID_TO_DELETE';const apiUrl = `https://go.tallyfy.com/api/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 => { if (response.status === 200 || response.status === 204) { console.log(`Successfully deleted group ${groupId}. Status: ${response.status}`); if (response.status === 200) { // Try to parse JSON only if status is 200 return response.json().catch(e => { console.warn("Could not parse JSON response for 200 status:", e); return null; // Continue without parsed data }); } return null; // For 204 No Content } else { // Try to parse error JSON, fallback to text return response.json() .catch(() => response.text()) .then(errData => { console.error(`Failed to delete group ${groupId}. Status: ${response.status}`, errData); throw new Error(`HTTP error! status: ${response.status}`); }); }}).then(data => { if (data) { console.log('Deleted group details (if returned):'); console.log(JSON.stringify(data, null, 2)); }}).catch(error => { console.error(`Error during deletion of group ${groupId}:`, error.message);});
import requestsimport jsonimport os
access_token = os.environ.get('TALLYFY_ACCESS_TOKEN', 'YOUR_PERSONAL_ACCESS_TOKEN')org_id = os.environ.get('TALLYFY_ORG_ID', 'YOUR_ORGANIZATION_ID')group_id = 'GROUP_ID_TO_DELETE'api_url = f'https://go.tallyfy.com/api/organizations/{org_id}/groups/{group_id}'
headers = { 'Authorization': f'Bearer {access_token}', 'Accept': 'application/json', 'X-Tallyfy-Client': 'APIClient'}
response = Nonetry: response = requests.delete(api_url, headers=headers)
if response.status_code == 200: print(f'Successfully deleted group {group_id}. Status: {response.status_code}') try: # Attempt to parse JSON if content exists for 200 OK if response.content: deleted_group = response.json() print('Deleted group details:') print(json.dumps(deleted_group, indent=4)) else: print("(Received status 200 but response body is empty)") except json.JSONDecodeError: print(f"(Received status 200 but body not valid JSON: {response.text})") elif response.status_code == 204: print(f'Successfully deleted group {group_id}. Status: 204 No Content') else: # Raise an exception for other non-success status codes response.raise_for_status()
except requests.exceptions.HTTPError as http_err: print(f"HTTP error occurred deleting group {group_id}: {http_err}") if response is not None: print(f"Response Body: {response.text}")except requests.exceptions.RequestException as req_err: print(f"Request failed deleting group {group_id}: {req_err}")except Exception as err: print(f"An unexpected error occurred: {err}")
import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.io.IOException;
public class DeleteGroup { public static void main(String[] args) { String accessToken = System.getenv().getOrDefault("TALLYFY_ACCESS_TOKEN", "YOUR_PERSONAL_ACCESS_TOKEN"); String orgId = System.getenv().getOrDefault("TALLYFY_ORG_ID", "YOUR_ORGANIZATION_ID"); String groupId = "GROUP_ID_TO_DELETE"; String apiUrl = String.format("https://go.tallyfy.com/api/organizations/%s/groups/%s", orgId, groupId);
HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(apiUrl)) .header("Authorization", "Bearer " + accessToken) .header("Accept", "application/json") .header("X-Tallyfy-Client", "APIClient") .DELETE() .build();
try { HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() == 200) { System.out.println("Successfully deleted group " + groupId + ". Status: 200 OK"); if (response.body() != null && !response.body().isEmpty()) { System.out.println("Response Body (Deleted Group Details):"); System.out.println(response.body()); // TODO: Consider parsing JSON using Jackson/Gson } else { System.out.println("(Response body empty for 200 OK)"); } } else if (response.statusCode() == 204) { System.out.println("Successfully deleted group " + groupId + ". Status: 204 No Content"); } else { System.err.println("Failed to delete group " + groupId + ". Status: " + response.statusCode()); System.err.println("Response Body: " + response.body()); } } catch (IOException | InterruptedException e) { System.err.println("Request failed: " + e.getMessage()); Thread.currentThread().interrupt(); } catch (Exception e) { System.err.println("An unexpected error occurred: " + e.getMessage()); e.printStackTrace(); } }}
package main
import ( "fmt" "io/ioutil" "net/http" "os" "time")
func main() { accessToken := os.Getenv("TALLYFY_ACCESS_TOKEN") if accessToken == "" { accessToken = "YOUR_PERSONAL_ACCESS_TOKEN" } orgId := os.Getenv("TALLYFY_ORG_ID") if orgId == "" { orgId = "YOUR_ORGANIZATION_ID" } groupId := "GROUP_ID_TO_DELETE" apiUrl := fmt.Sprintf("https://go.tallyfy.com/api/organizations/%s/groups/%s", orgId, groupId)
client := &http.Client{Timeout: 15 * time.Second} req, err := http.NewRequest(http.MethodDelete, apiUrl, nil) if err != nil { fmt.Printf("Error creating request for group %s: %v\n", groupId, err) return }
req.Header.Set("Authorization", "Bearer "+accessToken) req.Header.Set("Accept", "application/json") req.Header.Set("X-Tallyfy-Client", "APIClient")
resp, err := client.Do(req) if err != nil { fmt.Printf("Error executing request for group %s: %v\n", groupId, err) return } defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body) if err != nil { // This might happen for 204 No Content, but we check status first // fmt.Printf("Error reading response body for group %s: %v\n", groupId, err) }
if resp.StatusCode == http.StatusOK { fmt.Printf("Successfully deleted group %s. Status: %d OK\n", groupId, resp.StatusCode) if len(body) > 0 { fmt.Println("Response Body (Deleted Group Details):") fmt.Println(string(body)) // TODO: Consider unmarshalling JSON: var result map[string]interface{}; json.Unmarshal(body, &result) } else { fmt.Println("(Response body empty for 200 OK)") } } else if resp.StatusCode == http.StatusNoContent { fmt.Printf("Successfully deleted group %s. Status: %d No Content\n", groupId, resp.StatusCode) } else { fmt.Printf("Failed to delete group %s. Status: %d\nBody: %s\n", groupId, resp.StatusCode, string(body)) }}
#include <iostream>#include <string>#include <cpprest/http_client.h>#include <cpprest/json.h>
using namespace web;using namespace web::http;using namespace web::http::client;using namespace web::json;
pplx::task<void> DeleteTallyfyGroup(const utility::string_t& groupId){ utility::string_t accessToken = U("YOUR_PERSONAL_ACCESS_TOKEN"); utility::string_t orgId = U("YOUR_ORGANIZATION_ID"); utility::string_t apiUrl = U("https://go.tallyfy.com/api/organizations/") + orgId + U("/groups/") + groupId;
http_client client(apiUrl); http_request request(methods::DEL); // Use DEL for DELETE method
request.headers().add(U("Authorization"), U("Bearer ") + accessToken); request.headers().add(U("Accept"), U("application/json")); request.headers().add(U("X-Tallyfy-Client"), U("APIClient"));
return client.request(request).then([groupId](http_response response) { utility::string_t groupIdW = groupId; if (response.status_code() == status_codes::OK) { // If 200 OK, try to extract body return response.extract_json().then([groupIdW, response](pplx::task<value> task) { try { value const & body = task.get(); std::wcout << L"Successfully deleted group " << groupIdW << L". Status: " << response.status_code() << L" OK\nResponse Body:\n" << body.serialize() << std::endl; } catch (const http_exception& e) { // Body might be empty or not JSON even for 200? std::wcout << L"Successfully deleted group " << groupIdW << L". Status: " << response.status_code() << L" OK (Body extraction failed: " << e.what() << L")." << std::endl; } }); } else if (response.status_code() == status_codes::NoContent) { std::wcout << L"Successfully deleted group " << groupIdW << L". Status: " << response.status_code() << L" No Content." << std::endl; return pplx::task_from_result(); // Return completed task } else { // Handle error - try extracting body as string return response.extract_string().then([response, groupIdW](utility::string_t errorBody) { std::wcerr << L"Failed to delete group " << groupIdW << L". Status: " << response.status_code() << std::endl; std::wcerr << L"Response Body: " << errorBody << std::endl; throw std::runtime_error("Failed to delete group"); }); } });}
int main() { try { DeleteTallyfyGroup(U("GROUP_ID_TO_DELETE")).wait(); // Replace with actual ID } catch (const std::exception &e) { std::cerr << "Error: " << e.what() << std::endl; } return 0;}// Requires C++ REST SDK (Casablanca)
using System;using System.Net.Http;using System.Net.Http.Headers;using System.Threading.Tasks;using System.Text.Json;
public class TallyfyGroupDeleter{ private static readonly HttpClient client = new HttpClient();
public static async Task DeleteGroupAsync(string groupId) { var accessToken = Environment.GetEnvironmentVariable("TALLYFY_ACCESS_TOKEN") ?? "YOUR_PERSONAL_ACCESS_TOKEN"; var orgId = Environment.GetEnvironmentVariable("TALLYFY_ORG_ID") ?? "YOUR_ORGANIZATION_ID"; var apiUrl = $"https://go.tallyfy.com/api/organizations/{orgId}/groups/{groupId}";
try { using var request = new HttpRequestMessage(HttpMethod.Delete, apiUrl); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); request.Headers.Add("X-Tallyfy-Client", "APIClient");
HttpResponseMessage response = await client.SendAsync(request); string responseBody = await response.Content.ReadAsStringAsync(); // Read body for potential error or 200 OK data
if (response.IsSuccessStatusCode) // Checks for 2xx status codes (200, 204) { Console.WriteLine($"Successfully deleted group {groupId}. Status: {response.StatusCode}"); if (response.StatusCode == System.Net.HttpStatusCode.OK && !string.IsNullOrWhiteSpace(responseBody)) { Console.WriteLine("Deleted group details (if returned):"); // Pretty print JSON try { using var doc = JsonDocument.Parse(responseBody); Console.WriteLine(JsonSerializer.Serialize(doc.RootElement, new JsonSerializerOptions { WriteIndented = true })); } catch (JsonException) { Console.WriteLine(responseBody); } } } else { Console.WriteLine($"Failed to delete group {groupId}. Status: {response.StatusCode}"); Console.WriteLine($"Response: {responseBody}"); } } catch (HttpRequestException e) { Console.WriteLine($"Request Exception deleting group {groupId}: {e.Message}"); } catch (Exception ex) { Console.WriteLine($"An unexpected error occurred: {ex.Message}"); } }
// Example Usage: // static async Task Main(string[] args) // { // await DeleteGroupAsync("GROUP_ID_TO_DELETE"); // }}
A successful request returns a 200 OK
status code and a JSON object containing a data
The GET endpoint allows retrieving detailed information about a specific group within an organization using its unique ID through authenticated API requests with code examples in multiple programming languages.
The GET endpoint allows retrieving organization-specific groups with their details such as IDs names descriptions logos member lists and timestamps through authenticated API requests using various programming languages.
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.
About Tallyfy
- 2025 Tallyfy, Inc.
- Privacy Policy
- Terms of Use
- Report Issue
- Trademarks