Read and Update Event Custom Fields

Workspace custom fields are identified by field_name, such as custom_67890. Each example discovers the available fields, reads an event, updates the intended field and reads the event again to show its saved value.

1. Discover the field

/v1/references/event_custom_fields returns field_name, field_label, field_type, event_tab and is_hidden. Confirm which field you intend to change. The reference list does not include dropdown choices; consult your workspace's field settings and use a configured choice rather than guessing one.

2. Read its current value

/v1/events/info returns custom_fields with each field's label, value and field_name. For an event list, use hydrate_custom_fields=true on /v1/events. The example reads before and after the update so you can compare them.

3. Update and verify

Use the field_name as a parameter of PATCH /v1/events. Custom text, dropdown and URL fields support updates; dropdown values must match a configured choice. JSON null (or the text "null") clears a value. An empty string leaves it unchanged and adds a warning. Other omitted fields remain unchanged.
So that the update cannot overwrite a change someone made after your read, the example reads the event with $include_record_revision=true and sends the returned record_revision as expected_revision with the PATCH. If one of the event's editable fields changed in between, the API saves nothing and answers 409 with error_code record_changed; the example then reads the event again, prints its current values and stops without retrying. If the PATCH gets no response or a server error, it may still have been saved, so the example never sends it again blindly: it reads the event again (with $include_record_revision=true), reports the change as saved if the field already has the new value, sends it once more with the new record_revision only if the field still has its old value, and otherwise reports it as not saved. Treat record_revision as opaque. Leave out expected_revision to update without this check.
Set EXHIBITDAY_API_KEY, EXHIBITDAY_EVENT_ID, EXHIBITDAY_CUSTOM_FIELD (the field_name) and EXHIBITDAY_CUSTOM_VALUE before running the workflow.
Code Samples
#!/usr/bin/env bash
# Requires bash, curl and Python 3. Set EXHIBITDAY_API_KEY.
python3 - <<'EXHIBITDAY_PY'
# Python 3; standard library only. Set EXHIBITDAY_API_KEY before running.
import csv
import datetime
import json
import os
import re
import time
import urllib.error
import urllib.parse
import urllib.request
import uuid
from pathlib import Path

BASE = "https://api.exhibitday.com/v1"
SPEC = json.loads("{\"preserveNumbers\":false,\"requests\":{\"fields\":{\"method\":\"GET\",\"path\":\"/references/event_custom_fields\"},\"event\":{\"method\":\"GET\",\"path\":\"/events/info\"},\"updateEvent\":{\"method\":\"PATCH\",\"path\":\"/events\"},\"events\":{\"method\":\"GET\",\"path\":\"/events\"}}}")
API_KEY = os.environ["EXHIBITDAY_API_KEY"]
if not API_KEY.strip():
    raise RuntimeError("Set EXHIBITDAY_API_KEY")

def decode_json(text):
    if SPEC["preserveNumbers"]:
        # Quote JSON NUMBER tokens, never text inside a JSON string, to keep CSV decimals exact.
        text = re.sub(r'"(?:\\.|[^"\\])*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?',
                      lambda m: m[0] if m[0].startswith('"') else json.dumps(m[0]), text)
    return json.loads(text)

# This terminal version uses curl for HTTP and Python's standard library for JSON/CSV.
import subprocess
import tempfile

def transport(method, url, headers, data):
    with tempfile.TemporaryDirectory(prefix="exhibitday-guide-") as directory:
        folder = Path(directory)
        command = ["curl", "--silent", "--show-error", "--request", method, "--url", url,
                   "--max-time", "30", "--dump-header", str(folder / "headers"),
                   "--output", str(folder / "body"), "--write-out", "%{http_code}"]
        for name, value in headers.items():
            command += ["--header", name + ": " + value]
        if data is not None:
            (folder / "request").write_bytes(data)
            command += ["--data-binary", "@" + str(folder / "request")]
        result = subprocess.run(command, capture_output=True, text=True)
        if result.returncode:
            raise urllib.error.URLError(result.stderr.strip())
        response_headers = {}
        blocks = (folder / "headers").read_text(encoding="iso-8859-1").replace("\r\n", "\n").strip().split("\n\n")
        for line in blocks[-1].splitlines()[1:]:
            name, separator, value = line.partition(":")
            if separator:
                response_headers[name] = value.strip()
        return int(result.stdout), (folder / "body").read_bytes(), response_headers


class ApiError(RuntimeError):
    """An API error response. Branch on error_code (and status), never on the message text.
    uncertain is True when a PATCH or DELETE got no response or a server error: it may or may not have been applied."""
    def __init__(self, status, body, uncertain=False):
        self.status = status
        self.uncertain = uncertain
        self.error_code = body.get("error_code") if isinstance(body, dict) else None
        super().__init__(f"{body.get('error_code')} {body.get('error_params')}: {body.get('errors')} (request {body.get('request_id')})"
                         if isinstance(body, dict) else "HTTP " + str(status) if status else "No response")

def call(name, params=None, body=None, extra_headers=None, key=None):
    route = SPEC["requests"][name]
    headers = {"api_key": API_KEY, "Accept": "application/json", **(extra_headers or {})}
    if route["method"] == "POST":
        headers["Idempotency-Key"] = key or str(uuid.uuid4())  # generated ONCE, before retries
    data = None if body is None else json.dumps(body).encode("utf-8")
    if data is not None:
        headers["Content-Type"] = "application/json"
    query = urllib.parse.urlencode(params or {})
    url = BASE + route["path"] + ("?" + query if query else "")
    # A GET, or a POST with its Idempotency-Key, can be sent again. A PATCH or DELETE that got no response or a
    # server error is never resent blindly: it may already have been applied, so the caller reads the record first.
    resend = route["method"] in ("GET", "POST")
    for attempt in range(5):
        try:
            status, raw, response_headers = transport(route["method"], url, headers, data)
        except (urllib.error.URLError, TimeoutError):
            if not resend:
                raise ApiError(0, None, uncertain=True)
            if attempt == 4:
                raise
            time.sleep(2 ** attempt)
            continue
        response_headers = {k.lower(): v for k, v in response_headers.items()}
        result = None
        if status != 304 and raw:
            try:
                result = decode_json(raw.decode("utf-8"))
            except (ValueError, UnicodeError):
                if status < 400:
                    raise RuntimeError("Expected a JSON success response")
        if status >= 500 and not resend:
            raise ApiError(status, result, uncertain=True)
        retry = status == 429 or status >= 500 or (status == 409 and isinstance(result, dict) and result.get("error_code") == "idempotency_key_in_use")
        if retry:
            if attempt == 4:
                raise RuntimeError("Retry limit reached; check the request outcome before starting a new create")
            delay = response_headers.get("retry-after", str(2 ** attempt))
            time.sleep(max(0, float(delay)))
            continue
        if status >= 400:
            raise ApiError(status, result)
        return {"status": status, "body": result, "headers": response_headers}
    raise RuntimeError("Retry limit reached")

def pages(name, params=None):
    offset = 0
    while True:
        page = call(name, {**(params or {}), "$limit": 100, "$offset": offset})["body"]
        yield from page["list_data"]
        if not page["has_more"]:
            break
        count = int(page["records_found"])
        if count <= 0:
            raise RuntimeError("Server returned an empty page with has_more=true")
        offset += count

def load_json(path, fallback):
    return json.loads(path.read_text(encoding="utf-8")) if path.exists() else fallback

def save_json(path, value):
    temp = path.with_name(path.name + ".tmp")
    temp.write_text(json.dumps(value, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
    temp.replace(path)

event_id = os.environ["EXHIBITDAY_EVENT_ID"]
field_name = os.environ["EXHIBITDAY_CUSTOM_FIELD"]  # e.g. custom_67890 from your reference list
value = os.environ["EXHIBITDAY_CUSTOM_VALUE"]  # use a valid current dropdown choice, or text/URL
fields = call("fields")["body"]["list_data"]
field = next((field for field in fields if field["field_name"] == field_name), None)
if field is None:
    raise RuntimeError("Choose a field_name from this workspace's reference list")
kind = field.get("field_type", "").lower()
if field.get("is_hidden") or not (kind.startswith("text") or kind in ("dropdown", "url")):
    raise RuntimeError("Choose a visible text, dropdown or URL field")
# Read with $include_record_revision, then update only if the event's editable fields have not changed since that read.
before = call("event", {"id": event_id, "$include_record_revision": "true"})["body"]
print("Before:", before.get("custom_fields", []))

def shown(record):  # the field's value as the event shows it ("" when empty)
    return next((str(f.get("value") or "") for f in record.get("custom_fields", []) if f.get("field_name") == field_name), "")

def update(revision):  # "saved", "changed" (409 record_changed: nothing was saved) or "unknown"
    try:
        call("updateEvent", body={"id": event_id, field_name: value, "expected_revision": revision})
        return "saved"
    except ApiError as error:
        if error.error_code == "record_changed":
            return "changed"
        if error.uncertain:
            return "unknown"
        raise

outcome = update(before["record_revision"])
if outcome == "unknown":
    # No response or a server error: the update may have been saved. Read the event again; never resend blindly.
    check = call("event", {"id": event_id, "$include_record_revision": "true"})["body"]
    wanted = "" if value.lower() == "null" else value.strip().lower()
    if shown(check).strip().lower() in (wanted, "http://" + wanted):
        outcome = "saved"  # the first attempt was saved
    elif shown(check) == shown(before):
        outcome = update(check["record_revision"])  # not saved, and nobody changed this field: send it once more
    else:
        outcome = "changed"  # someone else changed this field: nothing more is sent
if outcome == "unknown":
    raise RuntimeError("The outcome of the update is still unknown; check the event before trying again")
saved = outcome == "saved"  # "changed": nothing was saved. Review it; never retry automatically.
after = call("event", {"id": event_id})["body"]
print("After:" if saved else "Not saved; the event changed after it was read. Current:", after.get("custom_fields", []))
if saved and (kind.startswith("text") or kind == "dropdown") and value and value.lower() != "null":
    filtered = list(pages("events", {"filter_by_custom_event_field__" + field_name: value}))
    print("Matching events:", len(filtered))
# JSON null clears a supported field; an empty string does NOT mean clear.


EXHIBITDAY_PY

Example HTTP response body (JSON)

GET /v1/events/info - HTTP 200
{
  "id": 12345,
  "exhibitday_url": "https://www.exhibitday.com/Workspace/Event/98765?eid=12345",
  "name": "Sample Event",
  "start_date": "2026-12-14",
  "end_date": "2026-12-16",
  "participation_type_id": 1,
  "participation_type": "Committed",
  "format_id": 1,
  "format": "In-Person",
  "star_rating": 0,
  "tags": [],
  "website_url": "",
  "venue_name": "",
  "venue_address": "",
  "venue_location_display_name": "",
  "venue_address_latitude": "",
  "venue_address_longitude": "",
  "booth_size": "",
  "booth_number": "",
  "booth_reservation_status_id": 1,
  "booth_reservation_status": "Need to Reserve",
  "booth_reserve_by_date": "",
  "booth_date_reserved": "",
  "budget_booth_reservation": 0.00,
  "budget_booth_services": 0.00,
  "budget_attendee_registrations": 0.00,
  "budget_travel": 0.00,
  "budget_giveaways": 0.00,
  "budget_shipments": 0.00,
  "budget_event_activities": 0.00,
  "budget_misc_expenses": 0.00,
  "budget_sponsorships": 0.00,
  "total_sum_event_budgets": 0.00,
  "cost_booth_reservation": 0.00,
  "cost_booth_services": 0.00,
  "cost_attendee_registrations": 0.00,
  "cost_travel_reservations": 0.00,
  "cost_giveaways": 0.00,
  "cost_shipments": 0.00,
  "cost_event_activities": 0.00,
  "cost_misc_expenses": 0.00,
  "cost_sponsorships": 0.00,
  "total_sum_event_costs": 0.00,
  "event_notes": "",
  "booth_notes": "",
  "budget_notes": "",
  "roi_notes": "",
  "roi_num_leads": 0,
  "roi_num_impressions_booth": 0,
  "roi_num_impressions_sponsorships": 0,
  "roi_num_impressions_media": 0,
  "roi_num_meetings_existing_customers": 0,
  "roi_num_meetings_new_customers": 0,
  "roi_amount_actual_sales": 0.00,
  "roi_amount_potential_sales": 0.00,
  "event_created_timestamp": "2026-11-14T17:00:00Z",
  "event_last_update_timestamp": "2026-11-14T17:00:00Z",
  "event_created_by": {
    "id": "11111111-2222-4333-8444-555555555555",
    "first_name": "Jane",
    "last_name": "Smith",
    "email": "jane@example.invalid"
  },
  "custom_fields": [
    {
      "label": "Integration status",
      "value": "Ready",
      "notes": "",
      "field_name": "custom_67890",
      "field_type": "Text (Single-line)",
      "field_event_tab": "Info"
    }
  ],
  "task_sections": [],
  "tasks": [],
  "misc_expenses_credits": [],
  "integration_metadata_field_1": "",
  "integration_metadata_field_2": "",
  "integration_metadata_field_3": "",
  "integration_metadata_field_4": "",
  "integration_metadata_field_5": ""
}
Note: Illustrative response. The event-info GET after the PATCH. Assume event 12345 has a visible Text (Single-line) field custom_67890 labeled Integration status and EXHIBITDAY_CUSTOM_VALUE=Ready. This is the server readback body, not the program's Before/After console formatting. Other field types require their own valid values. Request inputs: {"id":"12345"}.
Requirements: the curl workflow uses Bash, curl and Python 3; JavaScript uses Node.js 18 or later (save it as .cjs); Python uses its standard library; C# uses a .NET 8 console project (Program.cs). Java needs Java 11 or later, saved as Main.java, with Gson 2.14.0 on both the compile and runtime classpaths. PHP needs PHP 8.1 or later with cURL; Ruby 3.1 or later and Go 1.18 or later use their standard libraries.
Multi-line text uses plain-text input like the notes fields. HTML tags are stripped, line breaks become <br/> and stored text is HTML-encoded, so the API returns HTML: a < b is returned as a &lt; b.

4. Filter by a saved value

filter_by_custom_event_field__custom_67890=Northeast filters text/dropdown fields by that saved value. The comparison ignores letter case. Replace the example field id and value with your own.