custom-views-experimental

Publish a custom view (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.

⚠️ Never publish as an automatic follow-up to creating or generating a view. Only call this after you have shown the user the built/previewed view and they have EXPLICITLY approved publishing — building and publishing are separate user decisions, and answering an earlier question (e.g. the view's scope) is NOT publish approval. Flips the view from DRAFT to PUBLISHED. Only PUBLISHED views are served on the embed data path — this is the gate that stops an unreviewed view reaching end-customers. Idempotent: publishing an already-published view is a no-op success. The response returns a previewUrl — give it to the user so they can open the view in Paid.

post/experimental/views/{displayId}/publish

Request

  • Base URL: https://api.agentpaid.io/api/v2
  • URL: https://api.agentpaid.io/api/v2/experimental/views/{displayId}/publish
  • Auth: HTTP bearer

Path parameters

displayIdstring required

Request body

object required

Response

200

hierarchyEnabledboolean

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.

capsEnabledboolean

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.

displayIdstring required

Stable public identifier used in preview/embed URLs.

namestring required
status'DRAFT' | 'PUBLISHED' required

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.

previewUrlstring uri nullable required

Absolute URL to open this view in the Paid app for preview. Surface it to the user after creating or publishing a view. Null when the app URL is not configured.

scope'customer' | 'organization' required

'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.

Changes

No recorded changes to this operation across all 1 revision of this API.