Templates /
Create template
Required permission
Account > Templates > General > Create
Request body
- {object}
name
string requiredName of the template.
min length3max length20pattern^[a-zA-Z]((-|\s)?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$description
stringDescription of the template.
max length200pattern^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$apiVersion
string requiredThe version of the Northflank API to run the template against.
one ofv1project
requiredspec
requiredoptions
{object}Additional options for the template creation.
runOnCreation
booleanIf true, the template will be ran immediately after creation.
Response body
- {object}
Response object.
data
{object} requiredResult data.
template
{object} requiredDetails about the newly created template.
id
string requiredID of the template.
createdAt
date requiredTimestamp of when the template was created.
updatedAt
date requiredTimestamp of when the template was last updated.
content
{object}name
string requiredName of the template.
min length3max length20pattern^[a-zA-Z]((-|\s)?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$description
stringDescription of the template.
max length200pattern^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$apiVersion
string requiredThe version of the Northflank API to run the template against.
one ofv1project
requiredspec
requiredtemplateRun
{object}Details about the newly created template run.
id
string requiredID of the template run.
createdAt
date requiredTimestamp of when the run was initiated.
updatedAt
date requiredTimestamp of when the run was last updated.
template
{object} requiredDetails about the template being run.
id
string requiredID of the template
name
string requiredThe name of the template
status
string requiredStatus of the template run.
one ofwaiting, failure, retrying, success, unknowncontent
{object} requiredDetails about the template run.
name
string requiredName of the template.
min length3max length20pattern^[a-zA-Z]((-|\s)?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$description
stringDescription of the template.
max length200pattern^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$apiVersion
string requiredThe version of the Northflank API to run the template against.
one ofv1project
requiredspec
required
POST /v1/templates
Example request
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"name":"Example Template","description":"This is a sample template.","apiVersion":"v1","options":{"runOnCreation":true}}' \
http://api.northflank.com/v1/templates
Example response
200 OK
JSON
{
"data": {
"template": {
"id": "example-template",
"createdAt": "2022-06-14 15:10:42.842Z",
"updatedAt": "2022-06-14 15:10:42.842Z",
"content": {
"name": "Example Template",
"description": "This is a sample template.",
"apiVersion": "v1"
}
},
"templateRun": {
"id": "501c1e03-a021-4659-9048-85f8f6ee2bc7",
"createdAt": "2022-06-14 15:10:42.842Z",
"updatedAt": "2022-06-14 15:10:42.842Z",
"template": {
"id": "example-template",
"name": "Example Template"
},
"status": "success",
"content": {
"name": "Example Template",
"description": "This is a sample template.",
"apiVersion": "v1"
}
}
}
}