v1beta
Double column
curl
API
CLI

Secrets /

Create secret

Creates a secret with the specified payload

URL parameters

    • project

      string required

      ID of the project

Request attributes

  • object

    • name

      string required

      The name of the secret.

      pattern: ^[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*$

      min length: 3

      max length: 20

    • description

      string

      A description of the secret.

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

      max length: 200

    • secretType

      string required

      The type of the created secret

      one of: environment, arguments

    • priority

      integer required

      The priority with which different secrets will be merged.

    • restrictions

      object required

      Restriction settings of the secret

      • restricted

        boolean

        Is the secret restricted

      • nfObjects

        array

        List of Northflank services & jobs the secret is restricted to

        • object

          • nfObjectId

            string required

            pattern: ^[A-Za-z0-9-]+$

          • nfObjectType

            string required

    • data

      object required

      Secret contents as JSON object, encrypted at rest

    Response attributes

    • object

      • secretType

        string required

        The type of the created secret group

      • secretId

        string required

        The internal ID of the newly created secret group

    API
    CLI

    POST /v1beta/projects/{project}/secrets

    Example request

    request body

    curl

    curl --header "Content-Type: application/json" \
      --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
      --request POST \
      --data '{"name":"Example Secret","description":"A description","secretType":"environment","priority":10,"restrictions":{"restricted":false,"nfObjects":[{}]},"data":{}}' \
      https://api.northflank.com/v1beta/projects/{project}/secrets

    Example response

    200 OK

    Details about the newly created secret.

    JSON

    {
      "secretType": "environment",
      "secretId": "new-secret"
    }

    Example response

    409 Conflict

    There is already a secret with the same derived identifier

    © 2021 Northflank Ltd. All rights reserved.

    TermsPrivacy

    contact@northflank.com