Skip to content

Delete guest

Endpoint

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

This endpoint removes a guest user record from the organization, identified by their email address. This action likely 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, a 404 Not Found error will be returned.


Guests > Get guest

A GET endpoint that retrieves specific guest user details within an organization using their email address while supporting multiple programming languages and optional query parameters for additional data inclusion.

Guests > Create guest

The POST endpoint creates guest users in an organization by accepting JSON data with required email and optional fields like name and company details while returning the newly created guest’s information upon success.

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.

Guests > List guests

The GET endpoint retrieves guest users from an organization with their details like email access history location information and optional statistics using various programming languages through authenticated API requests.