v1
Double column
API
CLI
JS Client

Services /

Edit service environment variables

Sets the environment variables for the given service.

Required permission

Project > Services > Configuration > Update Environment Variables

Path parameters

    • projectId

      string required

      ID of the project

    • serviceId

      string required

      ID of the service

Request body

  • {object}
    • runtimeEnvironment

      {object} required

      An object containing the all of the environment variables to set for the service

    Response body

    • {object}

      Response object.

      • data

        {object} required

        Result data.

        • success

          boolean required

          True if the operation was successful.

        • restartSuccessful

          boolean required

          Did the service successfully restart with the new environment variables?

    API
    CLI
    JS Client

    POST /v1/projects/{projectId}/services/{serviceId}/environment

    Example request

    Request body

    curl
    curl --header "Content-Type: application/json" \
      --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
      --request POST \
      --data '{"runtimeEnvironment":{"VARIABLE_1":"abcdef","VARIABLE_2":"12345"}}' \
      https://api.northflank.com/v1/projects/{projectId}/services/{serviceId}/environment

    Example response

    200 OK

    Details about the updated environment.

    JSON

    {
      "data": {
        "success": true,
        "restartSuccessful": true
      }
    }

    © 2022 Northflank Ltd. All rights reserved.