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

# Create chat

> Start a new live chat session backed by a chat agent.



## OpenAPI

````yaml /openapi.json post /api/chats
openapi: 3.1.0
info:
  title: UponAI Platform API
  version: '2026-04-20'
  description: >-
    Programmatic control plane for configuring UponAI agents, LLM
    configurations, conversation flows, knowledge bases, calls, chats, voices,
    and test tooling. All endpoints require a bearer token obtained from your
    profile settings.
servers:
  - url: https://api.upon-ai.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Calls
    description: Initiate and manage UponAI powered voice and web calls.
  - name: Agents
    description: Configure agents that power calls and web sessions.
  - name: LLM Models
    description: Manage reusable large language model configurations for agents.
  - name: Chat Agents
    description: Configure agents for browser and messaging chat sessions.
  - name: Chats
    description: Start and manage live chat sessions.
  - name: Conversation Flows
    description: Build and maintain reusable dialog graphs for agents.
  - name: Knowledge Bases
    description: Store and curate grounded knowledge sources.
  - name: Voices
    description: Discover, search, add, and clone speech synthesis voices.
  - name: Test Case Definitions
    description: Define simulation test cases for response engines.
  - name: Test Runs
    description: Retrieve results for individual and batch test runs.
  - name: Account
    description: Account level utilities and limits.
  - name: Phone Numbers
    description: List and assign phone numbers to agents.
paths:
  /api/chats:
    post:
      tags:
        - Chats
      summary: Create chat
      description: Start a new live chat session backed by a chat agent.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateChatRequest'
            examples:
              default:
                value:
                  workspaceId: 42
                  agent_id: chat_agent_01hzk4q6dr3n0d4qzpw9z6gth6
                  metadata:
                    source: website
                    page: /pricing
                  uponai_dynamic_variables:
                    customer_tier: enterprise
      responses:
        '201':
          description: Chat created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Chat'
components:
  schemas:
    CreateChatRequest:
      type: object
      required:
        - workspaceId
        - agent_id
      properties:
        workspaceId:
          type: integer
        agent_id:
          type: string
        metadata:
          type: object
          additionalProperties:
            type: string
        uponai_dynamic_variables:
          type: object
          additionalProperties:
            type: string
    Chat:
      type: object
      properties:
        chatId:
          type: string
        agentId:
          type: string
        version:
          type: integer
        status:
          type: string
        type:
          type: string
          example: web_chat
        metadata:
          type: object
          additionalProperties:
            type: string
        customAttributes:
          type: object
          additionalProperties:
            type: string
        startedAt:
          type: string
          format: date-time
          nullable: true
        endedAt:
          type: string
          format: date-time
          nullable: true
        transcript:
          type: string
          nullable: true
        messages:
          type: array
          items:
            $ref: '#/components/schemas/Message'
        chatCost:
          type: object
          nullable: true
        chatAnalysis:
          type: object
          nullable: true
        collectedDynamicVariables:
          type: object
        uponai_dynamic_variables:
          type: object
          additionalProperties:
            type: string
        overrideDynamicVariables:
          type: object
          additionalProperties:
            type: string
    Message:
      type: object
      properties:
        role:
          type: string
          enum:
            - assistant
            - user
        content:
          type: string
        name:
          type: string
          nullable: true
        tool_calls:
          type: array
          items:
            type: object
      required:
        - role
        - content
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Generate tokens from your profile settings at app.uponai.com.

````