Skip to content

Delete guest

Endpoint

DELETE /organizations/{org_id}/guests/{guest_email}

This endpoint removes a guest user record from your Tallyfy organization, identified by their email address. This action prevents the guest from accessing any further tasks or information within this organization.

Request

Replace {org_id} with your Organization ID and {guest_email} with the URL-encoded email address of the guest to remove.

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 guestEmail = "guest.to.delete@example.com";
const encodedEmail = encodeURIComponent(guestEmail); // Ensure email is URL encoded
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 => {
// Check for successful status codes (200, 201, 204)
if (response.status === 200 || response.status === 201 || response.status === 204) {
console.log(`Successfully deleted guest ${guestEmail}. Status: ${response.status}`);
// Attempt to parse JSON only if not 204
if (response.status !== 204) {
return response.json().catch(e => {
console.warn("Could not parse JSON response for success status:", e);
return null; // Continue successfully but without data
});
}
return null; // For 204 No Content
} else {
// Try to parse error JSON, fallback to text
return response.json()
.catch(() => response.text()) // If JSON parse fails
.then(errData => {
console.error(`Failed to delete guest ${guestEmail}. Status: ${response.status}`, errData);
throw new Error(`HTTP error! status: ${response.status}`);
});
}
})
.then(data => {
if (data) { // Only log if data was parsed (i.e., status 200 or 201 with body)
console.log('Deleted guest details (if returned):');
console.log(JSON.stringify(data, null, 2));
}
})
.catch(error => {
console.error(`Error during deletion of guest ${guestEmail}:`, error.message);
});

Response

A successful deletion might return 201 Created, 200 OK, or 204 No Content.

  • If 201 or 200, the body might contain the details of the deleted guest record.
  • If 204, there is no response body.

If the guest email is not found in your Tallyfy organization, a 404 Not Found error will be returned.


Guests > Get guest

This endpoint retrieves specific guest user details from a Tallyfy organization by making a GET request with the guest’s URL-encoded email address and optional query parameters for including related data like statistics.

Guests > Create guest

This API endpoint creates new guest user records within a Tallyfy organization by sending a POST request with required email address and optional details like name and company information then returning the created guest data or an error if the email already exists.

Guests > Update guest

This endpoint enables updating existing guest user information in a Tallyfy organization by sending a PUT request with the guest’s URL-encoded email address and a JSON payload containing modifiable fields like name phone and company details.

Groups > Delete group

A DELETE endpoint removes organizational groups while maintaining individual member and guest accounts by requiring authentication headers and returning status codes 200 or 204 upon successful deletion.