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

# Delete multiple visible leads

> A lead whose patient was erased is reported as failed with `CUSTOMER_ERASED`; the rest are deleted.



## OpenAPI

````yaml /api-referansi/openapi.json post /v1/leads/bulk-delete
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: >-
    Flextell REST API referansı. Kimlik doğrulama, scope ve istek kuralları için
    API sekmesindeki rehberlere bakın.
servers:
  - url: https://app.flextell.ai/api
    description: Üretim
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/leads/bulk-delete:
    post:
      tags:
        - Lead
      summary: Delete multiple visible leads
      description: >-
        A lead whose patient was erased is reported as failed with
        `CUSTOMER_ERASED`; the rest are deleted.
      operationId: lead.bulkDelete
      parameters:
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadBulkDeleteRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    type: object
                    properties:
                      success_count:
                        type: integer
                      failed_count:
                        type: string
                      results:
                        type: array
                        items:
                          anyOf:
                            - type: object
                              properties:
                                lead_id:
                                  type: string
                                success:
                                  type: boolean
                                error_code:
                                  type: string
                                  const: RESOURCE_NOT_FOUND
                                message:
                                  type: string
                              required:
                                - lead_id
                                - success
                                - error_code
                                - message
                            - type: object
                              properties:
                                lead_id:
                                  type: string
                                success:
                                  type: boolean
                                error_code:
                                  type: string
                                  const: CUSTOMER_ERASED
                                message:
                                  type: string
                              required:
                                - lead_id
                                - success
                                - error_code
                                - message
                            - type: object
                              properties:
                                lead_id:
                                  type: string
                                success:
                                  type: boolean
                              required:
                                - lead_id
                                - success
                            - type: object
                              properties:
                                lead_id:
                                  type: string
                                success:
                                  type: boolean
                                error_code:
                                  type: string
                                  const: SERVER_ERROR
                                message:
                                  type: string
                              required:
                                - lead_id
                                - success
                                - error_code
                                - message
                    required:
                      - success_count
                      - failed_count
                      - results
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
        '428':
          description: >-
            Mandatory setup is incomplete. Finish the setup wizard first;
            `data.next_step` names the step to continue with.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    examples:
                      - false
                  error_code:
                    type: string
                    enum:
                      - SETUP_REQUIRED
                    examples:
                      - SETUP_REQUIRED
                  message:
                    type: string
                    examples:
                      - Complete the required setup steps to continue.
                  data:
                    type: object
                    properties:
                      next_step:
                        type:
                          - string
                          - 'null'
                        examples:
                          - clinic_info
                    required:
                      - next_step
                required:
                  - success
                  - error_code
                  - message
                  - data
components:
  schemas:
    LeadBulkDeleteRequest:
      type: object
      properties:
        lead_ids:
          type: array
          description: The unique lead identifiers to delete.
          items:
            type: integer
            description: A positive lead identifier.
            minimum: 1
          minItems: 1
          maxItems: 100
      required:
        - lead_ids
      title: LeadBulkDeleteRequest
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://dev.flextell.ai/oauth/authorize
          tokenUrl: https://dev.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.