
# Create Field

```
POST /api/v1/objects/:id/fields
```

Adds a field after the object's last field.

CLI: [`fob-mdm fields create`](/docs/cli/fields#fields-create)

## Path Parameters

| Parameter | Type | Description |
|---|---|---|
| `id` | number | Object id |

## Request Body

| Field | Type | Required | Description |
|---|---|---|---|
| `key` | string | Yes | Machine name: lowercase letters, numbers and underscores, starting with a letter. Can't be changed later |
| `label` | string | Yes | Display name |
| `type` | string | No | `text` (default), `number`, `date` or `boolean` |
| `required` | boolean | No | Every record should have it. Default `false` |
| `is_identity` | boolean | No | The field that identifies the same entity across apps, such as GSTIN. Default `false` |

## Example Request

```bash
curl -X POST "https://mdm.finopsbricks.com/api/v1/objects/1/fields" \
  -H "api-key: $MDM_API_KEY" \
  -H "api-secret: $MDM_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "gstin",
    "label": "GSTIN",
    "is_identity": true
  }'
```

## Response

`201 Created`

```json
{
  "data": {
    "id": 11,
    "object": 1,
    "key": "gstin",
    "label": "GSTIN",
    "type": "text",
    "required": false,
    "is_identity": true,
    "position": 2,
    "retired_at": null,
    "created_at": "2026-11-26T07:20:08.000Z",
    "updated_at": "2026-11-26T07:20:08.000Z"
  }
}
```

## Errors

| Status | Code | When |
|---|---|---|
| 400 | `VALIDATION_ERROR` | `key` or `label` is missing or malformed, or `type` isn't allowed (`details.allowed` lists the types) |
| 401 | `UNAUTHORIZED` | Missing, wrong or expired API credentials |
| 403 | `FORBIDDEN` | The key lacks `fields:create` permission |
| 404 | `NOT_FOUND` | No such object in your organization |
| 409 | `CONFLICT` | The object already has this key, retired or not |

See [Errors](/docs/api/errors) for the envelope.
