curl --request POST \
--url https://api.example.com/api/config/env \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"env": {},
"secret_keys": [
"<string>"
]
}
'import requests
url = "https://api.example.com/api/config/env"
payload = {
"env": {},
"secret_keys": ["<string>"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({env: {}, secret_keys: ['<string>']})
};
fetch('https://api.example.com/api/config/env', 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.example.com/api/config/env",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'env' => [
],
'secret_keys' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.example.com/api/config/env"
payload := strings.NewReader("{\n \"env\": {},\n \"secret_keys\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.post("https://api.example.com/api/config/env")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"env\": {},\n \"secret_keys\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/config/env")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"env\": {},\n \"secret_keys\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"env_keys": 123,
"fanout": {
"mode": "<string>",
"error": "<string>",
"local_only": true,
"note": "<string>",
"op": "<string>",
"reachable": true,
"results": [
{
"name": "<string>",
"outcome": "<string>",
"detail": "<string>",
"error": "<string>",
"payload": null
}
]
},
"status": "<string>",
"awaiting_respawn": [
{
"keys": [
"<string>"
],
"name": "<string>"
}
],
"recycle": {
"fresh": [
{
"generation": 123,
"kind": "<string>",
"name": "<string>"
}
],
"recycle": [
{
"generation_before": 123,
"kind": "<string>",
"name": "<string>",
"status": "<string>",
"detail": "<string>"
}
],
"recycle_stopped": {
"detail": "<string>",
"kind": "<string>",
"name": "<string>"
}
}
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "reloading — the server is applying a config reload; retry shortly",
"reloading": true
}Merge env overrides and reload the fleet
Merge env overrides into the stored config and reload this worker and the fleet.
A hot-class key is re-read in place. A recycle-class key rolls a worker recycle across the
fleet on a supervised deployment: the response’s recycle carries the roll’s rows (null
when the change carried no recycle-class key), and when the roll converged this worker
recycles itself after replying — on the HTTP edge and on every projected tool door alike (a
post-reply graceful self-exit its supervisor respawns).
A change the deployment cannot carry is refused with a 400 before anything is written, naming
the key: a recycle-class key on a bare (unsupervised) deployment, and the bus URL or a key the
deployment pins on every shape.
secret_keys (when not None) replaces the operator’s secret marks in the same write;
the marks variable itself is never accepted as an env key.
Called over MCP, the reload answers on the session that called it and then retires that session with the generation it ran on: a later call on the same session fails (streamable HTTP answers it 404, and an SSE session’s stream closes), so the client starts a new session to go on.
curl --request POST \
--url https://api.example.com/api/config/env \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"env": {},
"secret_keys": [
"<string>"
]
}
'import requests
url = "https://api.example.com/api/config/env"
payload = {
"env": {},
"secret_keys": ["<string>"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({env: {}, secret_keys: ['<string>']})
};
fetch('https://api.example.com/api/config/env', 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.example.com/api/config/env",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'env' => [
],
'secret_keys' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.example.com/api/config/env"
payload := strings.NewReader("{\n \"env\": {},\n \"secret_keys\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.post("https://api.example.com/api/config/env")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"env\": {},\n \"secret_keys\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/config/env")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"env\": {},\n \"secret_keys\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"env_keys": 123,
"fanout": {
"mode": "<string>",
"error": "<string>",
"local_only": true,
"note": "<string>",
"op": "<string>",
"reachable": true,
"results": [
{
"name": "<string>",
"outcome": "<string>",
"detail": "<string>",
"error": "<string>",
"payload": null
}
]
},
"status": "<string>",
"awaiting_respawn": [
{
"keys": [
"<string>"
],
"name": "<string>"
}
],
"recycle": {
"fresh": [
{
"generation": 123,
"kind": "<string>",
"name": "<string>"
}
],
"recycle": [
{
"generation_before": 123,
"kind": "<string>",
"name": "<string>",
"status": "<string>",
"detail": "<string>"
}
],
"recycle_stopped": {
"detail": "<string>",
"kind": "<string>",
"name": "<string>"
}
}
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "reloading — the server is applying a config reload; retry shortly",
"reloading": true
}Authorizations
Body
An env write: overrides merged into the stored env, and optionally the whole set of secret marks.
env maps names to string values ("" deletes a name). secret_keys absent or
null leaves the stored marks untouched; a list REPLACES them ([] deletes them).
Response
Success.
The standard mutation-op response: this worker's local reload result merged with the fleet fan-out summary.
env_keys is the count of env keys the reload loaded. recycle is the fleet recycle
roll the change ran — null when it carried no recycle-class key. awaiting_respawn is
the operation's verdict: the workers still awaiting a respawn after it (name + keys) — empty
when the change rolled a recycle that converged and this worker recycles itself; a worker the
roll did not reach, and every listed worker of a change that rolls nothing, keep their keys.
Show child attributes
Show child attributes

