Start or continue a Managed Agent build
Builds a new Managed Agent, or edits one, from a plain-language request, using the same builder as the app. Returns 202 at once with a buildId; poll Get build until it finishes. To continue a build, send its buildId with answers to its questions, or with a follow-up message. The result is a saved draft; publish it with Publish a Managed Agent.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your access token.
managed-agents. buildAndPublishOAuthPrivate IntegrationSub-Account TokenRequest
Headers
API version.
v3v3Unique key for this request. Resending it with the same request returns the original result.
Possible values: non-empty and <= 128 characters
build-7f3cf4c0-39eb-46be-baa3-a1eb15021f25Body
Location (sub-account) the agent belongs to
ve9EPM428h8vShlRW1KTWhat to build or change, in plain language. Required, except when the request answers the questions of a build in NEEDS_INPUT.
Build an agent that qualifies new leads and books them into my sales calendarEdit this existing Managed Agent, published or not. Omit to create a new agent. Not allowed with buildId.
027ee957-ae94-40ad-89a3-b25c985f729bContinue this build: answer its questions, or send a follow-up message such as a reply to its question. Not allowed with managedAgentId.
b7a1f0e2-4c3d-4e5f-8a9b-0c1d2e3f4a5bAnswers to the questions of a build in NEEDS_INPUT. Needs buildId; not allowed with message.
[
{
"questionId": "a1b2c3d4e5f6",
"values": [
"uQWaF4gPj7NQ1696EEp2"
]
}
]
Question ids the user chose not to answer; the builder picks a sensible default for each
["f6e5d4c3b2a1"]Response
Build round started
Build id to poll and to continue the build with
b7a1f0e2-4c3d-4e5f-8a9b-0c1d2e3f4a5bRUNNING: still building. NEEDS_INPUT: answer questions. NEEDS_REPLY: the builder asked something in message; send the reply as a new message on this build. ANSWERS_STALE: the questions changed, so send the request again. COMPLETED: done (changed tells whether the agent was saved). FAILED: see error.
RUNNINGNEEDS_INPUTNEEDS_REPLYANSWERS_STALECOMPLETEDFAILEDRUNNINGWhat to do next. POLL: call get build again after pollAfterMs. ASK_USER: show the user the questions or message and send their answer. REVIEW: the draft was saved; review it, then publish when ready. USE_RESULT: use message as the answer; nothing changed. RETRY: nothing was applied (see error or staleReason); send the request again with a new Idempotency-Key.
POLLASK_USERREVIEWUSE_RESULTRETRYPOLLMilliseconds to wait before polling again (RUNNING only)
5000The agent this build creates or edits, once known
027ee957-ae94-40ad-89a3-b25c985f729bCOMPLETED only: true when the agent draft was saved, false when the builder only answered
trueThe builder's message: its summary, its answer, or the question it needs answered
I built a lead qualifier that books qualified leads into your Sales calendar.NEEDS_INPUT only: the questions to answer
ANSWERS_STALE only: why the answers no longer apply
no_pending_roundexpiredconfig_changedwrong_targetround_mismatchexpiredFAILED only: why the build failed
Whether the agent has a published version
falseWhether the saved draft differs from the published version
trueWhen the build started
2026-10-29T12:00:00.000ZWhen the build last changed state
2026-10-29T12:01:30.000Z