Skip to content

Create guest

Endpoint

POST /organizations/{org_id}/guests

This endpoint creates a new guest user record within the specified organization.

Request

Replace {org_id} with your Organization ID.

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 details of the guest to be created.

Refer to the #definitions/createGuestInput schema in Swagger for all available properties. Key fields include:

  • email (string, required): The guest’s email address (must be unique within the org’s guests).
  • first_name (string, optional)
  • last_name (string, optional)
  • phone_1 (string, optional)
  • company_name (string, optional)
  • timezone (string, optional): E.g., Europe/Paris.
  • associated_members (array of integers, optional): User IDs of members associated with this guest.

Minimal Example Body:

{
"email": "new.guest@contractor.com"
}

More Comprehensive Example Body:

{
"email": "client.contact@acme.com",
"first_name": "Client",
"last_name": "Contact",
"company_name": "ACME Corp",
"phone_1": "+1-212-555-0123",
"associated_members": [1001, 1005]
}

Code samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/guests`;
const guestData = {
email: "external.partner@partnerco.com",
first_name: "External",
last_name: "Partner",
company_name: "Partner Co"
};
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: 'POST',
headers: headers,
body: JSON.stringify(guestData)
})
.then(response => {
return response.json().then(data => { // Attempt to parse JSON regardless of status
if (!response.ok) {
console.error("Failed to create guest:", data); // Log error details from JSON body
throw new Error(`HTTP error! status: ${response.status}`);
}
return data; // Pass successful data along
});
})
.then(data => {
console.log('Successfully created guest:');
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error('Error creating guest:', error.message);
});

Response

A successful request returns a 200 OK or 201 Created status code and a JSON object containing the details of the newly created guest.

{
"data": {
"id": "new_guest_code_789", // Unique ID for this guest
"email": "external.partner@partnerco.com",
"last_accessed_at": null,
"details": {
"first_name": "External",
"last_name": "Partner",
"status": "active",
"company_name": "Partner Co",
// ... other details provided or defaulted ...
"created_at": "2024-05-21T16:00:00Z", // Note: Swagger might show this at top level
"updated_at": "2024-05-21T16:00:00Z" // Note: Swagger might show this at top level
}
}
}

If a guest with the provided email already exists, you will likely receive a 422 Unprocessable Entity error.


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 > 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 > Delete guest

A DELETE endpoint that removes guest users from an organization by their email address and returns either a success status code or guest record details upon completion.

Groups > Create group

A POST endpoint that creates organizational groups by accepting JSON data containing group name description members and guests while providing code samples in multiple programming languages and returning the newly created group details.