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

# Delete a Lead Insight

> Permanently deletes one insight.

Path `{id}` here is the preference document `_id` (MongoDB ObjectId),
not the lead id.

Requires `conversations:edit` permission.




## OpenAPI

````yaml DELETE /api/preferences/{id}
openapi: 3.1.0
info:
  title: Naturalead Lead Insights (Preferences) API
  version: 1.0.0
  description: >
    Lead Insights are structured key points the AI extracts from conversations

    (budget, timeline, location, etc.). They power the "Lead Insights" sidebar

    in the dashboard and are the recommended CRM sync payload for what the

    lead shared — more useful than a free-form conversation `summary`.


    Insights are **lead-scoped** (one set per lead, accumulated across
    sessions),

    not conversation-scoped. All endpoints require API key or Clerk auth and are

    scoped to the caller's account.


    Path note: `GET` uses the **lead id**; `PATCH` / `DELETE` use the
    **preference

    document `_id`**. Same URL pattern, different identifiers by method.
servers:
  - url: https://api.naturalead.ai
    description: Production
  - url: http://localhost:3001
    description: Local development
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Lead Insights
    description: Extracted lead preferences / key points for CRM sync and agent memory
paths:
  /api/preferences/{id}:
    delete:
      tags:
        - Lead Insights
      summary: Delete a Lead Insight
      description: |
        Permanently deletes one insight.

        Path `{id}` here is the preference document `_id` (MongoDB ObjectId),
        not the lead id.

        Requires `conversations:edit` permission.
      operationId: deleteLeadPreference
      parameters:
        - name: id
          in: path
          required: true
          description: MongoDB ObjectId of the preference document.
          schema:
            type: string
          example: 507f1f77bcf86cd799439011
      responses:
        '204':
          description: Insight deleted. Empty body.
        '400':
          description: Invalid preference id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Invalid preference ID
        '404':
          description: Preference not found in this account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Preference not found
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
      required:
        - error
  responses:
    InternalError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Failed to fetch preferences
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for programmatic access (format nl_live_* or nl_test_*)
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token using an API key (format nl_live_* or nl_test_*) or Clerk
        session

````