Get preview template | Pipelines | Northflank API docs
v1
Double column
API
CLI
JS Client

Pipelines /

Get preview template

Get information about the given preview template.

Required permission

Account > Templates > General > Read

Path parameters

    • projectId

      string required

      ID of the project

    • pipelineId

      string required

      ID of the pipeline

Query parameters

    • per_page

      integer

      The number of results to display per request. Maximum of 100 results per page.

    • page

      integer

      The page number to access.

    • cursor

      string

      The cursor returned from the previous page of results, used to request the next page.

Response body

  • {object}

    Response object.

    • data

      {object} required

      Result data.

      • apiVersion

        string required

        The version of the Northflank API to run the template against.

        one of
        v1
      • arguments

        {object}

        A set of arguments that can be referenced in a template using '${args.argumentName}'.

        • triggers

          [array]
          • {object}
            • ref

              string

              A reference that can be used to access the output of this trigger in the template.

            • vcsService

              string required

              The VCS provider to use.

              one of
              bitbucket, gitlab, github, self-hosted
            • selfHostedVcsId

              string

              If projectType is self-hosted, the ID of the self-hosted vcs to use.

              pattern
              ^[A-Za-z0-9-]+\/[A-Za-z0-9-]+$
            • accountLogin

              string

              By 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 required

              URL 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,}))+?$
            • branchRestrictions

              [array]
              • string
                pattern
                ^[a-zA-Z/*0-9%\-.#_!'();,&=+]*$
            • prRestrictions

              [array]
              • string
                pattern
                ^[a-zA-Z/*0-9%\-.#_!'();,&=+]*$
            • pathIgnoreRules

              [array]
              • string
                max length
                260
            • ciIgnoreFlags

              [array]
              • string
                max length
                72
            • ciIgnoreFlagsEnabled

              boolean
            • isAllowList

              boolean
            • type

              string

              Type of trigger

              one of
              git
            • manualOnly

              boolean

              Should the git trigger only be triggered manually?

        • spec

          (multiple options: oneOf) required

          A node representing an action to be performed as part of the PreviewEnvTemplate.

        • id

          string required

          Identifier for the template

        • paused

          boolean

          Whether triggers are paused for this preview template. If true, Git triggers and webhook triggers will not create or update previews.

        • options

          {object} required
          • createdAt

            string

            time of creation

          • updatedAt

            string

            time of update

      API
      CLI
      JS Client

      GET /v1/projects/{projectId}/pipelines/{pipelineId}/preview-envs

      Example response

      200 OK

      Details about the preview template.

      JSON

      {
        "data": {
          "apiVersion": "v1",
          "arguments": {
            "ARGUMENT_1": "value_1",
            "ARGUMENT_2": "value_2"
          },
          "triggers": [
            {
              "vcsService": "github",
              "accountLogin": "github-user",
              "repoUrl": "https://github.com/northflank-examples/remix-postgres-redis-demo",
              "branchRestrictions": [
                null
              ],
              "prRestrictions": [
                null
              ],
              "pathIgnoreRules": [
                null
              ],
              "ciIgnoreFlags": [
                null
              ]
            }
          ],
          "spec": {
            "kind": "Workflow",
            "spec": {
              "type": "sequential",
              "steps": [
                null
              ]
            }
          },
          "id": "example-template",
          "paused": false
        }
      }

      © 2024 Northflank Ltd. All rights reserved.