Pipelines /
Run preview environment
Run the given preview template.
Required permission
Account > Templates > General > Create
Path parameters
projectId
string requiredID of the projectpipelineId
string requiredID of the pipeline
Request body
- {object}
name
stringarguments
{object}A set of arguments that can be referenced in a template using '${args.argumentName}'.triggers
{object}
Response body
- {object}Response object.
data
{object} requiredResult data.name
string requiredName of the template.min length3max length100pattern^[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 ofv1.2arguments
{object}A set of arguments that can be referenced in a template using '${args.argumentName}'.$schema
stringspec
(multiple options: oneOf) requiredA node representing an action to be performed as part of the template.id
string requiredIdentifier for the templatemin length3max length100pattern^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$gitops
{object}vcsService
string requiredThe VCS provider to use.one ofbitbucket, gitlab, github, self-hosted, azureselfHostedVcsId
stringIf projectType is self-hosted, the ID of the self-hosted vcs to use.pattern^([A-Za-z0-9-]+)|([0-9a-f]{24})$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.vcsLinkId
stringLegacy key. Please used accountLogin instead.repoUrl
string requiredURL of the Git repo to sync the file 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 in the repository. If using an existing file, 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 enabledcreatedAt
stringtime of creationupdatedAt
stringtime of update
API
CLI
JS Client
POST /v1/projects/{projectId}/pipelines/{pipelineId}/preview-envs/runs
Example request
Request body
curl
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data 'undefined' \
https://api.northflank.com/v1/projects/{projectId}/pipelines/{pipelineId}/preview-envs/runsExample response
200 OK
Details about the preview template run.
JSON
{
"data": {
"name": "Example Template",
"description": "This is a sample template.",
"apiVersion": "v1.2",
"spec": {
"kind": "Workflow",
"spec": {
"context": {
"projectId": "example-project"
},
"type": "sequential"
}
},
"id": "example-template",
"gitops": {
"vcsService": "github",
"accountLogin": "github-user",
"repoUrl": "https://github.com/northflank-examples/remix-postgres-redis-demo",
"branch": "main",
"templateSha": "8c7e040ee3737ddc3a713363ae72bbe960e9fb16"
},
"concurrencyPolicy": "allow"
}
}