Create Field
create_fieldAdd a field to a collection by specifying its type, label, and name. Supports text, rich text, relations, and group fields with validation rules.
Instructions
Add a new field to a collection
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Field identifier in kebab-case (max 60 chars) | |
| type | Yes | Field type: text, number, richtext, boolean, date, media, relation, select, longtext, group, etc. | |
| label | Yes | Display label (max 60 chars) | |
| options | No | Field-specific options (e.g. { repeatable: true } for group fields). For richtext: { editor: { type: 1, outputFormat: 'html' | 'markdown' } }. For relation: { relation: { collection: <target collection id, slug, or name>, type: 1 | 2 }, includeDraft?: boolean } (1 = one-to-one, 2 = one-to-many). | |
| description | No | Field description | |
| placeholder | No | Placeholder text | |
| validations | No | Validation rules (e.g. { required: { status: true, message: 'Required' } }) | |
| collection_slug | Yes | The slug of the collection to add the field to | |
| parent_field_id | No | Internal ID of a group field to nest this field under |