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

# List leads

> Base ViewSet para modelos que referencian a Stakeholder.
Enriquecemos el queryset con joins y un campo 'stakeholder_name',
y aplicamos automáticamente el filtro por member_id si está en el request.



## OpenAPI

````yaml /api-reference/openapi.json get /crm/lead/
openapi: 3.0.3
info:
  title: Fail Fast API
  version: v1
  description: >-
    REST API for the Fail Fast platform. Authenticate with a workspace API key
    sent as a bearer token. Every response uses the `{message, error, data}`
    envelope.
servers:
  - url: https://api.failfast.ai
security: []
paths:
  /crm/lead/:
    get:
      tags:
        - CRM
      summary: List leads
      description: >-
        Base ViewSet para modelos que referencian a Stakeholder.

        Enriquecemos el queryset con joins y un campo 'stakeholder_name',

        y aplicamos automáticamente el filtro por member_id si está en el
        request.
      operationId: crm_lead_list
      parameters:
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: take
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: fields
          in: query
          required: false
          description: >-
            Comma-separated list of fields to include in each result (sparse
            fieldsets).
          schema:
            type: string
        - name: sort
          in: query
          required: false
          description: >-
            Comma-separated sort fields. Prefix a field with '-' for descending
            order.
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                  - error
                  - data
                properties:
                  message:
                    type: string
                    description: Human-readable outcome of the request.
                  error:
                    type: boolean
                    description: true when the request failed.
                    example: false
                  data:
                    $ref: '#/components/schemas/PaginatedLeadList'
          description: ''
      security:
        - apiKey: []
components:
  schemas:
    PaginatedLeadList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Lead'
    Lead:
      type: object
      description: |-
        A ModelSerializer that takes an additional `fields` argument that
        controls which fields should be displayed.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        custom_fields:
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        deleted_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        audit_status:
          allOf:
            - $ref: '#/components/schemas/AuditStatusEnum'
          readOnly: true
        source:
          type: string
        status:
          type: string
        member:
          type: string
          format: uuid
          readOnly: true
        created_by:
          type: string
          format: uuid
          readOnly: true
        updated_by:
          type: string
          format: uuid
          readOnly: true
          nullable: true
        deleted_by:
          type: string
          format: uuid
          readOnly: true
          nullable: true
        user_member:
          type: string
          format: uuid
        company:
          type: string
          format: uuid
          nullable: true
        person:
          type: string
          format: uuid
      required:
        - audit_status
        - created_at
        - created_by
        - deleted_at
        - deleted_by
        - id
        - member
        - person
        - source
        - status
        - updated_at
        - updated_by
        - user_member
    AuditStatusEnum:
      enum:
        - C
        - U
        - D
      type: string
      description: |-
        * `C` - Created
        * `U` - Updated
        * `D` - Deleted
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        Workspace API key sent as a bearer token: `Authorization: Bearer
        failfast_...`. Create keys in Settings -> Workspace -> API Keys.

````