Update environment variable
PATCH
/api/v1/projects/{id}/env/{envVarId}
const url = 'https://api.deploybase.eu/api/v1/api/v1/projects/example/env/example';const options = { method: 'PATCH', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"targets":["build"],"value":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.deploybase.eu/api/v1/api/v1/projects/example/env/example \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "targets": [ "build" ], "value": "example" }'Partially updates an environment variable: its value, its targets, or both. The key and environment cannot change.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ” id
required
string
Project ID
envVarId
required
string
Environment Variable ID
Request Body
Section titled “ Request Body ”Fields to change
Media type application/json
object
targets
Array<string>
value
string
Responses
Section titled “ Responses ”OK
Media type application/json
object
data
meta
object
request_id
string
timestamp
string
trace_id
string
data
object
created_at
string
environment
string
id
string
key
string
project_id
string
targets
Array<string>
updated_at
string
warnings
Warnings are accepted-but-risky conditions the caller should show (NODE_OPTIONS).
Array<string>
Example
{ "data": { "environment": "production", "targets": [ "build" ] }}Bad Request
Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Unauthorized
Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Not Found
Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Unprocessable Entity
Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Live 174db30c built