Skip to content

Update guest

Endpoint

PUT /organizations/{org_id}/guests/{guest_email}

This endpoint updates the details for an existing guest user, identified by their email address.

Request

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

Headers

  • Authorization: Bearer {your_access_token}
  • Accept: application/json
  • X-Tallyfy-Client: APIClient
  • Content-Type: application/json

Body (JSON)

The request body requires a JSON object containing the guest detail fields you wish to modify.

Refer to the #definitions/createGuestInput schema in Swagger (often the same as creation) for available fields like:

  • first_name (string)
  • last_name (string)
  • phone_1 / phone_2 (string)
  • company_name (string)
  • timezone (string)
  • associated_members (array of integers) - Note: Check if this replaces or appends.

Example Body:

{
"first_name": "UpdatedFirstName",
"company_name": "New Company Name Ltd.",
"phone_1": "+441234567890"
}

Code Samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const guestEmail = "guest.to.update@example.com";
const encodedEmail = encodeURIComponent(guestEmail);
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/guests/${encodedEmail}`;
const updateData = {
first_name: "Guesty",
last_name: "McGuestface",
company_name: "Updated Guest Corp"
};
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('Accept', 'application/json');
headers.append('X-Tallyfy-Client', 'APIClient');
headers.append('Content-Type', 'application/json');
fetch(apiUrl, {
method: 'PUT',
headers: headers,
body: JSON.stringify(updateData)
})
.then(response => {
if (!response.ok) {
// Error handling...
return response.json().then(errData => { throw new Error(/*...*/); }).catch(() => { throw new Error(/*...*/); });
}
return response.json();
})
.then(data => {
console.log(`Successfully updated guest ${guestEmail}:`);
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error(`Error updating guest ${guestEmail}:`, error);
});

Response

A successful request returns a 200 OK status code and a JSON object containing the full details of the guest after the update.

{
"data": {
"id": "guest_code_abc123",
"email": "guest.to.update@example.com",
"details": {
"first_name": "Guesty", // Updated value
"last_name": "McGuestface", // Updated value
"company_name": "Updated Guest Corp", // Updated value
// ... other details ...
"updated_at": "2024-05-21T17:00:00Z" // Reflects update time
}
}
}

If the guest email is not found or the payload is invalid, an appropriate error status code (404, 400, 422) will be returned.