Create Tasks from Another System

A form, ticketing tool or project plan can add a task to an event. Each example finds the intended event and creates a task with a stable Idempotency-Key. Choose your event and task values before running it.

1. Find the intended event

Search by name, or use filter_by_integration_metadata_field_1 if you stored your other system's id. $return_event_lites=true returns the essentials. Confirm that the result is the intended event; a broad name search can match more than one. See Sync Events and Tasks to Another System.

2. Choose a section or assignee when needed

/v1/events/info includes the event's task_sections. /v1/references/users_and_resources with filter_by_can_have_tasks_assigned=true lists assignable users; use their id as assignee_user_id. Resources are excluded by this filter. Both choices are optional. Use only the ids appropriate for your event and workspace.

3. Reuse the same key for the same create

Give each new logical task a new UUID Idempotency-Key. If a transient failure or timeout requires retrying that create, reuse the same key and exactly the same request body. For 24 hours, a completed retry returns the original result with Idempotent-Replayed: true instead of creating a second task.
Set EXHIBITDAY_API_KEY and EXHIBITDAY_EVENT_ID. Optional inputs are EXHIBITDAY_TASK_NAME, EXHIBITDAY_TASK_SECTION_ID and EXHIBITDAY_ASSIGNEE_ID.
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\":{\"events\":{\"method\":\"GET\",\"path\":\"/events\"},\"event\":{\"method\":\"GET\",\"path\":\"/events/info\"},\"assignees\":{\"method\":\"GET\",\"path\":\"/references/users_and_resources\"},\"createTask\":{\"method\":\"POST\",\"path\":\"/tasks\"}}}")
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"]  # choose your own event; no arbitrary first search result
matches = list(pages("events", {"event_id": event_id, "$return_event_lites": "true"}))
if not any(str(event["id"]) == event_id for event in matches):
    raise RuntimeError("The selected event was not found")
event = call("event", {"id": event_id})["body"]
task = {"event_id": event_id, "name": os.environ.get("EXHIBITDAY_TASK_NAME", "Order booth carpet"),
        "due_date": (datetime.date.today() + datetime.timedelta(days=14)).isoformat(),
        "details": "Requested from the integration guide"}
section_id = os.environ.get("EXHIBITDAY_TASK_SECTION_ID")
if section_id:
    if not any(str(section["id"]) == section_id for section in event.get("task_sections", [])):
        raise RuntimeError("Choose a task section from this event")
    task["task_section_id"] = section_id
assignee_id = os.environ.get("EXHIBITDAY_ASSIGNEE_ID")
if assignee_id:
    people = call("assignees", {"filter_by_can_have_tasks_assigned": "true"})["body"]["list_data"]
    if not any(str(person["id"]) == assignee_id for person in people):
        raise RuntimeError("Choose an assignable user/resource")
    task["assignee_user_id"] = assignee_id
key = str(uuid.uuid4())  # keep this key with this logical task if your process must resume later
created = call("createTask", body=task, key=key)["body"]
print("Created task", created["id"], created["name"])


EXHIBITDAY_PY

Example HTTP response body (JSON)

POST /v1/tasks - HTTP 200
{
  "id": 23456,
  "exhibitday_url": "https://www.exhibitday.com/Workspace/TaskView/98765?tid=23456",
  "event_task_section_id": null,
  "event_task_section": null,
  "display_rank": 0,
  "name": "Order booth carpet",
  "due_date": "2026-11-28",
  "assignee": null,
  "is_completed": false,
  "task_completed_timestamp": null,
  "task_completed_by": null,
  "details": "Requested from the integration guide",
  "comments": [],
  "event": {
    "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",
    "event_created_timestamp": "2026-11-14T17:00:00Z",
    "event_last_update_timestamp": "2026-11-14T17:00:00Z"
  },
  "task_created_by": {
    "id": "ExhibitDay API",
    "first_name": "ExhibitDay",
    "last_name": "API",
    "email": ""
  },
  "task_created_timestamp": "2026-11-14T17:00:00Z",
  "task_last_update_timestamp": "2026-11-14T17:00:00Z",
  "integration_metadata_field_1": "",
  "integration_metadata_field_2": "",
  "integration_metadata_field_3": "",
  "integration_metadata_field_4": "",
  "integration_metadata_field_5": ""
}
Note: Illustrative response. The successful task-create HTTP body. Assume EXHIBITDAY_EVENT_ID=12345 identifies an existing event named Sample Event, the default task name is used, and optional section/assignee variables are unset. The generated task ID is illustrative; console output only prints a short confirmation. Request inputs: {"event_id":"12345","name":"Order booth carpet","due_date":"2026-11-28","details":"Requested from the integration guide"}.
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.

Good to know

  • Locked task lists refuse changes with error_code not_allowed.
  • Leave event_id out when you intentionally want a general task rather than an event task.
  • POST /v1/tasks/comment adds a comment using task_id and comment.
  • An indeterminate earlier request needs an outcome check; do not blindly create again with a new key.