Apply a template; with dryRun only the plan is returned (desk:admin)
POST /api/desk/v1/templates/{key}/apply
Module: Desk · operationId: applyTemplate · Tag: Configuration · Auth: access token (Authorization: Bearer <accessToken>)
Entries whose key is free are created, identical ones reused, and entries whose key exists with other content are created under the prefix. Value lists and priorities are only added.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
key |
path | string | yes |
Request body
application/json
bundle(Bundle): Portable configuration (format desk.config/v1). All references use keys: types name their workflow key, spaces their type keys, labels their space key, categories their path of names, layouts "cf.".format(string, required): Format of the bundle (one ofdesk.config/v1)categories(array of object): Categoriesdescription(string): Description of the bundleenums(object): Value lists by kindfields(array of object): Custom fieldskey(string): Key of the bundle (templates)labels(array of object): Labelsmatrix(object): Priority matrix (impact × urgency)name(string): Name of the bundleprefix(string): Suggested prefix for conflicting keyspriorities(array of object): PrioritiesprojectTemplates(array of object): Project templates: type is the project type key; blueprint tasks name their typeId by type key, blueprint fields are keyed by field keyprojectTypes(array of object): Project types: workflow, taskSpace and taskType are keys, layout "cf.", billing as in the project type settingsspaces(array of object): Spacesteams(array of object): Teamstypes(array of object): Item typesworkflows(array of object): Workflows
dryRun(boolean): Only return the plan, change nothingprefix(string): Up to 8 lower-case letters/digits for conflicting keys; default: the bundle suggestion
Example:
{
"dryRun": true,
"prefix": ""
}
Responses
- 200 Result or plan (
application/json)
Fields of the 200 answer:
changes(array of object): What the import does (or did) per entryaction(string): created: new; reused: an equal entry exists; renamed: created under another key (as) (one ofcreated,reused,renamed)as(string): Key the entry was created under (renamed)key(string): Key of the entry in the bundlekind(string): Kind of configuration entry (workflow, type, field, space, …)name(string): The name or label of the entry, when it has one
dryRun(boolean): Only the plan: nothing was changed
Example 200 answer:
{
"changes": [
{
"action": "reused",
"key": "service",
"kind": "workflow",
"name": "Service"
},
{
"action": "reused",
"key": "stoerung",
"kind": "type",
"name": "Störung"
},
{
"action": "reused",
"key": "SUP",
"kind": "space",
"name": "Support"
},
{
"action": "created",
"key": "projekt",
"kind": "workflow",
"name": "Projekt"
},
{
"action": "created",
"key": "PRJ",
"kind": "space",
"name": "Kundenprojekte"
},
{
"action": "created",
"key": "kundenprojekt",
"kind": "projectType",
"name": "Kundenprojekt"
},
{
"action": "created",
"key": "erp-einfuehrung",
"kind": "projectTemplate",
"name": "ERP-Einführung"
}
],
"dryRun": true
}
Example request
curl -X POST 'https://api.mbcom.cloud/api/desk/v1/templates/string/apply' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
--data '{"dryRun":true,"prefix":""}'