## Create a custom field `POST https://getkollek.com/api/collection-types/{collectionType}/custom-fields` Create a custom field on a collection type. The field is appended after the existing ones. **Permissions:** Owners and editors. Viewers get a 404 response. ### Path parameters - `collectionType` (integer, required): The ID of the collection type the field belongs to. ### Body parameters - `name` (string, optional): The name of the field. Maximum 255 characters. - `field_type` (string, required): The kind of value the field holds. One of text, number, date, boolean, select or rating. A rating stores a whole number of stars from 1 to 5. - `options` (array of strings, optional): The choices of a select field. Blank entries are removed, and the parameter is ignored for the other field types. - `group_id` (integer, optional): The ID of the custom field group to place the field in. The group must belong to the same collection type. When omitted, the field is standalone and sits directly on the type. **Returns:** The created custom_field object. ### Example request ```bash curl https://getkollek.com/api/collection-types/1/custom-fields \ -X POST \ -H "Authorization: Bearer $API_KEY" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{ "name": "Grade", "field_type": "select", "options": [ "NM", "VF", "FN" ], "group_id": 1 }' ``` ### Example response `Status: 201` ```json { "data": { "type": "custom_field", "id": "2", "attributes": { "name": "Grade", "field_type": "select", "options": [ "NM", "VF", "FN" ], "position": 2, "group_id": null, "created_at": 1752537600, "updated_at": 1752537600 }, "links": { "self": "https://getkollek.com/api/collection-types/1/custom-fields/2" } } } ```