Templates /
Get template
Required permission
Account > Templates > General > Read
Path parameters
templateId
string requiredID of the template
Query parameters
per_page
integerThe number of results to display per request. Maximum of 100 results per page.
page
integerThe page number to access.
cursor
stringThe cursor returned from the previous page of results, used to request the next page.
Response body
- {object}
Response object.
data
{object} requiredResult data.
name
string requiredName of the template.
min length3max length39pattern^[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
(multiple options: oneOf) requiredDetails of the project the template will run in.
- {object}
Use an existing project
id
string requiredThe ID of the project to use.
pattern^[A-Za-z0-9-]+$- {object}
Create a new project
spec
(multiple options: oneOf) requiredarguments
{object}A set of arguments that can be referenced in a template using '${args.argumentName}'.
spec
(multiple options: oneOf) requiredA node representing an action to be performed as part of the template.
id
string requiredIdentifier for the template
gitops
{object}vcsService
string requiredThe VCS provider to use.
one ofbitbucket, gitlab, github, self-hostedselfHostedVcsId
stringIf projectType is self-hosted, the ID of the self-hosted vcs to use.
pattern^[A-Za-z0-9-]+\/[A-Za-z0-9-]+$accountLogin
stringBy default, if you have multiple version control accounts of the same provider linked, Northflank will pick a linked account that has access to the repository. If
accountLogin
is provided, Northflank will instead use your linked account with that login name.repoUrl
string requiredURL of the Git repo to sync the template with.
pattern^(https:\/\/)?((www(\.[a-zA-Z0-9\-]{2,})+\.)?[a-zA-Z0-9\-]{2,})(\.([a-zA-Z0-9\-]{2,}))+(\/([a-zA-Z0-9\-._]{2,}))+?$branch
string requiredThe name of the branch to use.
filePath
string requiredThe file path to the template in the repository. If using an existing template, it should be in JSON format.
pattern^\/([a-zA-Z0-9-._]+\/)*[a-zA-Z0-9-._]+$templateSha
string requiredThe SHA of the current commit that is being used for the template.
concurrencyPolicy
stringDefines the concurrency behaviour of the template with respect to parallel runs.
one ofallow, queue, forbidoptions
{object} requiredautorun
boolean requiredWhether autorun is enabled
createdAt
stringtime of creation
updatedAt
stringtime of update
OR
GET /v1/templates/{templateId}
Example response
200 OK
JSON
{
"data": {
"name": "Example Template",
"description": "This is a sample template.",
"apiVersion": "v1",
"arguments": {
"ARGUMENT_1": "value_1",
"ARGUMENT_2": "value_2"
},
"spec": {
"kind": "Workflow",
"spec": {
"type": "sequential",
"steps": [
null
]
}
},
"id": "example-template",
"gitops": {
"vcsService": "github",
"accountLogin": "github-user",
"repoUrl": "https://github.com/northflank-examples/remix-postgres-redis-demo",
"branch": "main",
"filePath": "northflank.json",
"templateSha": "8c7e040ee3737ddc3a713363ae72bbe960e9fb16"
},
"concurrencyPolicy": "allow"
}
}