Skip to content
Subako Docs
English
Esc
↑↓navigate↵open⌘Jpreview

Answer a form

Answers a form the agent put through builtin:ask_user: submit it with one outcome per question, or dismiss it. A question the client cannot draw is answered unsupported, so the agent can ask it another way.

POST/v1/sessions/{session_id}/inputs/{call_id}
Authorization
AuthorizationBearer token · headerrequired
Path parameters
session_idstring<uuid>required
Session id
call_idstringrequired
The call_id the `input_requested` event named
Header parameters
Idempotency-Keystring
Retry the same operation with this key to return its saved receipt. Scoped by the operation's authenticated caller or resource. A different input under the same key returns 409. Receipts are retained for at least 7 days after completion, then removed by an hourly sweep. After removal the key can execute again. Fresh-only secrets are never included in a replay.
min length 1 · max length 255
Request body
requiredapplication/json
One of:
object
dataobjectrequired
Show properties
answersQuestionAnswerBody[]required
Show properties
Array of QuestionAnswerBody
outcomeQuestionOutcomeBodyrequired
What became of one question.
Show properties
One of:
object
dataobjectrequired
Answered with `value`, which the question's widget must take.
Show properties
valueanyrequired
typestringrequired
Allowed:answered
object
typestringrequired
Allowed:skipped
object
typestringrequired
Allowed:unsupported
question_idstringrequired
typestringrequired
Allowed:submitted
object
dataobjectrequired
Show properties
messagestring | null
typestringrequired
Allowed:declined
Responses
200Answered, and recorded in the log. The broker holding the call reads the answer on its next tick and answers the engine in line; past the hold, the run's requeue re-fires the call instead.
created_atstring<date-time>required
seqinteger<int64>required
400Malformed body or path parameter, or an answer the form does not take: an outcome missing or repeated, a required question skipped, or a value its widget refuses.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
401Missing, malformed, or invalid bearer token.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
403A workspace credential lacking session.manage. A session token carries no permissions and never lands here.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
404No such session, the caller cannot see it, or a session token authenticates for another one; or no form is pending for this call.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
409Idempotency-Key was already used for a different request. The form is already settled.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST "https://api.us.cloud.subako.ai/v1/sessions/497f6eca-6276-4993-bfeb-53cbbbba6f08/inputs/string" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "data": {
    "answers": [
      {
        "outcome": {
          "data": {
            "value": null
          },
          "type": "answered"
        },
        "question_id": "string"
      }
    ]
  },
  "type": "submitted"
}'
Response
{
  "agent_id": "string",
  "agent_version_id": "string",
  "type": "session_created",
  "created_at": "2019-08-24T14:15:22Z",
  "seq": 0
}