v1
Double column
API
CLI
JS Client

Integrations /

Add registry credentials

Adds a new set of container registry credentials to this account.

Required permission

Account > Credentials > General > Create

Request body

  • {object}
    • name

      string required

      Name of the credentials.

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

      string required

      Description of the credentials.

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

      string required

      The registry provider associated with this set of credentials.

      one of
      dockerhub, gcr-eu, gcr-us, gitlab, github, custom
    • restrictions

      {object}

      Data about whether the credentials are restricted to certain projects.

      • restricted

        boolean

        Whether the credentials are restricted to specific projects.

      • projects

        [array]

        An array of projects the credentials are restricted to, if applicable.

        • string

          The internal id of the project.

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

      {object} required

      The registry credential data to save.

    Response body

    • {object}

      Response object.

      • data

        {object} required

        Result data.

        • id

          string required

          Identifier for the credentials.

        • name

          string required

          Name of the saved credentials.

        • description

          string required

          Description of the saved credentials.

        • restrictions

          {object} required

          Data about whether the credentials are restricted to certain projects.

          • restricted

            boolean required

            Whether the credentials are restricted to specific projects.

          • projects

            [array] required

            An array of projects the credentials are restricted to, if applicable.

            • string

              The internal id of the project.

        • provider

          string required

          The registry provider associated with this set of credentials.

          one of
          dockerhub, gcr-eu, gcr-us, gitlab, github, custom
    API
    CLI
    JS Client

    POST /v1/registry-credentials

    Example request

    Request body

    curl
    curl --header "Content-Type: application/json" \
      --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
      --request POST \
      --data '{"name":"Example Credentials","description":"This is a set of saved credentials.","provider":"dockerhub","restrictions":{"restricted":true,"projects":["default-project"]},"data":{"auths":{"https://index.docker.io/v1/":{"auth":"[YOUR AUTH KEY]"}}}}' \
      https://api.northflank.com/v1/registry-credentials

    Example response

    200 OK

    Data about the newly created credentials.

    JSON

    {
      "data": {
        "id": "example-credentials",
        "name": "Example Credentials",
        "description": "This is a set of saved credentials.",
        "restrictions": {
          "restricted": true,
          "projects": [
            "default-project"
          ]
        },
        "provider": "dockerhub"
      }
    }

    © 2021 Northflank Ltd. All rights reserved.