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

# Get a lead



## OpenAPI

````yaml https://megastream25-api.closebot.com/swagger/v1/swagger.json get /lead/{leadId}
openapi: 3.0.1
info:
  title: CloseBot API
  version: v1
servers:
  - url: https://api.closebot.com
    description: CloseBot API Endpoint
security:
  - Key: []
paths:
  /lead/{leadId}:
    get:
      tags:
        - Lead
      summary: Get a lead
      parameters:
        - name: leadId
          in: path
          description: The ID of the lead to get.
          required: true
          style: simple
          schema:
            type: string
        - name: includeExternal
          in: query
          description: >-
            Include external fields of the lead in the result (fields from the
            CRM).
          style: form
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/LeadDto'
            application/json:
              schema:
                $ref: '#/components/schemas/LeadDto'
            text/json:
              schema:
                $ref: '#/components/schemas/LeadDto'
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    LeadDto:
      type: object
      properties:
        id:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        contactId:
          type: string
          nullable: true
        lastMessageTime:
          type: string
          format: date-time
          nullable: true
        lastMessage:
          type: string
          nullable: true
        lastMessageDirection:
          type: string
          nullable: true
        lastMessageBotId:
          type: string
          nullable: true
        mostRecentFailureReason:
          type: string
          nullable: true
        mimicSourceId:
          type: string
          nullable: true
        starred:
          type: boolean
        unread:
          type: boolean
        source:
          $ref: '#/components/schemas/LeadSourceDto'
        wontRespondUntil:
          type: string
          format: date-time
          nullable: true
        tags:
          type: array
          items:
            type: string
          nullable: true
        fields:
          type: array
          items:
            $ref: '#/components/schemas/LeadFieldDto'
          nullable: true
        instances:
          type: array
          items:
            $ref: '#/components/schemas/BotInstanceDto'
          nullable: true
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    LeadSourceDto:
      type: object
      properties:
        name:
          type: string
          nullable: true
        id:
          type: string
          nullable: true
      additionalProperties: false
    LeadFieldDto:
      type: object
      properties:
        field:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        value:
          type: string
          nullable: true
        aiProduced:
          type: boolean
      additionalProperties: false
    BotInstanceDto:
      type: object
      properties:
        botId:
          type: string
          nullable: true
        botVersion:
          type: string
          nullable: true
        followUpTimezoneKind:
          type: string
          nullable: true
        followUpTimezone:
          type: string
          nullable: true
        followUpTime:
          type: string
          format: date-time
          nullable: true
        isSmartFollowUpTime:
          type: boolean
        scheduleRespondTime:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
  securitySchemes:
    Key:
      type: apiKey
      description: CloseBot API Key Authorization
      name: X-CB-KEY
      in: header

````