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

# Start Conversation

> Starts a new LLM-driven conversation with a lead. The system sends the initial outreach message via the specified channel. Requires `leads:start_conversation` permission.




## OpenAPI

````yaml POST /api/conversations/start
openapi: 3.1.0
info:
  title: Conversations API
  description: API for managing LLM-driven lead qualification conversations.
  version: 1.0.0
servers:
  - url: '{baseUrl}'
    description: API server
    variables:
      baseUrl:
        default: http://localhost:3001
security:
  - ApiKeyAuth: []
  - BearerAuth: []
paths:
  /api/conversations/start:
    post:
      tags:
        - Conversations
      summary: Start Conversation
      description: >
        Starts a new LLM-driven conversation with a lead. The system sends the
        initial outreach message via the specified channel. Requires
        `leads:start_conversation` permission.
      operationId: startConversation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                leadId:
                  type: integer
                  description: The ID of the lead to start a conversation with.
                channel:
                  type: string
                  enum:
                    - whatsapp
                    - telegram
                    - email
                  default: whatsapp
                  description: The messaging channel to use for the conversation.
              required:
                - leadId
      responses:
        '201':
          description: Conversation started successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conversation'
        '400':
          description: >-
            Invalid request (e.g., missing leadId, lead not found, or
            conversation already active).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Messaging channel not configured for this account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Conversation:
      type: object
      properties:
        _id:
          type: string
          description: MongoDB ObjectId of the conversation.
          example: 665f1a2b3c4d5e6f7a8b9c0d
        leadId:
          type: string
          description: The ID of the associated lead.
        accountId:
          type: string
          description: MongoDB ObjectId of the account (tenant).
        agentConfigId:
          type: string
          description: MongoDB ObjectId of the agent configuration used.
        campaignId:
          type: string
          description: >-
            MongoDB ObjectId of the campaign, if conversation was started by a
            campaign.
        channel:
          type: string
          enum:
            - whatsapp
            - telegram
            - email
          description: The messaging channel used for this conversation.
        leadPhone:
          type: string
          description: The lead's phone number.
        leadEmail:
          type: string
          description: The lead's email address.
        status:
          type: string
          enum:
            - active
            - completed
            - handed_off
            - dropped
          description: Current status of the conversation.
        currentStageIndex:
          type: integer
          description: Index of the current conversation stage.
        currentStageName:
          type: string
          description: Name of the current conversation stage.
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ConversationMessage'
          description: Ordered list of messages in the conversation.
        summary:
          type: string
          description: LLM-generated summary of the conversation.
        qualificationResult:
          $ref: '#/components/schemas/QualificationResult'
        messageCount:
          type: integer
          description: Total number of messages in the conversation.
        createdAt:
          type: string
          format: date-time
          description: When the conversation was created.
        updatedAt:
          type: string
          format: date-time
          description: When the conversation was last updated.
      required:
        - _id
        - leadId
        - accountId
        - agentConfigId
        - channel
        - leadPhone
        - status
        - currentStageIndex
        - messages
        - messageCount
        - createdAt
        - updatedAt
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
      required:
        - error
    ConversationMessage:
      type: object
      properties:
        role:
          type: string
          enum:
            - agent
            - lead
          description: The sender role of the message.
        content:
          type: string
          description: The text content of the message.
        timestamp:
          type: string
          format: date-time
          description: When the message was sent.
        agentConfigId:
          type: string
          description: The agent config used when generating this message.
      required:
        - role
        - content
        - timestamp
    QualificationResult:
      type: object
      properties:
        qualified:
          type: boolean
          description: Whether the lead was qualified.
        reason:
          type: string
          description: Explanation of the qualification decision.
      required:
        - qualified
        - reason
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for programmatic access (format nl_live_* or nl_test_*)
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token using an API key (format nl_live_* or nl_test_*)

````