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. To preview a specific request, also pass its query string, method, body (+ content_type), headers and cookies: they are read exactly as serving reads a live request (only declared names reach the transform; what serving refuses fails the preview with serving's reason). On a verify endpoint (webhook or Turnstile) nothing is checked: it runs as though the provider accepted the request, and message says so. 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).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "preview_dynamic_endpoint"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | the sample request body, for a method that carries one: a JSON value (sent as application/json), or a string sent as-is, such as a form ("name=Ada&email=ada%40example.com" with content_type application/x-www-form-urlencoded). Parsed as serving parses a live body; the transform reads it as body | |
| slug | No | the endpoint slug (provide this or endpoint_id) | |
| query | No | a sample query string, exactly what follows '?' in the URL (e.g. "q=lamps&tag=a&tag=b"). Only the names the endpoint declares in its query list reach the input_transform as query.<name> (a repeated name becomes an array); on a strict_query endpoint an undeclared name fails the preview with serving's 400 | |
| method | No | the sample request's HTTP method (GET, POST, PUT, PATCH, DELETE); default GET. Must be one the endpoint lists, else the preview fails as serving would answer 405. The transform reads it as request.method | |
| 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 | |
| cookies | No | sample cookies by name. Only the ones the endpoint declares in cookies reach request.cookies; others, and protected names (__Host-, __Secure-, __cf, _cf, cf_), are dropped | |
| headers | No | sample request headers by name. Only the ones the endpoint declares in headers reach request.headers (and, on a verify webhook, the provider's delivery headers); others are dropped | |
| version | No | specific version to preview; omit (0) for the latest version (the draft) | |
| endpoint_id | No | the endpoint id (provide this or slug) | |
| content_type | No | the sample body's Content-Type: application/json (the default) or application/x-www-form-urlencoded | |
| 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 |