Skip to main content

Create User Form

Endpoint: POST /api/human/template

Creates a user form in the Conductor server. You can also update existing forms as new versions by setting newVersion=true.

Query parameters

ParameterDescriptionTypeRequired/ Optional
newVersionWhether to save the user form as a new version. Default is false.

If the version number is specified in the request body, it will take precedence even if newVersion is set to false.
stringRequired.

Request body

Format the request as an object containing the user form JSON schema.

ParameterDescriptionTypeRequired/ Optional
nameThe name of the user form template.stringRequired.
jsonSchemaThe JSON schema defining the form's data structure and validation rules.objectRequired.
templateUIThe UI configuration that defines how the form should be rendered. Supported form layout and components.objectRequired.
createdByThe user who created the form.stringOptional.
updatedByThe user who last updated the form.stringOptional.
versionThe version number to assign. If specified, it takes precedence over the newVersion query parameter.integerOptional.

Response

Returns the created or updated user form with its assigned version number and timestamps.

Examples

Create a user form

Request

curl -X 'POST' \
'https://<YOUR-CLUSTER>/api/human/template?newVersion=false' \
-H 'accept: application/json' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"createdBy": "USER:john.doe@acme.com",
"updatedBy": "USER:john.doe@acme.com",
"name": "someForm",
"jsonSchema": {
"$schema": "http://json-schema.org/draft-07/schema",
"properties": {
"vegetable": {
"type": "string",
"enum": [
"potatoes",
"carrots",
"celery"
]
}
}
},
"templateUI": {
"type": "VerticalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/vegetable",
"label": "Pick one",
"options": {}
}
]
}
}'

Response

{
"createTime": 1770293776993,
"updateTime": 1770293776993,
"createdBy": "USER:john.doe@acme.com",
"updatedBy": "USER:john.doe@acme.com",
"name": "someForm",
"version": 1,
"jsonSchema": {
"$schema": "http://json-schema.org/draft-07/schema",
"properties": {
"vegetable": {
"type": "string",
"enum": [
"potatoes",
"carrots",
"celery"
]
}
}
},
"templateUI": {
"type": "VerticalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/vegetable",
"label": "Pick one",
"options": {}
}
]
}
}
Save a user form as a new version

Request

curl -X 'POST' \
'https://<YOUR-CLUSTER>/api/human/template?newVersion=true' \
-H 'accept: application/json' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"createdBy": "USER:john.doe@acme.com",
"updatedBy": "USER:john.doe@acme.com",
"name": "someForm",
"jsonSchema": {
"$schema": "http://json-schema.org/draft-07/schema",
"properties": {
"vegetable": {
"type": "string",
"enum": [
"potatoes",
"carrots",
"celery"
]
}
}
},
"templateUI": {
"type": "VerticalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/vegetable",
"label": "Pick any one",
"options": {}
}
]
}
}'

Response

{
"createTime": 1770294080864,
"updateTime": 1770294080864,
"createdBy": "USER:john.doe@acme.com",
"updatedBy": "USER:john.doe@acme.com",
"name": "someForm",
"version": 2,
"jsonSchema": {
"$schema": "http://json-schema.org/draft-07/schema",
"properties": {
"vegetable": {
"type": "string",
"enum": [
"potatoes",
"carrots",
"celery"
]
}
}
},
"templateUI": {
"type": "VerticalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/vegetable",
"label": "Pick any one",
"options": {}
}
]
}
}