Preview dynamic endpoint
preview_dynamic_endpointRender what a dynamic endpoint serves WITHOUT publishing — runs the endpoint's workflow through the full serve path (input + bound datafile + content-type) and returns the response, so you can preview a DRAFT before publishing (or verify any version). Omit version to preview the latest draft; pass a version to preview that one. For a :param endpoint (e.g. 'post/:slug'), pass sample params (e.g. {"slug":"hello"}) — they run through the definition's input_transform, so you can preview a specific URL and confirm a good value renders and a bad one fails input validation. This executes the workflow (may have side effects). Returns content_type, output (decoded as a string), the run status (status=failed with a message when the render did not succeed), the run_id (drill into the full run/traces with get_workflow_run_traces), and resolved_input (the $input the transform produced, for debugging the mapping).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | No | the endpoint slug (provide this or endpoint_id) | |
| params | No | sample path parameters for a :param endpoint (e.g. {"slug":"hello"} for a 'post/:slug' endpoint); fed to the definition's input_transform to build $input, so you can preview a specific URL and confirm it passes the workflow's input_schema | |
| version | No | specific version to preview; omit (0) for the latest version (the draft) | |
| endpoint_id | No | the endpoint id (provide this or slug) | |
| viewer_email | No | simulated viewer's email, bound as auth.email. Only takes effect when the endpoint has a role allowlist (auth.allow.tenant_roles) — that is the only case where a real address reaches a workflow, so a preview without one ignores this, exactly as serving would | |
| viewer_roles | No | simulated viewer's roles in this workspace, bound as auth.roles (e.g. ["ROLE_ADMIN"]) so you can preview role-gated rendering. Like viewer_email, only takes effect on an endpoint with a role allowlist | |
| viewer_user_id | No | simulate a signed-in viewer for previewing a gated endpoint that exposes identity: the derived auth.viewer_id is computed from this, so the preview shows the real identifier. Omit it and a visible placeholder stands in. Ignored unless the endpoint gates and exposes identity |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output | Yes | ||
| run_id | No | ||
| status | Yes | ||
| message | No | ||
| content_type | Yes | ||
| resolved_input | No |