---
title: Update guest · Tallyfy Pro
description: Tallyfy's PUT endpoint at `/organizations/{org_id}/guests/{guest_email}` updates the `associated_members` field for an existing guest. Send an array of member IDs to get back the full guest record with a 201 status.
lastUpdated: 2026-10-01T00:00:00.000Z
source_url:
  html: https://tallyfy.com/products/pro/integrations/open-api/code-samples/guests/update-guest/
  md: https://tallyfy.com/products/pro/integrations/open-api/code-samples/guests/update-guest/index.md
---

## Endpoint

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

Updates the `associated_members` for an existing guest in your organization, 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.

### Headers

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

### Body (JSON)

| Field | Type | Required | Description |
| - | - | - | - |
| `associated_members` | array of integers | No | Array of organization member IDs to associate with this guest. Replaces the current list. |

Limited updatable fields

This endpoint only updates the `associated_members` field on the organization-guest relationship. Fields like `first_name`, `last_name`, `company_name`, and `phone_1` aren’t updatable through this endpoint. Set those when creating the guest instead.

**Example body:**

```json
{
  "associated_members": [1234, 5678]
}
```

Note

You can’t change a guest’s email address through this endpoint. To change a guest’s email, delete the old guest record and create a new one.

### Code samples

* Javascript

  ```javascript
  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 = {
    associated_members: [1234, 5678]
  };


  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 => {
      return response.json().then(data => {
          if (!response.ok) {
              console.error(`Failed to update guest ${guestEmail}:`, data);
              throw new Error(`HTTP error! status: ${response.status}`);
          }
          return data;
      });
  })
  .then(data => {
      console.log(`Successfully updated guest ${guestEmail}:`);
      console.log(JSON.stringify(data, null, 2));
  })
  .catch(error => {
      console.error(`Error updating guest ${guestEmail}:`, error.message);
  });
  ```

* Python

  ```python
  import requests
  import json
  import os
  from urllib.parse import quote


  access_token = os.environ.get('TALLYFY_ACCESS_TOKEN', 'YOUR_PERSONAL_ACCESS_TOKEN')
  org_id = os.environ.get('TALLYFY_ORG_ID', 'YOUR_ORGANIZATION_ID')
  guest_email = "guest.to.update@example.com"
  encoded_email = quote(guest_email)
  api_url = f'https://go.tallyfy.com/api/organizations/{org_id}/guests/{encoded_email}'


  headers = {
      'Authorization': f'Bearer {access_token}',
      'Accept': 'application/json',
      'X-Tallyfy-Client': 'APIClient',
      'Content-Type': 'application/json'
  }


  update_payload = {
      'associated_members': [1234, 5678]
  }


  response = None
  try:
      response = requests.put(api_url, headers=headers, json=update_payload)
      response.raise_for_status()


      updated_guest = response.json()
      print(f'Successfully updated guest {guest_email}:')
      print(json.dumps(updated_guest, indent=4))


  except requests.exceptions.HTTPError as http_err:
      print(f"HTTP error updating guest {guest_email}: {http_err}")
      if response is not None:
          print(f"Response Body: {response.text}")
  except requests.exceptions.RequestException as req_err:
      print(f"Request failed updating guest {guest_email}: {req_err}")
  except json.JSONDecodeError:
      print(f"Failed to decode JSON response for guest update {guest_email}")
      if response is not None:
          print(f"Response Text: {response.text}")
  ```

* Java

  ```java
  import java.net.URI;
  import java.net.URLEncoder;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.io.IOException;
  import java.nio.charset.StandardCharsets;


  public class UpdateGuest {
      public static void main(String[] args) {
          String accessToken = System.getenv().getOrDefault("TALLYFY_ACCESS_TOKEN", "YOUR_PERSONAL_ACCESS_TOKEN");
          String orgId = System.getenv().getOrDefault("TALLYFY_ORG_ID", "YOUR_ORGANIZATION_ID");
          String guestEmail = "guest.to.update@example.com";
          String encodedEmail = URLEncoder.encode(guestEmail, StandardCharsets.UTF_8);
          String apiUrl = String.format("https://go.tallyfy.com/api/organizations/%s/guests/%s", orgId, encodedEmail);


          String jsonPayload = "{\"associated_members\": [1234, 5678]}";


          HttpClient client = HttpClient.newHttpClient();
          HttpRequest request = HttpRequest.newBuilder()
                  .uri(URI.create(apiUrl))
                  .header("Authorization", "Bearer " + accessToken)
                  .header("Accept", "application/json")
                  .header("X-Tallyfy-Client", "APIClient")
                  .header("Content-Type", "application/json")
                  .PUT(HttpRequest.BodyPublishers.ofString(jsonPayload))
                  .build();


          try {
              HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());


              if (response.statusCode() == 201) {
                  System.out.println("Successfully updated guest " + guestEmail + ":");
                  System.out.println(response.body());
              } else {
                  System.err.println("Failed to update guest " + guestEmail + ". Status: " + response.statusCode());
                  System.err.println("Response Body: " + response.body());
              }
          } catch (IOException | InterruptedException e) {
              System.err.println("Request failed: " + e.getMessage());
              Thread.currentThread().interrupt();
          }
      }
  }
  ```

* Go

  ```go
  package main


  import (
    "bytes"
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
    "net/url"
    "os"
    "time"
  )


  func main() {
    accessToken := os.Getenv("TALLYFY_ACCESS_TOKEN")
    if accessToken == "" { accessToken = "YOUR_PERSONAL_ACCESS_TOKEN" }
    orgId := os.Getenv("TALLYFY_ORG_ID")
    if orgId == "" { orgId = "YOUR_ORGANIZATION_ID" }
    guestEmail := "guest.to.update@example.com"
    encodedEmail := url.PathEscape(guestEmail)
    apiUrl := fmt.Sprintf("https://go.tallyfy.com/api/organizations/%s/guests/%s", orgId, encodedEmail)


    updateData := map[string]interface{}{
      "associated_members": []int{1234, 5678},
    }


    jsonData, err := json.Marshal(updateData)
    if err != nil {
      fmt.Printf("Error marshalling JSON: %v\n", err)
      return
    }


    client := &http.Client{Timeout: 15 * time.Second}
    req, err := http.NewRequest(http.MethodPut, apiUrl, bytes.NewBuffer(jsonData))
    if err != nil {
      fmt.Printf("Error creating request for %s: %v\n", guestEmail, err)
      return
    }


    req.Header.Set("Authorization", "Bearer "+accessToken)
    req.Header.Set("Accept", "application/json")
    req.Header.Set("X-Tallyfy-Client", "APIClient")
    req.Header.Set("Content-Type", "application/json")


    resp, err := client.Do(req)
    if err != nil {
      fmt.Printf("Error executing request for %s: %v\n", guestEmail, err)
      return
    }
    defer resp.Body.Close()


    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
      fmt.Printf("Error reading response body for %s: %v\n", guestEmail, err)
      return
    }


    if resp.StatusCode != http.StatusCreated {
      fmt.Printf("Failed to update guest %s. Status: %d\nBody: %s\n", guestEmail, resp.StatusCode, string(body))
      return
    }


    fmt.Printf("Successfully updated guest %s:\n", guestEmail)
    var prettyJSON bytes.Buffer
    if err := json.Indent(&prettyJSON, body, "", "  "); err == nil {
      fmt.Println(prettyJSON.String())
    } else {
      fmt.Println(string(body))
    }
  }
  ```

* C++

  ```cpp
  #include <iostream>
  #include <string>
  #include <cpprest/http_client.h>
  #include <cpprest/json.h>


  using namespace web;
  using namespace web::http;
  using namespace web::http::client;
  using namespace web::json;


  pplx::task<void> UpdateTallyfyGuest(const utility::string_t& guestEmail, const value& updatePayload)
  {
      utility::string_t accessToken = U("YOUR_PERSONAL_ACCESS_TOKEN");
      utility::string_t orgId = U("YOUR_ORGANIZATION_ID");
      utility::string_t encodedEmail = uri::encode_uri(guestEmail, uri::components::path);
      utility::string_t apiUrl = U("https://go.tallyfy.com/api/organizations/") + orgId + U("/guests/") + encodedEmail;


      http_client client(apiUrl);
      http_request request(methods::PUT);


      request.headers().add(U("Authorization"), U("Bearer ") + accessToken);
      request.headers().add(U("Accept"), U("application/json"));
      request.headers().add(U("X-Tallyfy-Client"), U("APIClient"));
      request.headers().set_content_type(U("application/json"));
      request.set_body(updatePayload);


      return client.request(request).then([guestEmail](http_response response)
      {
          utility::string_t emailW = guestEmail;
          return response.extract_json().then([response, emailW](pplx::task<value> task)
          {
              try {
                  value const & body = task.get();
                  if (response.status_code() == status_codes::Created) {
                      std::wcout << L"Successfully updated guest " << emailW << L":\n" << body.serialize() << std::endl;
                  } else {
                      std::wcerr << L"Failed to update guest " << emailW << L". Status: " << response.status_code() << L"\nResponse: " << body.serialize() << std::endl;
                  }
              } catch (const http_exception& e) {
                  std::wcerr << L"HTTP exception: " << e.what() << std::endl;
              } catch (const std::exception& e) {
                  std::wcerr << L"Exception: " << e.what() << std::endl;
              }
          });
      });
  }


  int main() {
      try {
          value payload = value::object();
          value members = value::array();
          members[0] = value::number(1234);
          members[1] = value::number(5678);
          payload[U("associated_members")] = members;


          UpdateTallyfyGuest(U("guest.to.update@example.com"), payload).wait();
      } catch (const std::exception &e) {
          std::cerr << "Error: " << e.what() << std::endl;
      }
      return 0;
  }
  // Requires C++ REST SDK (Casablanca).
  ```

* C#

  ```csharp
  using System;
  using System.Collections.Generic;
  using System.Net.Http;
  using System.Net.Http.Headers;
  using System.Text;
  using System.Text.Json;
  using System.Threading.Tasks;
  using System.Web;


  public class TallyfyGuestUpdater
  {
      private static readonly HttpClient client = new HttpClient();


      public class GuestUpdatePayload
      {
          public List<int> AssociatedMembers { get; set; }
      }


      public static async Task UpdateGuestAsync(string guestEmail, GuestUpdatePayload payload)
      {
          var accessToken = Environment.GetEnvironmentVariable("TALLYFY_ACCESS_TOKEN") ?? "YOUR_PERSONAL_ACCESS_TOKEN";
          var orgId = Environment.GetEnvironmentVariable("TALLYFY_ORG_ID") ?? "YOUR_ORGANIZATION_ID";
          var encodedEmail = HttpUtility.UrlPathEncode(guestEmail);
          var apiUrl = $"https://go.tallyfy.com/api/organizations/{orgId}/guests/{encodedEmail}";


          try
          {
              using var request = new HttpRequestMessage(HttpMethod.Put, apiUrl);
              request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
              request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
              request.Headers.Add("X-Tallyfy-Client", "APIClient");


              var options = new JsonSerializerOptions {
                  DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull
              };
              string jsonPayload = JsonSerializer.Serialize(payload, options);
              request.Content = new StringContent(jsonPayload, Encoding.UTF8, "application/json");


              HttpResponseMessage response = await client.SendAsync(request);
              string responseBody = await response.Content.ReadAsStringAsync();


              if (response.StatusCode == System.Net.HttpStatusCode.Created) // 201
              {
                  Console.WriteLine($"Successfully updated guest {guestEmail}:");
                  try {
                      using var doc = JsonDocument.Parse(responseBody);
                      Console.WriteLine(JsonSerializer.Serialize(doc.RootElement, new JsonSerializerOptions { WriteIndented = true }));
                  } catch (JsonException) {
                      Console.WriteLine(responseBody);
                  }
              }
              else
              {
                  Console.WriteLine($"Failed to update guest {guestEmail}. Status: {response.StatusCode}");
                  Console.WriteLine($"Response: {responseBody}");
              }
          }
          catch (HttpRequestException e)
          {
              Console.WriteLine($"Request exception updating guest {guestEmail}: {e.Message}");
          }
          catch (JsonException jsonEx)
          {
              Console.WriteLine($"JSON serialization error: {jsonEx.Message}");
          }
      }


      // Example usage:
      // static async Task Main(string[] args)
      // {
      //     var update = new GuestUpdatePayload {
      //         AssociatedMembers = new List<int> { 1234, 5678 }
      //     };
      //     await UpdateGuestAsync("guest.to.update@example.com", update);
      // }
  }
  ```

## Response

A successful request returns a `201 Created` status and a JSON object with the full guest record after the update.

```json
{
  "data": {
    "id": 1234,
    "email": "guest.to.update@example.com",
    "last_accessed_at": "2024-06-15T10:30:00Z",
    "last_known_ip": "203.0.113.42",
    "last_known_country": "US",
    "details": {
      "status": "active",
      "phone_1": "+15551234567",
      "phone_2": null,
      "timezone": "America/Chicago",
      "image_url": null,
      "contact_url": null,
      "company_url": null,
      "opportunity_url": null,
      "company_name": "Acme Corp",
      "opportunity_name": null,
      "external_sync_source": null,
      "external_date_creation": null,
      "cadence_days": null,
      "associated_members": [1234, 5678],
      "last_city": "Chicago",
      "last_country": "US",
      "last_accessed_at": "2024-06-15T10:30:00Z",
      "disabled_at": null,
      "disabled_by": null,
      "reactivated_at": null,
      "reactivated_by": null
    },
    "first_name": "Jane",
    "last_name": "Doe",
    "created_at": "2024-01-10T09:00:00Z",
    "deleted_at": null,
    "link": "https://go.tallyfy.com/..."
  }
}
```

If the guest email isn’t found, you’ll get a `404` error. Invalid payloads return `422`.

***

## Related articles

[**Code Samples > Managing guests**](https://tallyfy.com/products/pro/integrations/open-api/code-samples/guests/)

Tallyfy’s API lets you manage external guest users who participate in tasks without full…

[**Groups > Update group**](https://tallyfy.com/products/pro/integrations/open-api/code-samples/groups/update-group/)

Tallyfy’s PUT endpoint for groups lets you rename a group or change its description and fully…

[**Guests > Create guest**](https://tallyfy.com/products/pro/integrations/open-api/code-samples/guests/create-guest/)

Tallyfy’s API lets you add external guests to your organization via a POST request with just an…

[**Guests > Delete guest**](https://tallyfy.com/products/pro/integrations/open-api/code-samples/guests/delete-guest/)

Tallyfy’s DELETE endpoint at `/organizations/[org_id]/guests/[guest_email]` removes a guest by…
