# Create custom field

Creates a custom field.

```http
POST https://api.pozy.ai/v1/custom-fields
```

- Area: Automations / Custom Fields
- Auth: Authorization: Bearer pz_live_...

## Request body

Content type: `application/json`

- `profileId`, string, required
- `name`, string, required
- `slug`, string
- `type`, string, required: One of `text`, `number`, `date`, `boolean`, `select`
- `options`, array of string

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/custom-fields" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "profileId": "6a0b6573846efc28aaa9a3ff",
  "name": "Acme",
  "type": "text"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/custom-fields", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    profileId: "6a0b6573846efc28aaa9a3ff",
    name: "Acme",
    type: "text"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.post(
    "https://api.pozy.ai/v1/custom-fields",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "profileId": "6a0b6573846efc28aaa9a3ff",
        "name": "Acme",
        "type": "text",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `success`, boolean
- `field`, object
  - `id`, string
  - `name`, string
  - `slug`, string
  - `type`, string: One of `text`, `number`, `date`, `boolean`, `select`
  - `options`, array of string
  - `createdAt`, string (date-time)

```json
{
  "success": true,
  "field": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "name": "Acme",
    "slug": "string",
    "type": "text",
    "options": [
      "string"
    ],
    "createdAt": "2026-10-02T09:00:00.000Z"
  }
}
```
