Run Structured Output

Runs a saved or transient structured-output definition against one or more calls, optionally returning a preview without updating call artifacts.

Authentication

AuthorizationBearer
Authenticate server-side requests with a private Vapi API key. Create or copy a key from the [Vapi Dashboard](https://dashboard.vapi.ai) and send it in the `Authorization` header as `Bearer <token>`. Keep private API keys out of client-side code and public repositories.

Request

This endpoint expects an object.
callIdslist of stringsRequired
This is the array of callIds that will be updated with the new structured output value. If preview is true, this array must be provided and contain exactly 1 callId. If preview is false, up to 100 callIds may be provided.
previewEnabledbooleanOptionalDefaults to false

This is the preview flag for the re-run. If true, the re-run will be executed and the response will be returned immediately and the call artifact will NOT be updated. If false (default), the re-run will be executed and the response will be updated in the call artifact.

structuredOutputIdstringOptional

This is the ID of the structured output that will be run. This must be provided unless a transient structured output is provided. When the re-run is executed, only the value of this structured output will be replaced with the new value, or added if not present.

structuredOutputobjectOptional

This is the transient structured output that will be run. This must be provided if a structured output ID is not provided. When the re-run is executed, the structured output value will be added to the existing artifact.

Response

StructuredOutputRunPreviewResponseobject
OR
StructuredOutputRerunResponseobject