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

# Create Conversation

> Creates a new Conversation

This endpoint lets you create a new conversation.


## OpenAPI

````yaml api-reference/openapi.json post /api/v1/conversations/
openapi: 3.0.3
info:
  title: Wassist API
  version: 1.0.0
  description: API for building WhatsApp AI agents
servers:
  - url: https://backend.wassist.app
    description: Production
  - url: http://localhost:8050
    description: Development
security: []
tags:
  - name: Agents
    description: Create and manage AI agents
  - name: Conversations
    description: Chat conversations and messages
  - name: WhatsApp
    description: WhatsApp Business account management
  - name: Contacts
    description: Contact management
  - name: Integrations
    description: Third-party integrations
paths:
  /api/v1/conversations/:
    post:
      tags:
        - api
      description: |-
        Create a new conversation with an agent.

        Requires agentId and phoneNumber. Optionally send a template message.
      operationId: api_v1_conversations_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConversationInput'
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conversation'
          description: ''
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateConversationInput:
      type: object
      properties:
        toNumber:
          type: string
          description: The phone number of the contact to create the conversation with.
        fromNumber:
          type: string
          description: The whatsapp number to send the mesage from
        agentId:
          type: string
          format: uuid
          description: >-
            The ID of the agent to start the conversation with. If this is a new
            agent for this conversation, it will be a trigger a new session with
            the agent.
        message:
          $ref: '#/components/schemas/CreateConversationMessage'
        phoneNumber:
          type: string
          description: This has been deprecated. Use toNumber instead.
    Conversation:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        contact:
          $ref: '#/components/schemas/ConversationContact'
        activeAgent:
          type: string
          readOnly: true
        chatWindowRemainingTime:
          type: string
          readOnly: true
        lastMessage:
          type: string
          readOnly: true
        isHumanTakeover:
          type: string
          readOnly: true
        active:
          type: string
          readOnly: true
      required:
        - active
        - activeAgent
        - chatWindowRemainingTime
        - contact
        - id
        - isHumanTakeover
        - lastMessage
    CreateConversationMessage:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/CreateConversationMessageTypeEnum'
        template:
          $ref: '#/components/schemas/SendMessageTemplateInput'
      required:
        - type
    ConversationContact:
      type: object
      properties:
        phoneNumber:
          type: string
        name:
          type: string
          nullable: true
      required:
        - name
        - phoneNumber
    CreateConversationMessageTypeEnum:
      enum:
        - template
      type: string
      description: '* `template` - template'
    SendMessageTemplateInput:
      type: object
      properties:
        name:
          type: string
        variables:
          $ref: '#/components/schemas/TemplateVariables'
      required:
        - name
    TemplateVariables:
      type: object
      properties:
        body:
          type: array
          items:
            type: string
        header:
          type: string
        buttons:
          type: array
          items:
            type: string
        cards:
          type: array
          items:
            $ref: '#/components/schemas/Card'
    Card:
      type: object
      properties:
        body:
          type: array
          items:
            type: string
        header:
          type: string
        buttons:
          type: array
          items:
            type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key authentication. Pass your API key in the X-API-Key header.

````