Skip to main content
An agent stops and asks when it needs a decision it should not make on its own, such as whether a comparison of boatowners coverage should include personal watercraft programs. Its reply then waits until you answer. This page continues from Create and run an agent: you have sent an agent a message and are reading that message until it finishes.

Read the questions

While the agent waits, the message’s status is needs_input, and userInput holds its questions, each with suggested options. reply holds anything the agent wrote before asking, and can be empty. Abbreviated response:
To be told when an agent asks instead of polling, subscribe a webhook to session.message.needs_input.

Send your answers

Answer each question under its id, with an option’s id or label or in your own words. Send the answers to the message that asked:
The response is the message, running again. Keep reading it as before: the agent carries on with your answers, and its reply arrives in the same message. To let the agent carry on without answering, send { "answer": { "outcome": "skipped" } }. Only the person who sent the message can answer, and only once. A second answer returns 409 with the code user_input_not_requested.

Ask fewer questions

Each question holds up the reply until someone answers. For a choice the agent can make on its own, say so in its instructions, as the instructions in Create and run an agent do: “When the request leaves a choice open, such as which carriers to compare, choose the carriers with the most recent filings and say which you chose.” To change them, save a new version.