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

# Create Session

> Creates a new conversation session for a given agent. 



## OpenAPI

````yaml POST /session/{agent_id}
openapi: 3.0.1
info:
  title: OpenAPI Soca AI
  description: An API for sending messages and retrieving responses from the AI Agent.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.soca.ai/v1
security:
  - private_key: []
paths:
  /session/{agent_id}:
    post:
      description: Creates a new conversation session for a given agent.
      parameters:
        - name: agent_id
          in: path
          required: true
          description: The unique identifier of a Soca AI agent created in the Studio.
          schema:
            type: string
      responses:
        '200':
          description: Indicates that the session was created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSession'
        '400':
          description: Invalid agent_id format or invalid query parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '401':
          description: Invalid or missing private_key in the header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
components:
  schemas:
    CreateSession:
      type: object
      properties:
        status:
          type: boolean
          description: Chat has been delivered successfully
        message:
          type: string
          description: Response timestamp in ISO 8601 format.
        data:
          type: object
          description: Same session ID as in the request.
          properties:
            session_id:
              type: string
    Error400:
      type: object
      required:
        - error
        - message
      properties:
        status:
          type: boolean
          description: Error code.
        message:
          type: string
          description: Error message description.
    Error401:
      type: object
      required:
        - error
        - message
      properties:
        status:
          type: boolean
          description: Error code.
        message:
          type: string
          description: Error message description.
  securitySchemes:
    private_key:
      type: apiKey
      in: header
      name: private_key

````