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

# Update a lead

> Update one field, the status, the score, or the archive flag on a single lead. Setting `field` to a name that is not a core field writes into the lead's custom columns.

Requires the `write` permission.



## OpenAPI

````yaml PATCH /api/leads/{id}
openapi: 3.1.0
info:
  title: ManyPI API
  description: >-
    The REST API behind ManyPI — AI lead generation, email validation,
    cold-email outreach, agent runs and web scraping. Every endpoint is
    authenticated with a ManyPI API key (`mpi_...`) or an OAuth 2.1 access
    token, and honours the permissions granted to that credential.
  version: 2.0.0
  contact:
    name: ManyPI Support
    email: support@manypi.com
    url: https://manypi.com
servers:
  - url: https://app.manypi.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Leads
    description: Find, store, enrich and manage leads.
  - name: Email validation
    description: Verify that lead addresses can receive mail.
  - name: Outreach
    description: Inboxes, sequences, campaigns, sending and replies.
  - name: Agent
    description: Agent runs, replies and skills.
  - name: Scraping
    description: Scrapers, runs and extracted data.
  - name: Endpoints
    description: Publish scrapers as typed REST endpoints.
  - name: Account
    description: Key validation and account information.
paths:
  /api/leads/{id}:
    patch:
      tags:
        - Leads
      summary: Update a lead
      description: >-
        Update one field, the status, the score, or the archive flag on a single
        lead. Setting `field` to a name that is not a core field writes into the
        lead's custom columns.


        Requires the `write` permission.
      operationId: updateLead
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                field:
                  type: string
                  maxLength: 64
                  description: >-
                    A core field (`company`, `full_name`, `title`, `email`,
                    `phone`, `domain`, `linkedin_url`, `location`, `source_url`)
                    or a custom column key.
                value:
                  type: string
                  nullable: true
                  maxLength: 2000
                  description: Empty string or null clears the field.
                status:
                  type: string
                  enum:
                    - new
                    - qualified
                    - contacted
                    - disqualified
                score:
                  type: integer
                  minimum: 0
                  maximum: 100
                  nullable: true
                archived:
                  type: boolean
            example:
              field: title
              value: Head of Growth
      responses:
        '200':
          description: The updated lead.
          content:
            application/json:
              schema:
                type: object
                properties:
                  lead:
                    $ref: '#/components/schemas/Lead'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    Lead:
      type: object
      properties:
        id:
          type: string
          format: uuid
        company:
          type: string
          nullable: true
        full_name:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        email:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
        domain:
          type: string
          nullable: true
        linkedin_url:
          type: string
          nullable: true
        location:
          type: string
          nullable: true
        source_url:
          type: string
          nullable: true
        score:
          type: integer
          nullable: true
        status:
          type: string
          enum:
            - new
            - qualified
            - contacted
            - disqualified
        custom:
          type: object
          description: Values for the workspace's declared custom columns.
        email_status:
          type: string
          nullable: true
          enum:
            - valid
            - invalid
            - catch_all
            - no_mx
            - disposable
            - unknown
        email_provider:
          type: string
          nullable: true
        email_is_role:
          type: boolean
          nullable: true
        email_validated_at:
          type: string
          format: date-time
          nullable: true
        unsubscribed_at:
          type: string
          format: date-time
          nullable: true
        archived_at:
          type: string
          format: date-time
          nullable: true
        agent_run_id:
          type: string
          format: uuid
          nullable: true
          description: The lead search that produced this lead.
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable message.
        code:
          type: string
          description: >-
            A machine-readable code on gated failures: `lead_limit`,
            `outreach_locked`, `validation_credits_exhausted`.
  responses:
    BadRequest:
      description: The request body or parameters failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: >-
        Missing, invalid or expired credential — or a key that lacks the
        permission this route requires.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A ManyPI API key (`mpi_...`) from Settings → API keys, or an OAuth 2.1
        access token obtained through the MCP consent flow.

````