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

# List lead fields

> The organization’s active lead fields, its own custom fields included: their keys, types, options and whether each is required. Use the keys in `fields` when reading, writing and capturing leads. A `leads.capture` key may read this list too, to build a form. Fields an organization adds later appear here at once and are accepted straight away.

Scope: `leads.read` or `leads.capture`.



## OpenAPI

````yaml /openapi.json get /api/v1/lead-fields
openapi: 3.1.0
info:
  title: Marro API
  version: 1.0.0
  description: >-
    Server-to-server access to one organization’s data in Marro. Each key
    belongs to an organization and can use only the scopes it was given for
    modules the organization subscribes to. Keys go only in the Authorization
    header, over HTTPS, from a server: never in browser code or a URL. A key
    that was ever sent over plain HTTP or in a URL must be treated as leaked:
    revoke it and create a new one. The API sends no CORS headers.


    Every response carries `X-Request-Id`, to quote to support. Once the key is
    checked, responses also carry `RateLimit-Limit`, `RateLimit-Remaining` and
    `RateLimit-Reset` (seconds until the window resets) for whichever limit is
    closer to running out. An address that is not an endpoint answers 404
    `NOT_FOUND` in the same error shape.
servers:
  - url: https://app.marro.si
security: []
tags:
  - name: Leads
  - name: Reference
    description: 'How this organization is set up: fields, stages, sources and people.'
paths:
  /api/v1/lead-fields:
    get:
      tags:
        - Reference
      summary: List lead fields
      description: >-
        The organization’s active lead fields, its own custom fields included:
        their keys, types, options and whether each is required. Use the keys in
        `fields` when reading, writing and capturing leads. A `leads.capture`
        key may read this list too, to build a form. Fields an organization adds
        later appear here at once and are accepted straight away.


        Scope: `leads.read` or `leads.capture`.
      operationId: list-fields
      responses:
        '200':
          description: Fields in form order.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/LeadField'
                required:
                  - items
                additionalProperties: false
              example:
                items:
                  - key: preferred_time
                    label: Preferred time to call
                    type: select
                    section: Preferences
                    storage: custom
                    options:
                      - value: morning
                        label: Morning
                      - value: evening
                        label: Evening
                    requiredOnCreate: false
                    requiredOnEdit: false
                    showWhen: null
        '401':
          description: 'UNAUTHORIZED: The key is missing, wrong, revoked or expired.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            FORBIDDEN: The key lacks the scope, or the organization’s plan does
            not include it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            RATE_LIMITED: More than 600 requests in an hour with this key, or
            3000 with all of the organization’s keys together. `Retry-After`
            says how many seconds to wait.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >-
            INTERNAL: Something failed on our side. Retry; if it persists,
            contact support quoting the `X-Request-Id` response header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKey:
            - leads.read
        - ApiKey:
            - leads.capture
components:
  schemas:
    LeadField:
      type: object
      properties:
        key:
          type: string
        label:
          type: string
        type:
          type: string
          enum:
            - text
            - textarea
            - number
            - date
            - phone
            - email
            - url
            - select
            - multiselect
            - checkbox
            - lead_source
            - user
        section:
          type: string
        storage:
          type: string
          enum:
            - column
            - custom
          description: '`custom` fields were created by the organization.'
        options:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
              label:
                type: string
            required:
              - value
              - label
            additionalProperties: false
          description: 'For select and multiselect: send the `value`.'
        requiredOnCreate:
          type: boolean
        requiredOnEdit:
          type: boolean
        showWhen:
          anyOf:
            - type: object
              properties:
                field:
                  type: string
                equals:
                  type: array
                  items:
                    type: string
              required:
                - field
                - equals
              additionalProperties: false
            - type: 'null'
          description: Asked for only when another field has one of these values.
      required:
        - key
        - label
        - type
        - section
        - storage
        - options
        - requiredOnCreate
        - requiredOnEdit
        - showWhen
      additionalProperties: false
      id: LeadField
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: >-
                Stable, machine-readable: UNAUTHORIZED, FORBIDDEN, NOT_FOUND,
                VALIDATION_FAILED, DUPLICATE_LEAD, RATE_LIMITED…
            message:
              type: string
              description: A sentence for people.
            details:
              description: >-
                For VALIDATION_FAILED, `fields` maps each field key to its
                problem.
              type: object
              propertyNames:
                type: string
              additionalProperties: {}
          required:
            - code
            - message
          additionalProperties: false
      required:
        - error
      additionalProperties: false
      id: Error
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        An organization API key, created in Settings → Connections → API keys.
        Keys start with `mk_live_`. Marro stores only a hash of a key, so it is
        shown once, when it is created: copy it then. Revoking a key ends its
        access at once. To replace a key without downtime, create the new one,
        switch your server to it, then revoke the old one. Changes made with a
        key appear on the lead’s timeline as made by the person who created the
        key, via the API. Scopes: `leads.read` (Read leads), `leads.write`
        (Create and update leads), `leads.capture` (Capture leads).
      x-scopes:
        leads.read:
          label: Read leads
          description: >-
            Leads with every field, and the lists that describe them: fields,
            stages, sources and people.
          module: crm
        leads.write:
          label: Create and update leads
          description: >-
            Create leads, change their fields, stage and owner, and add notes.
            Needs leads.read.
          module: crm
        leads.capture:
          label: Capture leads
          description: >-
            Capture leads from a website or form: add a lead or update the
            existing one with the same phone or email. Cannot read, list or
            change anything else.
          module: crm
      x-key-types:
        - name: Website form
          scopes:
            - leads.capture
          lifetimeDays: 730
          description: >-
            A website or landing-page form that sends enquiries in as leads. Can
            do nothing else.
        - name: Another application
          lifetimeDays: 90
          description: >-
            Any other integration. Choose the scopes it needs when you create
            it.

````