Search Activity Audit Logs to See Who Changed What, and When

See who changed what and when, for audits, investigations or monitoring.

Example use case

You want to see who completed a Task during a show or who last updated a Storage Location.

What you'll end up with

Matching activity entries with their log ID, timestamp and activity text. The API also returns saved actor information and record associations where available.

Before you start

Have a workspace API key and choose a time window. If you want to narrow the program's search, have the ID of the Event, Asset, Storage Location or Task.

Good to know

Activity entries describe recorded actions. Use the record APIs to check the current values.

At a glance

Time to try

About 5 minutes

Effect on your data

Read-only

Endpoints

1

The program reads and prints matching Workspace Activity entries.

How it works

  1. Choose a time window for the activity you want to review. Optional record IDs narrow the results.
  2. The program reads the oldest activity first and fetches each next page using the same filters.
  3. It prints each log entry once during the run, using its log ID to skip repeats.

Read the activity

The example below reads the first page of activity. The program reads another page when the response says there are more entries.

Step 1: Read the activity in your time window

Start at offset zero and sort oldest first to follow the activity in order.

curl -X GET "https://api.exhibitday.com/v1/workspace_settings/logs?filter_by_create_timestamp_greater_than_or_equal_to=2030-01-02T00%3A00%3A00Z&filter_by_create_timestamp_smaller_than_or_equal_to=2030-01-02T23%3A59%3A59Z&%24result_sort=create_timestamp_asc&%24offset=0&%24limit=2" -H "Authorization: Bearer YOUR_API_KEY"

Example response (shortened)

{
  "list_data": [
    {
      "id": 67890,
      "log_entry_created_timestamp": "2030-01-02T17:04:05Z",
      "actor_display_name": "Alex Morgan",
      "log_entry": "Alex Morgan completed the Task: Confirm booth artwork."
    },
    {
      "id": 67891,
      "log_entry_created_timestamp": "2030-01-02T17:04:06Z",
      "actor_display_name": "Jordan Lee",
      "log_entry": "Jordan Lee updated the Storage Location notes."
    }
  ],
  "records_found": 2,
  "total_records": 3,
  "has_more": true
}

Check: records_found is the number of entries on this page. Here has_more is true, so keep the same filters and sort, add 2 to the offset and fetch the next page. Keep adding each page's records_found until has_more is false.

Try it

Before running the example

VariableWhat to put in itRequired?
EXHIBITDAY_API_KEYYour workspace API key.Yes
EXHIBITDAY_LOG_FROMInclusive start, for example 2030-01-02T00:00:00Z.Yes
EXHIBITDAY_LOG_UNTILInclusive end, for example 2030-01-02T23:59:59Z.Yes
EXHIBITDAY_EVENT_IDThe Event ID.No
EXHIBITDAY_ASSET_IDThe Asset ID.No
EXHIBITDAY_STORAGE_LOCATION_IDThe Storage Location ID.No
EXHIBITDAY_TASK_IDThe Task ID.No
EXHIBITDAY_PAGE_SIZEA positive page size. The default is 100.No

Bash

export EXHIBITDAY_API_KEY='YOUR_API_KEY'
export EXHIBITDAY_LOG_FROM='2030-01-02T00:00:00Z'
export EXHIBITDAY_LOG_UNTIL='2030-01-02T23:59:59Z'

PowerShell

$env:EXHIBITDAY_API_KEY = 'YOUR_API_KEY'
$env:EXHIBITDAY_LOG_FROM = '2030-01-02T00:00:00Z'
$env:EXHIBITDAY_LOG_UNTIL = '2030-01-02T23:59:59Z'

Then copy the complete example program below in your language and run it.

The program prints one JSON object per distinct log ID and preserves each ID as decimal text in its output.

Complete example program

Code Samples
#!/usr/bin/env bash
# Requires Bash, curl and Python3. No API key is written into the program.
python3 - <<'EXHIBITDAY_PY'
# Python 3; standard library only. Set EXHIBITDAY_API_KEY before running.
import http.client
import json
import os
import re
import time
import urllib.error
import urllib.parse
import urllib.request

BASE = "https://api.exhibitday.com/v1"
SPEC = json.loads("{\"preserveNumbers\":true,\"requests\":{\"page\":{\"method\":\"GET\",\"path\":\"/workspace_settings/logs\"}}}")
API_KEY = os.environ["EXHIBITDAY_API_KEY"]
if any(ord(char) < 32 or ord(char) > 126 for char in API_KEY):
    raise RuntimeError("Use the API key as one ASCII header value without control characters")
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)

from pathlib import Path
# 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)
        # curl may leave no output file for a valid bodyless304 response.
        (folder / "body").write_bytes(b"")
        command = ["curl", "--disable", "--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, key=None):
    route = SPEC["requests"][name]
    headers = {"Authorization": "Bearer " + API_KEY, "Accept": "application/json"}
    if route["method"] == "POST":
        if not key: raise RuntimeError("Persist a logical create key before sending POST")
        headers["Idempotency-Key"] = key
    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 "")
    # Only GET has automatic retries in this workflow. 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"] == "GET"
    for attempt in range(5):
        try:
            status, raw, response_headers = transport(route["method"], url, headers, data)
        except (urllib.error.URLError, TimeoutError, ConnectionError, http.client.HTTPException):
            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 = resend and (status == 429 or status >= 500)
        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, "raw": raw}
    raise RuntimeError("Retry limit reached")


def add_offset(offset, received):
    result = int(offset) + received
    if received <= 0 or result > 2147483647: raise RuntimeError("Cannot advance this int32 offset; reconcile the query")
    return str(result)

def items(value):
    if not isinstance(value, list): raise RuntimeError("Expected a JSON array")
    return value

def count(value):
    return len(items(value))

def either(left, right):
    if not isinstance(left, bool) or not isinstance(right, bool): raise RuntimeError("Expected Boolean criteria")
    return left or right

def equal(left, right):
    return type(left) is type(right) and left == right

def field(value, name):
    if not isinstance(value, dict) or name not in value: raise RuntimeError("Missing response field: " + name)
    return value[name]

def is_empty(value):
    return count(value) == 0

def is_present(value):
    return value is not None and value != ""

def new_id_set():
    return set()

def not_value(value):
    if not isinstance(value, bool): raise RuntimeError("Expected a Boolean")
    return not value

def optional(name, fallback):
    value = os.environ.get(name)
    return fallback if value is None or value == "" else value

def page_size(value):
    if not re.fullmatch(r"[1-9][0-9]*", value) or int(value) > 2147483647: raise RuntimeError("Page size must be a positive int32")
    return value

def positive_id(value):
    if not re.fullmatch(r"[1-9][0-9]*", value) or int(value) > 9223372036854775807: raise RuntimeError("Use a positive record ID")
    return value

def print_value(value):
    print(value if isinstance(value, str) else json.dumps(value, ensure_ascii=False))

def remember_id(seen, value):
    if value in seen: return False
    seen.add(value)
    return True

def require_condition(value, message):
    if value is not True: raise RuntimeError(message)

def required(name):
    value = os.environ.get(name)
    if value is None or not value.strip(): raise RuntimeError("Set " + name)
    return value

def text(value):
    if value is None: return ""
    if isinstance(value, str): return value
    if isinstance(value, bool): return "true" if value else "false"
    if isinstance(value, int): return str(value)
    raise RuntimeError("Expected a scalar response value")


def main():
    activity_page_size = page_size(optional("EXHIBITDAY_PAGE_SIZE", "100"))
    activity_from = required("EXHIBITDAY_LOG_FROM")
    activity_until = required("EXHIBITDAY_LOG_UNTIL")
    activity_query = {"filter_by_create_timestamp_greater_than_or_equal_to": activity_from, "filter_by_create_timestamp_smaller_than_or_equal_to": activity_until, "$result_sort": "create_timestamp_asc", "$limit": activity_page_size}
    activity_event_id = optional("EXHIBITDAY_EVENT_ID", "")
    if is_present(activity_event_id):
        activity_query["filter_by_event_id"] = positive_id(activity_event_id)
    activity_asset_id = optional("EXHIBITDAY_ASSET_ID", "")
    if is_present(activity_asset_id):
        activity_query["filter_by_asset_id"] = positive_id(activity_asset_id)
    activity_storage_location_id = optional("EXHIBITDAY_STORAGE_LOCATION_ID", "")
    if is_present(activity_storage_location_id):
        activity_query["filter_by_storage_location_id"] = positive_id(activity_storage_location_id)
    activity_task_id = optional("EXHIBITDAY_TASK_ID", "")
    if is_present(activity_task_id):
        activity_query["filter_by_task_id"] = positive_id(activity_task_id)
    activity_offset = "0"
    activity_seen_ids = new_id_set()
    while True:
        activity_query["$offset"] = activity_offset
        activity_response = call("page", activity_query, None, None)
        activity_page = activity_response["body"]
        activity_rows = items(field(activity_page, "list_data"))
        require_condition(equal(text(field(activity_page, "records_found")), text(count(activity_rows))), "records_found does not match this page's rows.")
        require_condition(is_present(text(field(activity_page, "total_records"))), "The collection wrapper needs total_records.")
        require_condition(either(equal(field(activity_page, "has_more"), True), equal(field(activity_page, "has_more"), False)), "Expected a Boolean has_more value.")
        for activity_entry in items(activity_rows):
            activity_entry_id = positive_id(text(field(activity_entry, "id")))
            require_condition(is_present(text(field(activity_entry, "log_entry_created_timestamp"))), "A log entry needs its timestamp.")
            if remember_id(activity_seen_ids, activity_entry_id):
                print_value({"id": activity_entry_id, "log_entry_created_timestamp": field(activity_entry, "log_entry_created_timestamp"), "log_entry": field(activity_entry, "log_entry")})
        if equal(field(activity_page, "has_more"), False):
            break
        require_condition(not_value(is_empty(activity_rows)), "An empty page has has_more=true; stop and reconcile the query.")
        activity_offset = add_offset(activity_offset, count(activity_rows))


if __name__ == "__main__":
    main()

EXHIBITDAY_PY

Example response

{
  "records_found": 2,
  "total_records": 3,
  "has_more": true,
  "list_type": "workspace_log",
  "list_data": [
    {
      "id": 67890,
      "log_entry_created_timestamp": "2030-01-02T17:04:05Z",
      "actor_user_id": "11111111-2222-4333-8444-555555555555",
      "actor_display_name": "Alex Morgan",
      "log_entry": "Alex Morgan completed the Task: Confirm booth artwork.",
      "event_id": 5001,
      "event_name": "Spring Expo 2030",
      "event_tab_id": 8,
      "task_id": 701,
      "task_name": "Confirm booth artwork",
      "asset_id": null,
      "asset_name": null,
      "storage_location_id": null,
      "storage_location_name": null
    },
    {
      "id": 67891,
      "log_entry_created_timestamp": "2030-01-02T17:04:06Z",
      "actor_user_id": "66666666-7777-4888-8999-000000000000",
      "actor_display_name": "Jordan Lee",
      "log_entry": "Jordan Lee updated the Storage Location notes.",
      "event_id": null,
      "event_name": null,
      "event_tab_id": 0,
      "task_id": null,
      "task_name": null,
      "asset_id": 801,
      "asset_name": "Event display kit",
      "storage_location_id": 901,
      "storage_location_name": "Main warehouse"
    }
  ]
}
Note: First activity page. Two illustrative entries from a time-window search. A third matching entry remains on the next page.

Things to keep in mind

  • Manual example: To look for a particular actor, add filter_by_actor_user_id with the actor's user ID as text. The complete program does not send this filter. Entries recorded by the API have a null actor_user_id, so this filter can't select them; identify them by actor_display_name. See the linked endpoint for other filters and sort choices.
  • Use an explicit time-zone offset in each time filter. Responses show whole seconds. The upper time bound includes the displayed second. A fractional lower bound starts at the next whole second.
  • Offset pages are separate reads. Changes during a run can move page boundaries. The program remembers IDs during the current run to skip duplicates. Keep the IDs in your own records if you need to reconcile multiple runs.
  • The log records activity text and available associations. It may omit some changes and does not provide complete before-and-after values.