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

# Submit pre-session answers

> Submit answers to a session's pre-session questions and receive the
facilitator's opening message. This starts the facilitation for the participant.

Call this once per participant before using the `/chat` endpoint.
The answers are passed to the facilitator as context for the conversation.




## OpenAPI

````yaml /api-reference/openapi.yaml post /sessions/{id}/chat/questions
openapi: 3.1.0
info:
  title: Harmonica API
  version: 1.0.0
  description: >
    REST API for the Harmonica structured deliberation platform.

    Provides access to sessions and their data, including creating, updating,
    and querying sessions, plus response submission for active sessions.
  contact:
    name: Harmonica
    url: https://harmonica.chat
servers:
  - url: https://app.harmonica.chat/api/v1
    description: Production
  - url: http://localhost:3000/api/v1
    description: Local development
security:
  - apiKey: []
paths:
  /sessions/{id}/chat/questions:
    post:
      tags:
        - Chat
      summary: Submit pre-session answers
      description: >
        Submit answers to a session's pre-session questions and receive the

        facilitator's opening message. This starts the facilitation for the
        participant.


        Call this once per participant before using the `/chat` endpoint.

        The answers are passed to the facilitator as context for the
        conversation.
      operationId: submitChatQuestions
      parameters:
        - $ref: '#/components/parameters/sessionId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatQuestionsRequest'
      responses:
        '200':
          description: Facilitator opening message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatResponse'
        '400':
          description: Validation error (missing fields, session not active)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    sessionId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Session ID
  schemas:
    ChatQuestionsRequest:
      type: object
      description: Submit pre-session question answers to start facilitation.
      properties:
        participant_id:
          type: string
          description: Unique identifier for the participant
        participant_name:
          type: string
          description: Display name of the participant
        answers:
          type: array
          items:
            type: object
            properties:
              question_id:
                type: string
              answer:
                type: string
            required:
              - question_id
              - answer
      required:
        - participant_id
        - participant_name
        - answers
    ChatResponse:
      type: object
      description: Facilitator response to a chat message.
      properties:
        message:
          type: object
          properties:
            role:
              type: string
              enum:
                - assistant
            content:
              type: string
              description: The facilitator's response
            is_final:
              type: boolean
              description: Whether the facilitator considers this conversation complete
          required:
            - role
            - content
            - is_final
        thread_id:
          type: string
          description: The participant's thread ID in this session
      required:
        - message
        - thread_id
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - forbidden
                - not_found
                - validation_error
                - rate_limited
                - internal_error
                - unprocessable
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Invalid or missing API key
    Forbidden:
      description: Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: forbidden
              message: You don't have access to this session
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: not_found
              message: Session not found
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: |
        API key authentication. Pass your key as a Bearer token.
        Keys use the format `hm_live_<32 hex chars>`.
        Generate keys from your Harmonica dashboard settings.

````