Skip to content

Reference

History

Last year's sales loaded from a file (OnTourHQ or any CSV), kept as imported counts by day and ticket type for the Overview's pace. Never orders, tickets or money here.

View as Markdown

Every operation below is also in the OpenAPI document. One that names an MCP tool can be called through the MCP server; one that names none cannot.

Load a past event's sales from a file (OnTourHQ or any CSV)#

POST /v1/history/imports

Operation id importHistory. MCP tool import_history. SDK tickets.history.import.

Loads a PAST event's sales from a file so the Overview can say ahead of or behind last year. source: "ontourhq" reads an OnTourHQ "All Order Details" export by its default columns; source: "csv" reads any CSV by columns. Send dry_run: true first: it says what the file read as (rows, days, types, the money, every word in the status column, what it skips and why, the first problems by row, and what looks wrong in notes) and keeps nothing. The first real import of an ontourhq file must send the dry_run_token that dry run answered. It is imported: counts by day and ticket type, in cents, marked imported with provider external. They are never orders, tickets or money here, so no settlement, payout, webhook, door or email ever sees them. A buyer is kept only when the file marks consent (consent_email, consent_sms); a row without it keeps no person, only its count, and someone erased earlier stays out whatever the file says (buyers.erased). A file with no quantity column says columns.quantity: "none". At most 2,000 data rows a request: a bigger file is sent in parts, each after the first carrying the import_id part 1 answered. An import may not add up to more than $100,000,000. The same part sent again changes nothing; a changed part, or a new part 1, replaces what was there.

Who may call it. Any one of: An API key with scope full. Any other scope answers insufficient_scope; A signed-in dashboard member whose role has org.manage (owner, admin).

Request body (HistoryImportInput)

FieldTypeDescription
event *stringThe past event the history belongs to (a normal event of this org, usually in the series the Overview compares with). It must have no sales of its own.
source"ontourhq" | "csv"ontourhq: an OnTourHQ "All Order Details" export, with its default columns. csv: any CSV, with columns.
csv *stringThe file's text (a leading byte-order mark and CRLF line ends are fine). At most 2,000 data rows a request: send a bigger file in parts.
columnsHistoryColumns
timezonestringAn IANA zone the file's times are in when they carry none (default: the organization's).
partintegerWhich part of the file this is, from 1. Part 1 starts an import and replaces any earlier one.
import_idstringRequired on every part after the first: the import_id part 1 answered, so a part of another file cannot join this one.
dry_run_tokenstringsource ontourhq, the first real import of an event: the dry_run_token a dry run of these same bytes answered. The default columns are a guess about the file until someone has read what the dry run says. It is a guard…
partsintegerHow many parts the file is sent in. Every request of one import says the same.
skip_problemsbooleanA row that cannot be read (a bad amount, date or quantity) stops the import by default. true: those rows are left out, and said.
dry_runbooleanReads the file and says what it found; nothing is kept.

* required

JSON
{
  "event": "evt_yrd2026",
  "source": "csv",
  "csv": "Order Date,Ticket Type,Quantity,Total Paid\n2025-03-01,GA Saturday,1,$75.00\n",
  "columns": {
    "date": "Order Date",
    "ticket_type": "Ticket Type",
    "quantity": "Quantity",
    "amount": "Total Paid"
  },
  "dry_run": true
}

Answers 200. What the part read as (dry_run) or what keeping it did. A bigger file is sent in parts.

Fields (HistoryImportResult)

FieldTypeDescription
object *"history_import_result"
dry_run *boolean
unchanged *booleanThis part was already held exactly as sent: nothing was written.
import_id *string | nullWhat every later part of this file sends as import_id. Null on a dry run.
dry_run_token *string | nullOn a dry run: what the first real import of an ontourhq file sends back, to say these bytes were read first. Null on a real run.
can_import *boolean
blockers *array of stringWhy it cannot be imported, in words (a column that cannot be found, another currency, problem rows without skip_problems, a part past the file).
part *integer
parts *integer
columns *objectWhat each field was read from: the header in the file, or null when the file has none.
rows *object
skipped *array of objectRows left out on purpose: cancelled, unpaid, duplicate_row, blank.
statuses *array of objectEvery distinct word in the status column, with how many rows say it and what it was read as.
problems *array of objectThe first problems, by row.
days *object
types *array of object
totals *object
buyers *object
notes *array of stringWhat was assumed, and what looks wrong: a date with no time, a comp's price ignored, a column it could not find, sales outside the event's dates, a price per ticket that looks like a fee. Read these before the real impo…
import *HistoryImport | nullThe event's imported history as it stands (null on a dry run, or once removed).

* required

Errors of its own. invalid_state_transition. The errors every operation can answer are on the errors page.

What an event holds of imported history#

GET /v1/history/imports/{id}

Operation id getHistoryImport. MCP tool get_history_import. SDK tickets.history.retrieve.

What an event holds of imported history, labelled imported: totals, days and types by name. id is the event's id, not the import_id an import answers. format=csv answers the days and types as a CSV.

Who may call it. Any one of: An API key with scope full, read. Any other scope answers insufficient_scope; A signed-in dashboard member whose role has read (owner, admin, staff, viewer).

ParameterInTypeDescription
id *pathstringAn id starting with evt_.
formatquery"json" | "csv"csv answers the imported days and types as text/csv (cells starting = + - @ escaped).

Answers 200. The imported totals, labelled imported (format=csv: the days and types as a CSV).

Fields (HistoryImport)

FieldTypeDescription
object *"history_import"
event *stringAn id starting with evt_.
status *"loading" | "complete"loading: some parts are still to come, and the pace does not use it yet.
source *"ontourhq" | "csv"
imported *trueAlways true: these totals were loaded from a file and were not sold here.
provider *"external"The money in them was taken somewhere else.
currency *CurrencyAn ISO 4217 currency in lower case. Every one listed has two minor digits.
timezone *string
parts *object
totals *object
days *object
types *array of object
buyers *object
loaded_at *string (date-time)An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC.
expires_at *string | nullWhen the kept buyers are removed (the event's retention period, else two years after the import).

* required

Remove an event's imported history#

DELETE /v1/history/imports/{id}

Operation id deleteHistoryImport. MCP tool delete_history_import. SDK tickets.history.delete.

Removes an event's imported history, buyers included. Nothing sold is touched.

Who may call it. Any one of: An API key with scope full. Any other scope answers insufficient_scope; A signed-in dashboard member whose role has org.manage (owner, admin).

ParameterInTypeDescription
id *pathstringAn id starting with evt_.

Answers 200. What was removed.

Fields (HistoryImport)

FieldTypeDescription
object *"history_import"
event *stringAn id starting with evt_.
status *"loading" | "complete"loading: some parts are still to come, and the pace does not use it yet.
source *"ontourhq" | "csv"
imported *trueAlways true: these totals were loaded from a file and were not sold here.
provider *"external"The money in them was taken somewhere else.
currency *CurrencyAn ISO 4217 currency in lower case. Every one listed has two minor digits.
timezone *string
parts *object
totals *object
days *object
types *array of object
buyers *object
loaded_at *string (date-time)An instant in ISO 8601 with its zone, e.g. 2027-07-17T20:00:00Z. Answers are always UTC.
expires_at *string | nullWhen the kept buyers are removed (the event's retention period, else two years after the import).

* required

Errors of its own. invalid_state_transition. The errors every operation can answer are on the errors page.