List secrets | Secrets | Northflank API docs
v1
Double column
API
CLI
JS Client

Secrets /

List secrets

Gets a list of secrets belonging to the project

Required permission

Project > Secrets > General > Read

Path parameters

    • projectId

      string required

      ID of the project

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.

      • secrets

        [array] required

        An array of secret groups

        • {object}

          A secret group object

          • id

            string required

            Identifier for the secret group

          • projectId

            string required

            ID of the project that the secret group belongs to

          • name

            string required

            Secret group name

          • tags

            [array] required

            An array of previously defined tags to help identify and group the resource.

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

            string

            A short description of the secret group

          • secretType

            string required

            The type of the created secret group

            one of
            environment-arguments, environment, arguments
          • priority

            integer required

            The priority with which different secret groups will be merged

            min
            0
            max
            100
          • restrictions

            {object} required

            Restriction settings of the secret

            • restricted

              boolean

              Whether the secret is restricted to specific resources. If this is true, only resources listed in nfObjects or with a tag listed in tags will have access to these secrets. Otherwise, all resources in the project will be able to access it.

            • nfObjects

              [array]

              List of Northflank services & jobs the secret is restricted to

              • {object}
                • id

                  string required

                  ID of the entity the secret is restricted to.

                  pattern
                  ^[A-Za-z0-9-]+$
                • type

                  string required

                  Type of the entity the secret is restricted to.

                  one of
                  service, job
            • tags

              [array] required

              List of tags the secret is restricted to.

              • string
                min length
                3
                max length
                39
                pattern
                ^[a-zA-Z](-?[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?$
    • pagination

      {object} required

      Data about the endpoint pagination.

      • hasNextPage

        boolean required

        Is there another page of results available?

      • cursor

        string

        The cursor to access the next page of results.

      • count

        number required

        The number of results returned by this request.

API
CLI
JS Client

GET /v1/projects/{projectId}/secrets

Example response

200 OK

The list of secrets.

JSON

{
  "data": {
    "secrets": [
      {
        "id": "example-secret-group",
        "projectId": "default-project",
        "name": "Example secret group",
        "tags": [
          "my-tag"
        ],
        "description": "This is the secret group description",
        "secretType": "environment",
        "priority": 10,
        "restrictions": {
          "restricted": true,
          "nfObjects": [
            {
              "id": "example-service",
              "type": "service"
            }
          ],
          "tags": [
            "my-tag"
          ]
        }
      }
    ]
  },
  "pagination": {
    "hasNextPage": false,
    "count": 1
  }
}

© 2024 Northflank Ltd. All rights reserved.