Skip to content

Capture a booking-pace snapshot on demand

POST
/v1/analytics/booking-pace/capture
curl --request POST \
--url https://api.aerandil.com/v1/analytics/booking-pace/capture \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "as_of": "2026-04-15", "property_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Take the current business day’s booking-pace snapshot for one property now, instead of waiting for the nightly property-local cutoff sweep.

Which business day. Inside the post-cutoff grace window this captures the just-ended business day — the exact unit the sweep would take, just sooner. Past the grace window it captures the in-progress business day early; captured_at on the fact rows records the true moment, so an early curve point is honest about when it was frozen. Lapsed windows are never backfilled — live tables cannot reconstruct end-of-day state after the fact.

as_of. A house whose business time is not the clock’s — a replayed or simulated booking log — names the business day it is closing instead. It is admitted only while no reservation of the property was booked or cancelled on a later day, which is exactly when the live tables still are that day’s end-of-day book; a live house, which books every day, cannot use it to backfill.

At most one snapshot per business day. Snapshot rows are immutable once written: a repeat capture, or the nightly sweep arriving later, is a no-op (200 with captured: false).

Accepts an Idempotency-Key header for retry-safe automation, though the once-per-business-day claim already makes the operation naturally idempotent.

Media typeapplication/json
object
as_of

The property-local business day to capture, for a house whose business time is not the clock’s — a replayed or simulated booking log captured at each day’s close. Refused (422) in the future, and refused once any reservation of the property was booked or cancelled on a later day: the live tables are that day’s end-of-day book only until then. Absent, the clock picks the day as described above.

string format: date
property_id
required

Property whose current business day to snapshot.

string format: uuid
Examplegenerated
{
"as_of": "2026-04-15",
"property_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

That business day’s snapshot already existed (captured: false); nothing was written.

Media typeapplication/json
object
captured
required

False when that day’s snapshot already existed — snapshot rows are immutable, so nothing was written.

boolean
property_id
required
string format: uuid
snapshot_date_local
required

The property-local business day the capture targeted.

string format: date
Examplegenerated
{
"captured": true,
"property_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"snapshot_date_local": "2026-04-15"
}

Snapshot captured — one row per stay date in the lookahead horizon was written.

Media typeapplication/json
object
captured
required

False when that day’s snapshot already existed — snapshot rows are immutable, so nothing was written.

boolean
property_id
required
string format: uuid
snapshot_date_local
required

The property-local business day the capture targeted.

string format: date
Examplegenerated
{
"captured": true,
"property_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"snapshot_date_local": "2026-04-15"
}

Token lacks the analytics:write scope.

Media typeapplication/json

Structured error wrapper. Every non-2xx response from any Aerandil endpoint serialises to this shape; the HTTP status carries the failure class (4xx/5xx), the body adds a stable code for programmatic dispatch plus a human-readable message.

object
error
required
object
code
required

Stable, programmatic error code (e.g. unauthorized, forbidden, not_found, invalid_body, invalid_url, precondition_failed, no_secondary_key). Clients dispatch on code, not on the message (which may be localised or contextualised in future versions).

string
instance_id

Request-id correlation handle echoed on the request-id response header — support teams correlate without scraping logs.

string
message
required

Human-readable explanation of the failure.

string
parameters

Per-error structured detail. The shape varies by code (e.g. forbidden_action carries {"action": "..."}; precondition_failed carries {"current_version": N}).

Examplegenerated
{
"error": {
"code": "example",
"instance_id": "example",
"message": "example",
"parameters": "example"
}
}

No such property in this tenant.

Media typeapplication/json

Structured error wrapper. Every non-2xx response from any Aerandil endpoint serialises to this shape; the HTTP status carries the failure class (4xx/5xx), the body adds a stable code for programmatic dispatch plus a human-readable message.

object
error
required
object
code
required

Stable, programmatic error code (e.g. unauthorized, forbidden, not_found, invalid_body, invalid_url, precondition_failed, no_secondary_key). Clients dispatch on code, not on the message (which may be localised or contextualised in future versions).

string
instance_id

Request-id correlation handle echoed on the request-id response header — support teams correlate without scraping logs.

string
message
required

Human-readable explanation of the failure.

string
parameters

Per-error structured detail. The shape varies by code (e.g. forbidden_action carries {"action": "..."}; precondition_failed carries {"current_version": N}).

Examplegenerated
{
"error": {
"code": "example",
"instance_id": "example",
"message": "example",
"parameters": "example"
}
}

as_of names a day the property cannot give: in the future, or one its book has moved past (booking_pace_as_of_refused).

Media typeapplication/json

Structured error wrapper. Every non-2xx response from any Aerandil endpoint serialises to this shape; the HTTP status carries the failure class (4xx/5xx), the body adds a stable code for programmatic dispatch plus a human-readable message.

object
error
required
object
code
required

Stable, programmatic error code (e.g. unauthorized, forbidden, not_found, invalid_body, invalid_url, precondition_failed, no_secondary_key). Clients dispatch on code, not on the message (which may be localised or contextualised in future versions).

string
instance_id

Request-id correlation handle echoed on the request-id response header — support teams correlate without scraping logs.

string
message
required

Human-readable explanation of the failure.

string
parameters

Per-error structured detail. The shape varies by code (e.g. forbidden_action carries {"action": "..."}; precondition_failed carries {"current_version": N}).

Examplegenerated
{
"error": {
"code": "example",
"instance_id": "example",
"message": "example",
"parameters": "example"
}
}