API ReferenceVoice

Send one typed or spoken sentence, get one answer

POST
/console/api/voice/turn

Send either text or the transcript_id returned by transcribeVoice. The assistant answers a question from the records, proposes rules (then needs_confirm is true and a token is returned for answerVoice), or says it did not understand. The text shown is the text spoken.

Authorization

consoleSession csrfToken
clearwake_console<token>

Set by GET /console/api/session. HttpOnly, SameSite=Strict, 8 hours.

In: cookie

X-Clearwake-CSRF<token>

The csrf value from GET /console/api/session, an HMAC of the session id. Required on every POST.

In: header

Request Body

application/json

Typed text, or the id of a transcript held on the server.

Send text or a transcript id.

text?string

Typed text.

Lengthlength <= 500
transcript_id?string

Id returned by transcribeVoice.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/console/api/voice/turn" \  -H "Content-Type: application/json" \  -d '{    "text": "what happened with my disputes"  }'
{  "intent": "ask",  "source": "typed",  "transcript": "what happened with my disputes",  "transcript_sha256": "d3e83ba34c310d83d205eed5e026bee14d33364c31f1082d8a6536f819dac8f0",  "text": "There are no disputes today on the records.",  "speak": "There are no disputes today on the records.",  "needs_confirm": false,  "token": null,  "how": "matcher",  "facts": {    "disputes": 0,    "closed": 0,    "with_owner": 0,    "scope": "today"  }}