Change a custom view’s date range (experimental)
Change a custom view’s date range (experimental)
⚠️ Experimental — this endpoint may change or be removed without notice and is not subject to v2 backwards-compatibility guarantees. Do not build production-critical integrations against it yet.
Updates the view’s default date range (the period applied to queries that use the {period_start:DateTime} / {period_end:DateTime} placeholders). Accepts a relative rolling window (e.g. last 30 days) or a fixed start/end range. Lets the period be changed after deployment without re-authoring the SQL. Applies to DRAFT or PUBLISHED views.
Authentication
Path parameters
Request
Default date range for the view’s queries. Use {period_start:DateTime} / {period_end:DateTime} placeholders in your SQL to make the range adjustable. Either relative (unit+amount) or absolute (start+end).
Response
Stable public identifier used in preview/embed URLs.
A view is DRAFT until explicitly published. For customer-scoped views, only PUBLISHED views are embeddable and served to end-customers; a DRAFT is not. For organization-scoped views, publishing is only a ‘ready to use’ marker — both DRAFT and PUBLISHED are visible to your organization’s members in Paid (publishing does not change who in the org can see it), and neither is ever embeddable to an end-customer.
‘customer’: data is scoped to one viewing customer and the view is embeddable per-customer. ‘organization’: data is org-wide and the view is internal-only.
Enable customer unit navigation for a customer-scoped view. Setting true requires customer hierarchies to be enabled for your organization, and every query must support unit selection. Existing views default to false.
Send the customer’s unit caps to the render bundle as context.caps. Needs hierarchyEnabled on a customer-scoped view. Turn it on only for views that draw cap usage: each load then reads cap usage from billing. Caps are spend policy, so an API key also needs read:billing to receive them in the data (they are left out otherwise) or to mint this view’s embed token. Defaults to false.