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

# Create Session

> Create a new chat session.



## OpenAPI

````yaml /openapi.json post /api/v1/chat/sessions
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/chat/sessions:
    post:
      tags:
        - Chat
      summary: Create Session
      description: Create a new chat session.
      operationId: create_session_api_v1_chat_sessions_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateChatSessionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSessionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateChatSessionRequest:
      properties:
        team_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Team Id
        workspace_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Workspace Id
        session_type:
          type: string
          enum:
            - team_chat
            - agent_chat
            - model_chat
          title: Session Type
          default: team_chat
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
      type: object
      title: CreateChatSessionRequest
      description: Create a new chat session.
    ChatSessionResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        team_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Team Id
        session_type:
          type: string
          title: Session Type
        title:
          type: string
          title: Title
        status:
          type: string
          title: Status
        message_count:
          type: integer
          title: Message Count
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        team_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Type
        team_display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Display Name
      type: object
      required:
        - id
        - session_type
        - title
        - status
        - message_count
        - created_at
        - updated_at
      title: ChatSessionResponse
      description: Chat session metadata.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````