> ## 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.

# Agent Chat External

> Conversational proposal creation via Agent Mode.

**Required scope:** `write`

This exposes the full Agent Mode flow (12 phases: greeting, brief,
discovery, requirements, configuration, pricing, review, generate, etc.)
via API key auth. Use it from n8n, Telegram bots, or any external
integration.

Each call is one conversation turn. Pass `conversationId` to continue
an existing conversation, or omit to start a new one.

Response includes:
- `message`: Agent text response (markdown)
- `phase`: Current conversation phase
- `collectedData`: All data collected so far
- `actions`: Quick-action buttons (label + value)
- `questions`: Structured questions with selectable options
- `requirements`: Extracted requirements (when available)
- `pricing`: Rate/pricing suggestion (when available)
- `proposalId` / `shareLink`: Set when proposal is created



## OpenAPI

````yaml /openapi/openapi-external.json post /agent/chat
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:
  /agent/chat:
    post:
      tags:
        - Agent
      summary: Agent Chat External
      description: |-
        Conversational proposal creation via Agent Mode.

        **Required scope:** `write`

        This exposes the full Agent Mode flow (12 phases: greeting, brief,
        discovery, requirements, configuration, pricing, review, generate, etc.)
        via API key auth. Use it from n8n, Telegram bots, or any external
        integration.

        Each call is one conversation turn. Pass `conversationId` to continue
        an existing conversation, or omit to start a new one.

        Response includes:
        - `message`: Agent text response (markdown)
        - `phase`: Current conversation phase
        - `collectedData`: All data collected so far
        - `actions`: Quick-action buttons (label + value)
        - `questions`: Structured questions with selectable options
        - `requirements`: Extracted requirements (when available)
        - `pricing`: Rate/pricing suggestion (when available)
        - `proposalId` / `shareLink`: Set when proposal is created
      operationId: agent_chat_external_api_external_v1_agent_chat_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentChatExternalRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    AgentChatExternalRequest:
      properties:
        conversationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Conversationid
          description: Existing conversation ID. None to start new.
        message:
          type: string
          maxLength: 10000
          title: Message
          description: User message text
        language:
          type: string
          title: Language
          default: es
        proposalLanguage:
          anyOf:
            - type: string
            - type: 'null'
          title: Proposallanguage
        appliedTemplateConfig:
          anyOf:
            - type: object
            - type: 'null'
          title: Appliedtemplateconfig
          description: Template config (rate, validity, type, etc.) for agent context.
      type: object
      required:
        - message
      title: AgentChatExternalRequest
      description: Request for Agent Mode via API key authentication.
    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

````