v1
Double column
API
CLI
JS Client

Secrets /

Create global secret

Creates a global secret with the specified payload

Request body

  • {object}
    • name

      string required
      min length
      3
      max length
      39
      pattern
      ^[a-zA-Z]((-|\s)?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$
    • description

      string
      max length
      200
      pattern
      ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
    • secrets

      {object}
      • values

        {object} required
        • files

          {object}
        • type

          string required
          The permission type of the global secret.
          one of
          secret, config
        • gitops

          {object}
          • vcsService

            string required
            The VCS provider to use.
            one of
            bitbucket, gitlab, github, self-hosted, azure
          • selfHostedVcsId

            string
            If projectType is self-hosted, the ID of the self-hosted vcs to use.
            pattern
            ^([A-Za-z0-9-]+)|([0-9a-f]{24})$
          • 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.
          • vcsLinkId

            string
            Legacy key. Please used accountLogin instead.
          • repoUrl

            string required
            URL 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 required
            The name of the branch to use.
          • filePath

            string required
            The 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-._]+$

      Response body

      • {object}
        Response object.
        • data

          {object} required
          Result data.
          • name

            string required
            min length
            3
            max length
            39
            pattern
            ^[a-zA-Z]((-|\s)?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$
          • description

            string
            max length
            200
            pattern
            ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
          • secrets

            {object}
            • values

              {object} required
              • files

                {object}
              • type

                string required
                The permission type of the global secret.
                one of
                secret, config
              • gitops

                {object}
                • vcsService

                  string required
                  The VCS provider to use.
                  one of
                  bitbucket, gitlab, github, self-hosted, azure
                • selfHostedVcsId

                  string
                  If projectType is self-hosted, the ID of the self-hosted vcs to use.
                  pattern
                  ^([A-Za-z0-9-]+)|([0-9a-f]{24})$
                • 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.
                • vcsLinkId

                  string
                  Legacy key. Please used accountLogin instead.
                • repoUrl

                  string required
                  URL 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 required
                  The name of the branch to use.
                • filePath

                  string required
                  The 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-._]+$
              • createdAt

                string
                time of creation
              • updatedAt

                string
                time of update
          API
          CLI
          JS Client

          POST /v1/secrets

          Example request

          Request body
          curl
          curl --header "Content-Type: application/json" \
            --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
            --request POST \
            --data '{"type":"secret","gitops":{"vcsService":"github","accountLogin":"github-user","repoUrl":"https://github.com/northflank-examples/remix-postgres-redis-demo","branch":"main"}}' \
            https://api.northflank.com/v1/secrets

          Example response

          200 OK

          Details about the newly created secret.

          JSON

          {
            "data": {
              "type": "secret",
              "gitops": {
                "vcsService": "github",
                "accountLogin": "github-user",
                "repoUrl": "https://github.com/northflank-examples/remix-postgres-redis-demo",
                "branch": "main"
              }
            }
          }

          Example response

          409 Conflict

          There is already a secret with the same derived identifier

          © 2026 Northflank Ltd. All rights reserved.