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

# Create Chat Session



## OpenAPI

````yaml post /sessions
openapi: 3.1.0
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.callhq.ai/api
security:
  - apiKeyAuth: []
paths:
  /sessions:
    post:
      tags:
        - Chat
      summary: Create Chat Session
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - assistantId
              properties:
                name:
                  type: string
                  description: Name of the chat session
                assistantId:
                  type: string
                  description: ID of the assistant to use for this session
      responses:
        '200':
          description: Session created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionResponse'
        '400':
          description: Bad request - missing required fields
        '404':
          description: Assistant not found
        '500':
          description: Internal server error
      security:
        - apiKeyAuth: []
components:
  schemas:
    SessionResponse:
      type: object
      properties:
        message:
          type: string
          description: Response message
        session:
          type: object
          properties:
            id:
              type: string
              description: Unique identifier for the session
            name:
              type: string
              description: Name of the session
            assistantId:
              type: string
              description: ID of the assistant used in this session
            status:
              type: string
              description: Status of the session
            messages:
              type: array
              items:
                type: object
                properties:
                  role:
                    type: string
                    enum:
                      - user
                      - assistant
                    description: Role of the message sender
                  content:
                    type: string
                    description: Content of the message
            createdAt:
              type: string
              format: date-time
              description: Creation timestamp
            updatedAt:
              type: string
              format: date-time
              description: Last update timestamp
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````