---
title: "Create or update a custom lead field definition"
method: POST
path: "/api/leads/field-definitions"
tags: ["Leads"]
---

# Create or update a custom lead field definition

`POST /api/leads/field-definitions`

## Request

- Base URL: `https://api.setluca.com`
- URL: `https://api.setluca.com/api/leads/field-definitions`
- Auth: one of:
  - API key in cookie `luca.session_token`
  - API key in header `x-api-key`
  - HTTP bearer

Keyed by field name. A name that already exists updates that definition instead of adding a duplicate.

**API key scopes:** `leads:write`. You also need an `Idempotency-Key` header.

## Headers

- `Luca-API-Version` '1'

## Request body

- LeadFieldDefinitionUpsert
  - `key` string, required
  - `label` string, required
  - `type` 'text' | 'number' | 'boolean' | 'date' | 'select'
  - `options` object

## Response `200`

ok

- unknown

## Other responses

- `400`: bad request
- `401`: unauthorized
- `429`: rate limited
- `500`: internal error
- `503`: service unavailable

---

[API](https://skmtc.dev/setluca/apis/luca-api.md) · [All operations](https://skmtc.dev/setluca/apis/luca-api/llms.txt) · [OpenAPI document](https://skmtc.dev/setluca/apis/luca-api/revisions/90a200e4100b?raw)
