---
title: "Create a new custom field definition"
method: POST
path: "/v2/custom-fields"
tags: ["Custom Fields"]
---

# Create a new custom field definition

`POST /v2/custom-fields`

## Request

- Base URL: `https://api.carecycle.ai`
- URL: `https://api.carecycle.ai/v2/custom-fields`
- Auth: API key in header `x-api-key`

Set up a new custom field to store extra details on customers or policies.

## Request body

- PostV2CustomFieldsRequestBody
  - `recordType` 'customers' | 'policies', required
  - `fieldLabel` string, required: Display name shown to users
  - `fieldDescription` string, required: Description of the field's purpose
  - `fieldType` 'text' | 'number' | 'boolean' | 'date' | 'select' | 'multi_select', required: Type of data this field stores
  - `isRequired` boolean, nullable: Whether this field must have a value
  - `options` string[], nullable: Available options for select/multi-select fields
  - `validationRules` object: Validation rules for the custom field
    - `min` number
    - `max` number
    - `pattern` string
    - `maxLength` number
    - `minDate` string, date: Earliest allowed calendar date. Format: YYYY-MM-DD
    - `maxDate` string, date: Latest allowed calendar date. Format: YYYY-MM-DD
    - `maxSelections` number

## Response `200`

POST /v2/custom-fields Positive response

- PostV2CustomFieldsPositiveResponse: Custom field definition with all metadata
  - `id` string, uuid, required
  - `createdAt` string, date-time, nullable, required: Custom field definition creation time. ISO 8601 timestamp
  - `updatedAt` string, date-time, nullable, required: Custom field definition last update time. ISO 8601 timestamp
  - `clientId` string, uuid, required
  - `recordType` 'customers' | 'policies', required
  - `fieldKey` string, required: Generated identifier for the field
  - `fieldLabel` string, required: Display name shown to users
  - `fieldDescription` string, required: Description of the field's purpose
  - `fieldType` 'text' | 'number' | 'boolean' | 'date' | 'select' | 'multi_select', required: Type of data this field stores
  - `isRequired` boolean, nullable, required: Whether this field must have a value
  - `options` string[], nullable, required: Available options for select/multi-select fields
  - `validationRules` union, required: Validation rules for the custom field
    - string
    - number
    - boolean
    - object
    - unknown[]
      - unknown
  - `deleted` boolean, required
  - `deletedAt` string, date-time, nullable, required: Custom field definition deletion time. ISO 8601 timestamp

## Other responses

- `400`: POST /v2/custom-fields Negative response 400
- `401`: POST /v2/custom-fields Negative response 401
- `403`: POST /v2/custom-fields Negative response 403
- `404`: POST /v2/custom-fields Negative response 404
- `409`: POST /v2/custom-fields Negative response 409
- `422`: POST /v2/custom-fields Negative response 422
- `429`: POST /v2/custom-fields Negative response 429
- `500`: POST /v2/custom-fields Negative response 500
- `502`: POST /v2/custom-fields Negative response 502
- `503`: POST /v2/custom-fields Negative response 503

---

[API](https://skmtc.dev/carecycle/apis/carecycle-public-api.md) - [All operations](https://skmtc.dev/carecycle/apis/carecycle-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/carecycle/apis/carecycle-public-api/revisions/db390c743c36?raw)
