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

# Overview

> Custom fields for leads

## What are Custom Fields?

Custom fields allow you to add extra information to leads beyond the standard fields (name, email, phone, company).

## Field Types

<CardGroup cols={2}>
  <Card title="text" icon="font">
    Free text field
  </Card>

  <Card title="number" icon="hashtag">
    Numeric value
  </Card>

  <Card title="date" icon="calendar">
    Date/time
  </Card>

  <Card title="boolean" icon="toggle-on">
    True or false
  </Card>

  <Card title="select" icon="list">
    Selection from predefined options
  </Card>
</CardGroup>

## Usage Flow

<Steps>
  <Step title="Create Definition">
    Define the field: name, type, options (for select), default value.
  </Step>

  <Step title="Apply Values">
    Set field values for specific leads.
  </Step>

  <Step title="Use in Templates">
    Use variables like `{{LEAD_FIELD_NAME}}` in messages and prompts.
  </Step>
</Steps>

## Endpoints

| Method   | Endpoint                                    | Description       |
| -------- | ------------------------------------------- | ----------------- |
| `GET`    | `/backend/custom-fields`                    | List definitions  |
| `POST`   | `/backend/custom-fields`                    | Create definition |
| `PUT`    | `/backend/custom-fields/{id}`               | Update definition |
| `DELETE` | `/backend/custom-fields/{id}`               | Remove definition |
| `GET`    | `/backend/custom-fields/variables`          | List variables    |
| `GET`    | `/backend/lead-fields/{lead_id}`            | Values for a lead |
| `PUT`    | `/backend/lead-fields/{lead_id}/{field_id}` | Set value         |

## Available Variables

Variables can be used in cadence messages and AI prompts:

### Standard Variables

| Variable             | Description       |
| -------------------- | ----------------- |
| `{{LEAD_NAME}}`      | Lead's full name  |
| `{{LEAD_FIRSTNAME}}` | Lead's first name |
| `{{LEAD_NUMBER}}`    | Lead's phone      |
| `{{COMPANY_NAME}}`   | Company name      |

### Custom Field Variables

Custom fields are accessed as: `{{LEAD_FIELD_KEY}}`

Example: If you create a field with `field_key: "lead_source"`, the variable will be `{{LEAD_LEAD_SOURCE}}`
