> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit Question Answers

> Answer a prior ask_user_questions card and resume the turn (SSE).

When a turn pauses with an `ask_user_questions` card, submit the structured answers here to resume. Answers are validated against the asked questions; a mismatch returns `400` before any run. Streams the resumed turn's events over SSE.

See the [Agent Gateway overview](/api-reference/v1/agents/gateway/overview) for the full conversation model.


## OpenAPI

````yaml POST /v1/agents/{agent_id}/gateway/conversations/{conversation_id}/answers
openapi: 3.1.0
info:
  title: xpander.ai API Service
  description: |2-

        The xpander.ai API Service provides a unified REST API for managing AI agents,
        executing tasks, managing knowledge bases, and integrating with external systems.
        
        Features:
        - Agent Management: Create, update, deploy, and delete AI agents
        - Task Execution: Invoke agents with support for sync, async, and streaming modes
        - Knowledge Bases: Manage knowledge bases and documents for RAG workflows
        - Tools: Discover, connect, and attach tools (connectors, custom functions, MCP servers, sub-agents, workflows) to agents and workflows
        - MCP Integration: Model Context Protocol support for standardized AI interactions
        
        Authentication: All endpoints require authentication via either an API key (`x-api-key`) or an OAuth2 JWT (`Authorization: Bearer <jwt>`).
        
  version: '0.001'
servers:
  - url: https://api.xpander.ai
security: []
paths:
  /v1/agents/{agent_id}/gateway/conversations/{conversation_id}/answers:
    post:
      tags:
        - API v1
        - Agents
        - Agent Gateway
      summary: Submit Question Answers (Stream)
      description: >-
        Submit structured answers to a prior ask_user_questions card and resume
        the gateway turn, streaming every event over SSE.
      operationId: >-
        Submit_Question_Answers__Stream__v1_agents__agent_id__gateway_conversations__conversation_id__answers_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: conversation_id
          in: path
          required: true
          schema:
            type: string
            title: Conversation Id
        - name: version
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Agent version to run.
            title: Version
          description: Agent version to run.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AskUserQuestionsSubmission'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    AskUserQuestionsSubmission:
      properties:
        decision_id:
          type: string
          title: Decision Id
          description: Id of the AskUserQuestions activity entry being answered.
        answers:
          items:
            $ref: '#/components/schemas/AskUserQuestionAnswer'
          type: array
          title: Answers
        user:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: User
      type: object
      required:
        - decision_id
        - answers
      title: AskUserQuestionsSubmission
      description: Body of the chat-backend answers endpoint.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AskUserQuestionAnswer:
      properties:
        question_id:
          type: string
          title: Question Id
        selected_option_ids:
          items:
            type: string
          type: array
          title: Selected Option Ids
        free_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Free Text
      type: object
      required:
        - question_id
      title: AskUserQuestionAnswer
      description: The user's answer to one question.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: API Key for authentication
      in: header
      name: x-api-key

````