Preview Blueprints /
Create preview blueprint
Required permission
Project > PreviewBlueprints > General > Create
Path parameters
projectId
string requiredID of the projectpreviewBlueprintId
string requiredID of the preview blueprint
Request body
- {object}
arguments
{object}A set of arguments that can be referenced in a template using '${args.argumentName}'.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-._]+$$schema
stringname
string requiredmin length3max length100pattern^[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*$description
stringmax length200pattern^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$options
{object}Options regarding how the template is run.concurrencyPolicy
stringDefines the concurrency behaviour of the template with respect to parallel runs.one ofallow, queue, forbidnameFormat
stringThe format of the automatically generated preview name. This is a parsed ref string.prefixName
booleanIf true, the preview name will default to the front of the resource name.schedule
{object}Options regarding which hours preview environments should be active. Only available for BYOC projects.mon
{object}startTime
integermin0max2400endTime
integermin0max2400tue
{object}startTime
integermin0max2400endTime
integermin0max2400wed
{object}startTime
integermin0max2400endTime
integermin0max2400thu
{object}startTime
integermin0max2400endTime
integermin0max2400fri
{object}startTime
integermin0max2400endTime
integermin0max2400sat
{object}startTime
integermin0max2400endTime
integermin0max2400sun
{object}startTime
integermin0max2400endTime
integermin0max2400expiry
{object}Settings regarding the automatic deletion of previews.previewLifetime
integerIf set, preview environments will be automatically deleted after this many minutes since their last update.min1resetOnUpdate
booleanIf `true`, the expiry time for an existing preview will be reset when it is ran again.autorun
booleanIf true, the template will run automatically whenever a change is made to it.argumentOverrides
{object}A set of arguments that can be referenced in a template using '${args.argumentName}'.triggers
[array]- (multiple options: anyOf)
- {object}
kind
string requiredone ofvcs-pushspec
{object} requiredref
stringA reference that can be used to access the output of this trigger in the template.id
string- {object}
kind
string requiredone ofvcs-prspec
{object} requiredref
stringA reference that can be used to access the output of this trigger in the template.id
string- {object}
kind
string requiredone ofwebhookspec
{object} requiredref
stringA reference that can be used to access the output of this trigger in the template.id
string- {object}
kind
string requiredone ofvcs-releasespec
{object} requiredref
stringA reference that can be used to access the output of this trigger in the template.id
string- {object}
kind
string requiredone ofvcs-pr-labelspec
{object} requiredref
stringA reference that can be used to access the output of this trigger in the template.id
stringapiVersion
string requiredproject
{object}spec
{object} required
OR
OR
OR
OR
POST /v1/projects/{projectId}/preview-blueprints
Example request
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"gitops":{"vcsService":"github","accountLogin":"github-user","repoUrl":"https://github.com/northflank-examples/remix-postgres-redis-demo","branch":"main"},"options":{"autorun":false},"triggers":[{"spec":{"vcs":{"vcsService":"github","accountLogin":"github-user","repoUrl":"https://github.com/northflank-examples/remix-postgres-redis-demo"},"commitMessageFlags":{"flags":["[skip ci]"]},"filePaths":{"paths":["README.md"]}}}]}' \
https://api.northflank.com/v1/projects/{projectId}/preview-blueprintsExample response
200 OK