Skip to main content
POST
Stream Agent Build
Read only Stream Agent Build uses your workspace API key. Streams build progress as newline-delimited JSON and returns the generated draft configuration without saving or publishing an agent.

Before you begin

Use a server-side API key for the intended workspace.

Stream Agent Build request

The request panel lists supported query parameters and body fields. For a request body, the example below supplies the required fields. Replace sample values with your own inputs.

Verify the result

Expect HTTP 200 with Content-Type: application/x-ndjson. Parse complete lines as JSON. A complete event contains data; an error event can arrive after HTTP headers have already been sent. There is no success envelope around the stream. Progress events include phase_start, phase_complete, thinking_delta, and building_event. The final result includes status, missingQuestions, evaluation, and draftAgent. A completed stream is not proof that an agent was saved. This operation also accepts the matching /v1/assistant path. The request and result contracts are shared. Use one path consistently for your integration.

Retry safety

This operation does not modify workspace resources. Retry after a transient connection failure.

Errors and recovery

  • 401: Missing, expired, or invalid API key.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
structured_input
object
required

Structured blueprint submission - each field has a description (field guidance) and value (user answer)

build_attempt
number
default:1

Build attempt number (1-2). Validation runs only on attempt 1; attempt 2 skips re-validation.

Required range: 1 <= x <= 2
pipeline
enum<string>
default:cascaded

Engine for the generated agent. "s2s" builds the realtime pipeline on the same single-prompt agent; anything else builds the cascaded pipeline.

Available options:
cascaded,
s2s
target_shape
enum<string>
default:spa

Kind of agent to build. "cfa" writes a conversation-flow document (a step graph), "ivr" writes a touch-tone menu; anything else builds a single-prompt agent.

Available options:
spa,
cfa,
ivr

Response

NDJSON stream of thinking updates and final result

One JSON object per line. Event types: phase_start, phase_complete, thinking_delta, building_event, complete, error. The complete event contains data with status, events, missingQuestions, evaluation, draftAgent, promptText, welcomeMessage, technicalProfile, and error.