Mist apps
Update an env var's value
Replaces the value of one of your environment variables on the
Mist’s deployment project. Pass targets to change which
environments it applies to; omit it to keep the current targets.
The new value takes effect on the next deployment.
Returns 404 if no variable with that key exists, 422 with
error.details.type of managed_var for a Mist-managed variable,
and 409 while the Mist is pending_destroy.
Requires a company admin token with the mist.env_vars permission.
PATCH
/
api
/
v202604
/
mists
/
{mist_id}
/
env_vars
/
{key}
Update an env var's value
curl --request PATCH \
--url https://api.fluid.app/api/v202604/mists/{mist_id}/env_vars/{key} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"env_var": {
"value": "15"
}
}
'import requests
url = "https://api.fluid.app/api/v202604/mists/{mist_id}/env_vars/{key}"
payload = { "env_var": { "value": "15" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({env_var: {value: '15'}})
};
fetch('https://api.fluid.app/api/v202604/mists/{mist_id}/env_vars/{key}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/v202604/mists/{mist_id}/env_vars/{key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'env_var' => [
'value' => '15'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/v202604/mists/{mist_id}/env_vars/{key}"
payload := strings.NewReader("{\n \"env_var\": {\n \"value\": \"15\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.fluid.app/api/v202604/mists/{mist_id}/env_vars/{key}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"env_var\": {\n \"value\": \"15\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/v202604/mists/{mist_id}/env_vars/{key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"env_var\": {\n \"value\": \"15\"\n }\n}"
response = http.request(request)
puts response.read_body{
"env_var": {
"key": "REWARDS_POINTS_PER_DOLLAR",
"value": "15",
"targets": [
"production",
"preview"
],
"managed_by": "user",
"pull_to_local": true
},
"status": 200,
"meta": {
"request_id": "6f1c2a9e-4b7d-4e8a-9c3f-2d5b8a1e7f40",
"timestamp": "2026-04-20T09:15:02Z"
}
}{
"error": {
"message": "<string>",
"details": {}
},
"status": 123,
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"message": "<string>",
"details": {}
},
"status": 123,
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}Authorizations
Bearer token authentication. Accepts company admin tokens with
the matching mist.* permission:
mist.viewto list and show Mistsmist.createto create and rename Mistsmist.destroyto delete and restore Mistsmist.codefor deployments and logsmist.env_varsto read and manage environment variables Droplet installation tokens are refused.
Path Parameters
UUID of the company-owned Mist app.
Environment variable name, such as STRIPE_API_KEY.
Pattern:
^[A-Za-z_][A-Za-z0-9_]*$Body
application/json
Show child attributes
Show child attributes
Response
Env var updated
Show child attributes
Show child attributes
⌘I
Update an env var's value
curl --request PATCH \
--url https://api.fluid.app/api/v202604/mists/{mist_id}/env_vars/{key} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"env_var": {
"value": "15"
}
}
'import requests
url = "https://api.fluid.app/api/v202604/mists/{mist_id}/env_vars/{key}"
payload = { "env_var": { "value": "15" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({env_var: {value: '15'}})
};
fetch('https://api.fluid.app/api/v202604/mists/{mist_id}/env_vars/{key}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/v202604/mists/{mist_id}/env_vars/{key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'env_var' => [
'value' => '15'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/v202604/mists/{mist_id}/env_vars/{key}"
payload := strings.NewReader("{\n \"env_var\": {\n \"value\": \"15\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.fluid.app/api/v202604/mists/{mist_id}/env_vars/{key}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"env_var\": {\n \"value\": \"15\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/v202604/mists/{mist_id}/env_vars/{key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"env_var\": {\n \"value\": \"15\"\n }\n}"
response = http.request(request)
puts response.read_body{
"env_var": {
"key": "REWARDS_POINTS_PER_DOLLAR",
"value": "15",
"targets": [
"production",
"preview"
],
"managed_by": "user",
"pull_to_local": true
},
"status": 200,
"meta": {
"request_id": "6f1c2a9e-4b7d-4e8a-9c3f-2d5b8a1e7f40",
"timestamp": "2026-04-20T09:15:02Z"
}
}{
"error": {
"message": "<string>",
"details": {}
},
"status": 123,
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"message": "<string>",
"details": {}
},
"status": 123,
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}