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

# List leads

> Cursor-paginated list of leads for the authenticated tenant, ordered by `created_at DESC, id DESC`. Pass `stale_for_days=N` to scope the result to qualified leads whose conversation has gone quiet for more than N days — the canonical query the lead-nurture automation uses to find its daily cohort.



## OpenAPI

````yaml https://app.vorel.ai/api/v1/openapi.json get /api/v1/leads
openapi: 3.1.0
info:
  title: Vorel API
  version: 0.1.0
  description: >-
    Public API for Vorel — the AI receptionist for any business. Read your
    conversations, leads, appointments, and catalog; push CRM-side updates back
    into the platform. All endpoints accept bearer-auth API keys issued at
    `/settings/integrations/api-keys` in the dashboard. Per-key rate limit is
    200 req/min.
  contact:
    name: Vorel support
    email: hello@vorel.ai
  license:
    name: Proprietary
servers:
  - url: https://app.vorel.ai
    description: Production
  - url: http://localhost:3000
    description: Local dev
security:
  - BearerAuth: []
tags:
  - name: Conversations
    description: Inbound customer conversations across channels.
  - name: Leads
    description: Qualified-lead rows attached to conversations.
  - name: Appointments
    description: Scheduled customer engagements.
  - name: Offerings
    description: Tenant catalog (properties, services, treatments — vertical-specific).
  - name: Analytics
    description: >-
      Aggregate metrics for tenant + automation consumers. The around-the-brain
      workflows read these rather than mass-querying the resource endpoints.
  - name: CRM
    description: >-
      Operator-side writes into the tenant's configured CRM (HubSpot /
      Salesforce / Zoho / etc.). Per-tenant field mappings translate canonical
      Vorel keys to vendor-side keys before the driver call.
paths:
  /api/v1/leads:
    get:
      tags:
        - Leads
      summary: List leads
      description: >-
        Cursor-paginated list of leads for the authenticated tenant, ordered by
        `created_at DESC, id DESC`. Pass `stale_for_days=N` to scope the result
        to qualified leads whose conversation has gone quiet for more than N
        days — the canonical query the lead-nurture automation uses to find its
        daily cohort.
      operationId: listLeads
      parameters:
        - $ref: '#/components/parameters/LimitParam'
        - $ref: '#/components/parameters/CursorParam'
        - name: stale_for_days
          in: query
          required: false
          description: >-
            When set, scopes the result to qualified leads whose conversation
            `last_message_at` is older than `now() - <stale_for_days> days` (or
            NULL). Range 1–365. Returns 400 outside that range.
          schema:
            type: integer
            minimum: 1
            maximum: 365
      responses:
        '200':
          description: Page of leads.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - next_cursor
                  - has_more
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Lead'
                  next_cursor:
                    type: string
                    format: uuid
                    nullable: true
                  has_more:
                    type: boolean
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - BearerAuth:
            - read
components:
  parameters:
    LimitParam:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
      description: Max rows per page. Server caps at 100.
    CursorParam:
      name: cursor
      in: query
      required: false
      schema:
        type: string
        format: uuid
      description: Cursor from a prior page response. Omit for the first page.
  schemas:
    Lead:
      type: object
      required:
        - id
        - conversation_id
        - attributes
        - status
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        conversation_id:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        email:
          type: string
          format: email
          nullable: true
        phone:
          type: string
          nullable: true
        intent:
          type: string
          nullable: true
        attributes:
          type: object
          additionalProperties: true
          description: >-
            Vertical-specific JSONB. Real estate emits
            `bedrooms`/`budget_min`/`area`/etc.; salons emit
            `preferred_stylist`/`service_history`/etc.; clinics emit
            `insurance_provider`/`symptoms_summary`/etc. The shape is determined
            by the tenant's vertical pack — consult your operator setup for the
            keys to expect.
        timeline:
          type: string
          nullable: true
        qualification_score:
          type: integer
          minimum: 0
          maximum: 100
          nullable: true
        status:
          type: string
          enum:
            - new
            - qualified
            - booked
            - converted
            - lost
        source:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - forbidden
                - rate_limited
                - bad_request
                - not_found
                - conflict
                - internal_error
              description: Machine-readable error category.
            message:
              type: string
              description: >-
                Human-readable error description; safe to surface in tenant
                logs.
  responses:
    BadRequest:
      description: Body validation failed. Error message names the offending field.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unauthorized:
      description: Missing, malformed, unknown, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: >-
        API key is valid but lacks the required scope for this endpoint. Issue a
        new key with the necessary scope at `/settings/integrations/api-keys`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    RateLimited:
      description: >-
        200 req/min per API key exceeded. `Retry-After` header carries
        seconds-until-reset.
      headers:
        Retry-After:
          schema:
            type: integer
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer
          description: Unix epoch seconds.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: vapk_<env>_<48-hex>
      description: >-
        Tenant-issued API key. Format: `vapk_live_<48 hex chars>` (60 chars
        total). Issue + manage at `/settings/integrations/api-keys` in the Vorel
        dashboard. Each key has a scope set (`read`, `leads:write`,
        `appointments:write`, `offerings:write`); endpoints requiring a write
        scope reject keys without it with a 403 envelope.

````