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

# Create Lead Session

> Create a lead session for a new client inquiry.

**Required scope:** `write`

Call this when a client contacts the provider through any channel.
The session tracks the discovery state and links the client channel
to the provider's Agent Mode conversation.

Set `callbackUrl` to receive a POST when the session status changes
(e.g. when the provider marks the proposal as ready).



## OpenAPI

````yaml /openapi/openapi-external.json post /lead-sessions
openapi: 3.1.0
info:
  title: Quikly.ai External API
  version: 1.0.0
  description: >-
    REST API for external integrations with Quikly.ai. Authenticate using an API
    key passed in the X-API-Key header. Use these endpoints from n8n, Zapier,
    custom scripts, or any HTTP client.
servers: []
security:
  - ApiKeyAuth: []
tags:
  - name: Proposals
    description: Create, read, update, and manage client proposals.
  - name: Profile
    description: Read and update the authenticated user's profile.
  - name: Templates
    description: Manage reusable proposal templates.
  - name: AI Services
    description: >-
      AI-powered analysis: rate recommendations, brief analysis,
      differentiators.
  - name: Public API
  - name: Usage
    description: Query API usage and quota information.
  - name: Webhooks
    description: Manage webhook subscriptions for real-time events.
  - name: Agent
    description: Interact with the AI agent for automated workflows.
  - name: Lead Sessions
    description: Track and manage lead capture sessions.
paths:
  /lead-sessions:
    post:
      tags:
        - Lead Sessions
      summary: Create Lead Session
      description: |-
        Create a lead session for a new client inquiry.

        **Required scope:** `write`

        Call this when a client contacts the provider through any channel.
        The session tracks the discovery state and links the client channel
        to the provider's Agent Mode conversation.

        Set `callbackUrl` to receive a POST when the session status changes
        (e.g. when the provider marks the proposal as ready).
      operationId: create_lead_session_api_external_v1_lead_sessions_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadSessionCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    LeadSessionCreate:
      properties:
        channel:
          type: string
          title: Channel
          description: 'Client channel: telegram, whatsapp, web, etc.'
        channelId:
          type: string
          title: Channelid
          description: Client ID in that channel (chatId, phone, sessionId)
        callbackUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Callbackurl
          description: URL to notify when status changes
        clientName:
          anyOf:
            - type: string
            - type: 'null'
          title: Clientname
        clientEmail:
          anyOf:
            - type: string
            - type: 'null'
          title: Clientemail
        brief:
          anyOf:
            - type: string
            - type: 'null'
          title: Brief
        discoveryData:
          anyOf:
            - type: object
            - type: 'null'
          title: Discoverydata
        suggestedProposalType:
          anyOf:
            - type: string
            - type: 'null'
          title: Suggestedproposaltype
        language:
          type: string
          title: Language
          default: es
        providerChatId:
          anyOf:
            - type: string
            - type: 'null'
          title: Providerchatid
      type: object
      required:
        - channel
        - channelId
      title: LeadSessionCreate
      description: Create a new lead session from any client channel.
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key obtained from Quikly.ai Settings → API Keys.
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````