1
Create the app from a prompt
Call Create app to create the app and start building it from the specified prompt.Because the build starts inside this call, anything the build itself needs has to be in this request. That includes:
Updating an app uses a different call. Send each new prompt through Send chat message, with the app ID in the URL.
2
Watch it build
Nothing is pushed to you. Poll Get app and read
status.state, which is processing while the build runs, ready when it settles, and error when it failed.Read conversation messages gives you the transcript to render alongside it.3
Answer the agent's questions
A turn doesn’t always run to completion. The agent can stop, ask the builder a question, and wait indefinitely. Nothing else you send moves until it is answered.You find the question in the transcript, as a tool call whose
status is waiting_for_user_input. It carries waiting_on.kind, and there are exactly three kinds. Build one UI for each, and you can handle every question the agent might ask.4
Send the answer back
Submit tool-call input takes the tool call’s id and a decision, and resumes the turn. When the question wants content rather than a yes or no, use
extra_user_input. If you approve, the agent receives it as the tool’s user_input.Send an X-Request-ID that stays the same across retries of the same submit. The reference integration derives it from the tool call’s id. Without a stable ID, a network-retried POST could resume the turn a second time and charge for it twice. With one, the server recognizes the retry and dedupes it.A few UI details matter here:- Declining is an answer. A rejection records the call as stopped, the tool never runs, and the agent carries on. Your UI needs an explicit decline button, not just an approve one.
- Lock the message input while a question is open. If it isn’t locked the builder can attempt to send a message into a stopped turn and nothing happens.
5
Show the preview (optional)
Get preview URL returns a URL that serves the app as it currently stands, including unpublished changes, along with a separate
preview_token needed to authenticate against it.Each app runs in its own sandbox, a live instance of its code that serves the preview. After a period of inactivity, the sandbox may require a cold start, so the first call can take noticeably longer. The response’s sandbox_info.cold_start field tells you whether that happened.6
Publish the app
Deploy an app is synchronous and has no review gate of its own, so any approval step your product needs is yours to build in front of it. By default the app’s current version goes live. To ship an earlier version, pick it from List checkpoints.Get published URL returns the address of the deployed app. A
404 covers an app that was never published, one you unpublished, and one that does not exist, so read it as “nothing to link to yet” rather than as a diagnosis.See also
- Setup checklist: Everything you need to do to get an integration running
- Common APIs: The endpoint for every job in your product
- Custom instructions: Give the agent app-specific instructions
- Tenancy and credentials: The account that owns your builders’ apps, and the key that creates them