Create a custom field (tenant:forge:write and maintainer, or tenant:forge:admin)
POST /api/forge/v1/projects/{key}/custom-fields
Module: Forge · operationId: createForgeCustomField · Tag: Configuration · Auth: access token (Authorization: Bearer <accessToken>)
Requires tenant:forge:admin, or tenant:forge:write and project role maintainer or admin. Writes forge.config.updated.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
key |
path | string | yes | Project key (e.g. APP) |
Request body
application/json (required)
key(string): Create: field key; fixed afterwardskind(string): Create: value type; fixed afterwards (one oftext,longtext,number,date,datetime,bool,select,multiselect,user,url)label(string): Display label (max length 80)options(array of FieldOption): Choices of select and multiselect fieldslabel(string, required): Display labelvalue(string, required): Stored valuecolor(string): Color token or #rrggbb (optional)
required(boolean): Items need a valuetypeKeys(array of string): Item type keys the field applies to; empty = every typeversion(integer): PATCH: the version the change is based on
Example:
{
"key": "plattform",
"kind": "select",
"label": "Plattform",
"options": [
{
"label": "iOS",
"value": "ios"
},
{
"color": "success",
"label": "Android",
"value": "android"
}
],
"typeKeys": [
"fehler"
]
}
Responses
- 201 Created (
application/json) - 400 Error (
application/json) - 403 Error (
application/json) - 404 Error (
application/json) - 409 Error (
application/json)
Fields of the 201 answer:
id(string (uuid), required): Field idkey(string, required): Field key: the key incustomFieldsof an item; never changeskind(string, required): Value type; never changes (one oftext,longtext,number,date,datetime,bool,select,multiselect,user,url)label(string, required): Display labeloptions(array of FieldOption, required): Choices of select and multiselect fieldslabel(string, required): Display labelvalue(string, required): Stored valuecolor(string): Color token or #rrggbb (optional)
position(integer, required): Order in the configurationrequired(boolean, required): Items of the types the field applies to need a valuetypeKeys(array of string, required): Item type keys; empty = every typeversion(integer, required): Optimistic-locking version; send it with PATCH
Example 201 answer:
{
"id": "9b5c6d7e-8f9a-4b0c-9dbe-5f6a7b8c9d01",
"key": "story_points",
"kind": "number",
"label": "Story Points",
"options": [],
"position": 0,
"required": false,
"typeKeys": [
"story",
"aufgabe",
"fehler"
],
"version": 1
}
Example request
curl -X POST 'https://api.mbcom.cloud/api/forge/v1/projects/string/custom-fields' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
--data '{"key":"plattform","kind":"select","label":"Plattform","options":[{"label":"iOS","value":"ios"},{"color":"success","label":"Android","value":"android"}],"typeKeys":["fehler"]}'