/organizations/[org_id]/guests/[guest_email] with the email URL-encoded and you can optionally include completion statistics by passing the with=stats query parameter. DELETE /organizations/{org_id}/guests/{guest_email}
This endpoint removes a guest from your Tallyfy organization by email address. It detaches the guest from all tasks, removes the org association, and soft-deletes the guest record if they don’t belong to any other organizations.
Replace {org_id} with your organization ID and {guest_email} with the URL-encoded email address of the guest to remove.
Authorization: Bearer {your_access_token}Accept: application/jsonX-Tallyfy-Client: APIClientNo request body is needed.
const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';const orgId = 'YOUR_ORGANIZATION_ID';const guestEmail = "guest.to.delete@example.com";const encodedEmail = encodeURIComponent(guestEmail);const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/guests/${encodedEmail}`;
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.ok) { return response.json(); } else { return response.json().then(errData => { console.error(`Failed to delete guest. Status: ${response.status}`, errData); throw new Error(`HTTP error! status: ${response.status}`); }); }}).then(data => { console.log('Deleted guest details:'); console.log(JSON.stringify(data, null, 2));}).catch(error => { console.error(`Error deleting guest ${guestEmail}:`, error.message);});import requestsimport jsonimport osfrom urllib.parse import quote
access_token = os.environ.get('TALLYFY_ACCESS_TOKEN', 'YOUR_PERSONAL_ACCESS_TOKEN')org_id = os.environ.get('TALLYFY_ORG_ID', 'YOUR_ORGANIZATION_ID')guest_email = "guest.to.delete@example.com"encoded_email = quote(guest_email)api_url = f'https://go.tallyfy.com/api/organizations/{org_id}/guests/{encoded_email}'
headers = { 'Authorization': f'Bearer {access_token}', 'Accept': 'application/json', 'X-Tallyfy-Client': 'APIClient'}
response = requests.delete(api_url, headers=headers)
if response.status_code == 200: print(f'Successfully deleted guest {guest_email}.') print(json.dumps(response.json(), indent=4))else: print(f'Failed to delete guest. Status: {response.status_code}') print(response.text)import java.net.URI;import java.net.URLEncoder;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.io.IOException;import java.nio.charset.StandardCharsets;
public class DeleteGuest { 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 guestEmail = "guest.to.delete@example.com"; String encodedEmail = URLEncoder.encode(guestEmail, StandardCharsets.UTF_8); String apiUrl = String.format("https://go.tallyfy.com/api/organizations/%s/guests/%s", orgId, encodedEmail);
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 guest " + guestEmail); System.out.println("Response:"); System.out.println(response.body()); } else { System.err.println("Failed to delete guest. Status: " + response.statusCode()); System.err.println("Response: " + response.body()); } } catch (IOException | InterruptedException e) { System.err.println("Request failed: " + e.getMessage()); Thread.currentThread().interrupt(); } }}package main
import ( "fmt" "io" "net/http" "net/url" "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" } email := "guest.to.delete@example.com"
encodedEmail := url.PathEscape(email) apiUrl := fmt.Sprintf("https://go.tallyfy.com/api/organizations/%s/guests/%s", orgId, encodedEmail)
client := &http.Client{Timeout: 15 * time.Second} req, err := http.NewRequest(http.MethodDelete, apiUrl, nil) if err != nil { fmt.Printf("Error creating request: %v\n", 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: %v\n", err) return } defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode == http.StatusOK { fmt.Printf("Successfully deleted guest %s\n", email) fmt.Println(string(body)) } else { fmt.Printf("Failed to delete guest. Status: %d\nBody: %s\n", 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;
pplx::task<void> DeleteTallyfyGuest(const utility::string_t& guestEmail){ utility::string_t accessToken = U("YOUR_PERSONAL_ACCESS_TOKEN"); utility::string_t orgId = U("YOUR_ORGANIZATION_ID"); utility::string_t encodedEmail = uri::encode_data_string(guestEmail); utility::string_t apiUrl = U("https://go.tallyfy.com/api/organizations/") + orgId + U("/guests/") + encodedEmail;
http_client client(apiUrl); http_request request(methods::DEL);
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([guestEmail](http_response response) { status_code status = response.status_code();
if (status == status_codes::OK) { return response.extract_json().then([guestEmail, status](pplx::task<value> task) { try { value const & body = task.get(); std::wcout << L"Successfully deleted guest. Response:\n" << body.serialize() << std::endl; } catch (const http_exception& e) { std::wcout << L"Deleted guest but couldn't parse response: " << e.what() << std::endl; } }); } else { return response.extract_string().then([status, guestEmail](utility::string_t errorBody) { std::wcerr << L"Failed to delete guest. Status: " << status << std::endl; std::wcerr << L"Response: " << errorBody << std::endl; }); } });}
int main() { try { DeleteTallyfyGuest(U("guest.to.delete@example.com")).wait(); } 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;using System.Web;
public class TallyfyGuestDeleter{ private static readonly HttpClient client = new HttpClient();
public static async Task DeleteGuestAsync(string guestEmail) { var accessToken = Environment.GetEnvironmentVariable("TALLYFY_ACCESS_TOKEN") ?? "YOUR_PERSONAL_ACCESS_TOKEN"; var orgId = Environment.GetEnvironmentVariable("TALLYFY_ORG_ID") ?? "YOUR_ORGANIZATION_ID"; var encodedEmail = HttpUtility.UrlEncode(guestEmail); var apiUrl = $"https://go.tallyfy.com/api/organizations/{orgId}/guests/{encodedEmail}";
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();
if (response.IsSuccessStatusCode) { Console.WriteLine($"Successfully deleted guest {guestEmail}."); using var doc = JsonDocument.Parse(responseBody); Console.WriteLine(JsonSerializer.Serialize(doc.RootElement, new JsonSerializerOptions { WriteIndented = true })); } else { Console.WriteLine($"Failed to delete guest. Status: {response.StatusCode}"); Console.WriteLine($"Response: {responseBody}"); } } catch (HttpRequestException e) { Console.WriteLine($"Request exception: {e.Message}"); } }
// static async Task Main(string[] args) // { // await DeleteGuestAsync("guest.to.delete@example.com"); // }}A successful request returns a 200 OK status with the deleted guest’s details wrapped in a data object. The guest is detached from all tasks and removed from the organization. If the guest doesn’t belong to any other organizations, the record is soft-deleted.
If the email isn’t found, you’ll get a 422 validation error since the email must exist in the guests table.
/organizations/[org_id]/guests/[guest_email] with the email URL-encoded and you can optionally include completion statistics by passing the with=stats query parameter. Code Samples > Managing guests
/organizations/[org_id]/guests/[guest_email] lets you update only the associated_members field for an existing guest by sending an array of member IDs and returns the full guest record with a 201 status on success.