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

# DeleteLeadAPI removes one lead from Erdo: its row and identity, its
conversations, calls and


> emails, and the follow-up engine's decisions about it, so the same phone and email submitted again make a new lead. Contact details from a call, text or chat stay in the Conversation leads pipeline's run history. There is deliberately no MCP tool, since it cannot be undone. It is a available to organization admins; copies held by providers and in logs stay, so it is not an answer to a data-deletion request. A scoped API key is refused.




## OpenAPI

````yaml /api/openapi.json delete /v1/datasets/{datasetSlug}/leads/{leadRef}
openapi: 3.0.0
info:
  title: Erdo API
  description: >-
    Erdo's REST API: query and write datasets, run agents, manage threads,
    integrations, pages, evals, workstreams, experiments, and bounded outreach.
    Authenticate with a Bearer API key (erdo_api_...) or scoped token
    (erdo_token_...).
  version: '2026-11-21'
servers:
  - url: https://api.erdo.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/datasets/{datasetSlug}/leads/{leadRef}:
    delete:
      summary: |
        DeleteLeadAPI removes one lead from Erdo: its row and identity, its
        conversations, calls and
      description: >
        emails, and the follow-up engine's decisions about it, so the same phone
        and email submitted again make a new lead. Contact details from a call,
        text or chat stay in the Conversation leads pipeline's run history.
        There is deliberately no MCP tool, since it cannot be undone. It is a
        available to organization admins; copies held by providers and in logs
        stay, so it is not an answer to a data-deletion request. A scoped API
        key is refused.
      operationId: DELETE:mcp.DeleteLeadAPI
      parameters:
        - allowEmptyValue: true
          explode: false
          in: path
          name: datasetSlug
          required: true
          schema:
            type: string
          style: simple
        - allowEmptyValue: true
          explode: false
          in: path
          name: leadRef
          required: true
          schema:
            type: string
          style: simple
        - allowEmptyValue: true
          description: >
            DeletedByExternalRef is the calling product's own handle for the
            person who deleted the lead. Opaque and unverified.
          explode: true
          in: query
          name: deleted_by_external_ref
          required: false
          schema:
            type: string
          style: form
        - allowEmptyValue: true
          description: >
            CheckOnly asks whether the delete would go ahead and removes
            nothing: the answer is state "deletable", or the refusal the delete
            would give.
          explode: true
          in: query
          name: check_only
          required: false
          schema:
            type: boolean
          style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  dataset_id:
                    type: string
                  deleted_at:
                    format: date-time
                    type: string
                  lead_id:
                    description: |
                      more.
                    title: >
                      LeadID and Reference are the lead that was deleted.
                      Neither resolves any
                    type: string
                  reference:
                    type: string
                  removed:
                    additionalProperties:
                      format: int64
                      type: integer
                    title: |
                      Removed counts the records each store gave up, by kind.
                    type: object
                  shared_emails:
                    format: int64
                    type: integer
                  shared_phones:
                    description: >
                      lead in the organization still holds. What is kept by
                      number or address for those — a text thread stamped with
                      the other lead, consent, unlinked calls — was left in
                      place.
                    format: int64
                    title: >
                      SharedPhones and SharedEmails count the lead's contact
                      details another
                    type: integer
                  state:
                    description: >
                      for a call naming a lead an earlier delete removed, and
                      "deletable" for a check that found nothing in the way.
                    title: >
                      State is "deleted" for the call that removed the lead,
                      "already_deleted"
                    type: string
                type: object
          description: Success response
        default:
          $ref: '#/components/responses/APIError'
components:
  responses:
    APIError:
      content:
        application/json:
          schema:
            externalDocs:
              url: https://pkg.go.dev/encore.dev/beta/errs#Error
            properties:
              code:
                description: Error code
                example: not_found
                externalDocs:
                  url: https://pkg.go.dev/encore.dev/beta/errs#ErrCode
                type: string
              details:
                description: Error details
                type: object
              message:
                description: Error message
                type: string
            title: APIError
            type: object
      description: Error response
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An Erdo API key (erdo_api_...) or scoped token (erdo_token_...).

````

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