> ## 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.

# Declare a custom column

> Declare a column so leads can carry it. Set `auto_research` and the agent fills it in on future lead searches without you restating it each time.

Requires the `write` permission.



## OpenAPI

````yaml POST /api/leads/fields
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/fields:
    post:
      tags:
        - Leads
      summary: Declare a custom column
      description: >-
        Declare a column so leads can carry it. Set `auto_research` and the
        agent fills it in on future lead searches without you restating it each
        time.


        Requires the `write` permission.
      operationId: createLeadField
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadFieldInput'
            example:
              label: Ecommerce platform
              type: text
              description: Shopify, WooCommerce, custom or unknown
              auto_research: true
      responses:
        '200':
          description: The column already existed and was returned unchanged.
        '201':
          description: Column created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  field:
                    $ref: '#/components/schemas/LeadField'
                  created:
                    type: boolean
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    LeadFieldInput:
      type: object
      required:
        - label
      properties:
        label:
          type: string
          maxLength: 60
        key:
          type: string
          maxLength: 40
          description: Derived from the label when absent.
        type:
          type: string
          default: text
        options:
          type: array
          maxItems: 50
          items:
            type: string
        description:
          type: string
          maxLength: 500
          nullable: true
        auto_research:
          type: boolean
          default: false
    LeadField:
      type: object
      properties:
        key:
          type: string
        label:
          type: string
        type:
          type: string
        description:
          type: string
          nullable: true
        auto_research:
          type: boolean
          description: The agent fills this in on future lead searches.
        declared:
          type: boolean
    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.

````