Set environment variables
set_env_varsWrite a project's environment variables and roll the deployed pods so the new values take effect. MERGES by default: send only the vars you want to create or change — every other var, including secrets you never read, is left exactly as it is. Pass delete[] to remove vars by name. Pass mode="replace" ONLY to overwrite the entire set and drop every var you didn't list. Masked values from get_settings are not accepted back: a payload containing "***" is rejected. Requires a read-write token.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| envs | Yes | the environment variables to write; in the default merge mode only these names are created/updated and every other var keeps its current value, so changing one var never requires reading (or echoing back) the project's secrets | |
| mode | No | optional; merge (DEFAULT) upserts only the vars in envs and leaves the rest untouched; replace overwrites the WHOLE set and DELETES every var not listed — only pass replace when a wipe is the intent | |
| delete | No | optional; env var names to remove (merge mode only). Platform-provisioned credentials (DATABASE_URL, S3_*) cannot be removed this way | |
| project_id | Yes | the project id (from list_projects) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| status | No | present, and always "pending_approval", only when this call was parked instead of run immediately because the project's (or kad-back's own) plan-mode setting requires a human to approve it first | |
| message | Yes | ||
| plan_id | No | poll get_plan_status with this id for the eventual outcome | |
| approve_at | No | the kad.dev dashboard URL a human approves or rejects this plan from | |
| expires_in_s | No | the plan can no longer be approved after this many seconds |