Responsibilities
Recommended loop
- Create a session once with
POST /v1/sessions. - Call
/nextwith the lateststate_version. - Use
candidates[0], or select another candidate if your product requires it. - After the answer, call
/nextagain withprevious_turn. - Send external information through
/eventswithout triggering a new selection. - Submit the final outcome through
/feedback.
If your backend restarts, read the session with
GET /v1/sessions/{session_id}. Do not rebuild state from a stale local copy.Choice answers
When your interface displays choices provided by NBQ, return theirchoice_id values in structured_answer.choice_ids. This avoids unnecessary semantic interpretation and preserves deterministic mapping.
Prefer structured answers
When your application already knows what an answer means, send that interpretation directly:previous_turn.outcomereports whether the question was answered, left unanswered, or explicitly refused;structured_answer.choice_idssends selections from a closed or semi-open question;client_updates.datasends business data already validated by your system.
user_text and let NBQ analyze it.
outcome describes the result of the question, but does not create business data by itself. Also send structured_answer or client_updates when your system knows the information obtained.First API call
Follow the complete curl example.
API reference
Explore routes, schemas, and response codes.