Skip to main content
POST
/
v1
/
next-questions
curl --request POST \
  --url https://api.zelinqa.ai/v1/next-questions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "session_id": "conv-7f3a1c",
  "conversation_history": [
    {
      "role": "assistant",
      "content": "Hi! Tell me about the space you are furnishing."
    },
    {
      "role": "user",
      "content": "I am looking for an outdoor dining table for my terrace."
    }
  ],
  "answered_question_ids": []
}
'
{
  "next_question": {
    "external_id": "q_budget_range",
    "text": "What budget range did you have in mind for the table?"
  },
  "exhausted": false,
  "nbq_version": "0.9.0-beta.1",
  "request_id": "req_3b9f0a1c2d4e6f80"
}

Authorizations

Authorization
string
header
required

Pass your NBQ API key in the Authorization header: Bearer nbq_live_xxx

Body

application/json
session_id
string
required

A stable identifier for the conversation. Reuse the same value for every call within one conversation — this is how usage is counted.

Required string length: 1 - 128
Example:

"conv-7f3a1c"

conversation_history
object[]

The full conversation so far, as an ordered list of messages. Required if context is not provided. The last message must have role: "user".

Maximum array length: 50
context
string

A free-text summary of the conversation so far. Required if conversation_history is not provided. Include facts gathered, user segment, and latest intent. Maximum 8000 characters.

Maximum string length: 8000
Example:

"Visitor wants an outdoor dining table for a south-facing terrace. Prefers contemporary metal. Budget not yet discussed."

answered_question_ids
string[]

The external_id values of questions already asked and answered. NBQ excludes these so it never repeats a question.

Maximum array length: 200
Example:
["q_budget_range", "q_seating_capacity"]

Response

Next question returned

next_question
object

The recommended next question, or null when exhausted is true.

exhausted
boolean

true when all eligible questions have been asked. Treat this as the signal to end the question flow.

Example:

false

nbq_version
string

Version identifier of the active NBQ Studio configuration. Include in logs and support requests.

Example:

"0.9.0-beta.1"

request_id
string

Unique ID for this API call. Include in any support request.

Example:

"req_3b9f0a1c2d4e6f80"