Skip to Content
Variables

Update an existing variable

PUT
/variables/{variable_id}

Path Parameters

variable_id*integer

The ID of the variable.

Range1 <= value

Header Parameters

Accept*string

application/json

Authorization*string

Bearer {{access_token}}

Content-Type*string

application/json

Request Body

A JSON object containing the resource data

application/json
  1. body
id*integer

The unique ID of the given Variable.

key*string

The unique key used to identify the variable on the target. For resource-config-file, use a relative path such as .env or storage/oauth-public.key. For resource-symlink, key is the link path and value is the destination path, for example node_modules -> ${APP_SHARED_DIR}/node_modules. Must not be greater than 100 characters.

value*string

The value to be assigned to this variable when deployed to its target. When variable is of type file, this is the file content. When variable is of type symlink, this is the destination path, for example ${APP_SHARED_DIR}/node_modules. Must not be greater than 21504 characters.

description?string

A text describing the variable, provided by the end user. Must not be greater than 255 characters.

target*VariableTarget

The target defining how the variable key/value pair will be deployed

Value in"my-cnf""newrelic-infra-yml""nginx-http-server""nginx-http""nginx-main""os-env-var""php-cli_php-ini""php-fpm_php-fpm-conf""php-fpm_php-ini""php-fpm_pool-d-www-conf""redis-conf""resource-config-file""resource-symlink""supervisord-conf""sysctl-conf"
type*VariableType

The type of the key/value pair

Value in"file""symlink""variable"
hidden*boolean

Indicates if the variable value should be visible or not in the deployment logs.

Response Body

No Content

Example Request
curl -X PUT 'https://api.devopness.com/variables/123' \  -H 'Accept: application/json' \  -H 'Authorization: Bearer <your_api_token>' \  -H 'Content-Type: application/json' \  -H 'Content-Type: application/json' \  -d '{  "id": 1,  "key": "APP_URL",  "value": "https://staging.devopness.com",  "target": "resource-config-file",  "type": "file",  "hidden": false}'
Example Response
Empty