Ask a person a question (own session token only)
const url = 'http://127.0.0.1:8080/v1/sessions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/questions';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"text":"example","kind":"product","context":"example","options":["example"],"blocking":false,"fresh":false}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://127.0.0.1:8080/v1/sessions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/questions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "text": "example", "kind": "product", "context": "example", "options": [ "example" ], "blocking": false, "fresh": false }'The call never waits for a person (ADR-0009, section 1). It returns
answered when an earlier answer a person gave fits (section 3), and
pending otherwise. A pending question goes to its recipient as a
question_asked notice. A product question goes to the user who
registered the session’s intent, or the session’s owner. A
technical one goes to the session’s owner. Text, context, and
options pass the secret scan. A session has at most 10 open
questions.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Product: a gap in what to build, answered by a requester or above. technical: how to build it, answered by an engineer or above.
The agent waits for the answer. Shortens the remind, escalate, and expire deadlines.
Skip answer reuse, for when the reused answer does not fit.
Responses
Section titled “Responses”Stored.
object
Answered only when an earlier answer was reused.
object
Product: a gap in what to build, answered by a requester or above. technical: how to build it, answered by an engineer or above.
The agent’s words after the secret scan. This is the record.
What the recipient reads first. Never the record.
object
object
object
object
The chosen option, numbered from 1.
The free text, or the chosen option’s text.
The person’s answer a reused answer copies.
object
Up to three of the session’s most urgent undelivered notices, one line each, after a “Zentri notices:” header. A last line says how many more wait. Showing a notice here marks it delivered but not acked. Absent when nothing is undelivered or the caller is not the session’s own token.
Example
{ "status": "pending", "question": { "kind": "product", "status": "open", "phrased_for": "plain", "phrased_by": "template", "answer_floor": "viewer", "answer": { "source": "human" } }}The request is malformed.
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}No valid bearer token.
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}The token may not do this.
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}No such resource in the caller’s org.
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}The request clashes with current state.
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}The request is well formed but breaks a rule or a limit.
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}A rate limit or quota stopped the request. Retry-After gives seconds to wait.
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}