Create an item template (tenant:forge:write and maintainer, or tenant:forge:admin)
POST /api/forge/v1/projects/{key}/item-templates
Module: Forge · operationId: createForgeItemTemplate · 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)
body(string): Description it prefills (Markdown) (max length 100000)key(string): Create: template key; fixed afterwardslabelIds(array of string (uuid)): Labels it setsname(string): Display name (max length 80)title(string): Title it prefills (max length 300)typeId(string (uuid), nullable): Item type it sets; null clears itversion(integer): PATCH: the version the change is based on
Example:
{
"body": "## Gerät und Version\n\n## Was wurde zuletzt getan?\n\n## Absturzbericht (Anhang)\n",
"key": "absturz",
"labelIds": [
"8a4b5c6d-7e8f-4a9b-8cad-4e5f6a7b8c04",
"8a4b5c6d-7e8f-4a9b-8cad-4e5f6a7b8c03"
],
"name": "Absturzbericht",
"title": "Absturz: ",
"typeId": "7f3a4b5c-6d7e-4f8a-9b9c-3d4e5f6a7b04"
}
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:
body(string, required): Markdownid(string (uuid), required): Template idkey(string, required): Template key (templateKeyof a new item)labelIds(array of string (uuid), required): Labels it setsname(string, required): Display nameposition(integer, required): Order in the configurationtitle(string, required): Title it prefillsversion(integer, required): Optimistic-locking version; send it with PATCHtypeId(string (uuid), nullable): Item type it sets; null = none
Example 201 answer:
{
"body": "## Beobachtet\n\n## Erwartet\n\n## Schritte zum Nachstellen\n\n1. \n",
"id": "ac6d7e8f-9a0b-4c1d-8ecf-6a7b8c9d0e01",
"key": "fehlerbericht",
"labelIds": [
"8a4b5c6d-7e8f-4a9b-8cad-4e5f6a7b8c04"
],
"name": "Fehlerbericht",
"position": 0,
"title": "",
"typeId": "7f3a4b5c-6d7e-4f8a-9b9c-3d4e5f6a7b04",
"version": 1
}
Example request
curl -X POST 'https://api.mbcom.cloud/api/forge/v1/projects/string/item-templates' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
--data '{"body":"## Gerät und Version\n\n## Was wurde zuletzt getan?\n\n## Absturzbericht (Anhang)\n","key":"absturz","labelIds":["8a4b5c6d-7e8f-4a9b-8cad-4e5f6a7b8c04","8a4b5c6d-7e8f-4a9b-8cad-4e5f6a7b8c03"],"name":"Absturzbericht","title":"Absturz: ","typeId":"7f3a4b5c-6d7e-4f8a-9b9c-3d4e5f6a7b04"}'