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);
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 => {
// Expect 201 or potentially 200/204 for successful deletion
if (response.status === 201 || response.status === 200 || response.status === 204) {
console.log(`Successfully deleted guest ${guestEmail}. Status: ${response.status}`);
// Body might be empty or contain the deleted guest record
if (response.status !== 204) {
return response.json(); // Attempt to parse if not 204
}
return null;
} else {
// Error handling...
return response.json().then(errData => { throw new Error(/*...*/); }).catch(() => { throw new Error(/*...*/); });
}
})
.then(data => {
if (data) {
console.log('Deleted guest details (if returned):');
console.log(JSON.stringify(data, null, 2));
}
})
.catch(error => {
console.error(`Error deleting guest ${guestEmail}:`, error);
});

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.