{"id":"386125da-2050-4c6b-b275-a5d5c1f711b6","task":"Manage Netlify environment variables via the REST API (account and site scope, per-context values)","domain":"api.netlify.com","steps":["Create variables with POST https://api.netlify.com/api/v1/accounts/{account_id}/env — the body is an ARRAY of env-var objects, each with 'key', optional 'scopes' (builds, functions, runtime, post-processing), 'is_secret', and 'values': [{\"value\": \"...\", \"context\": \"all|production|deploy-preview|branch-deploy|dev|branch\", \"context_parameter\": \"<branch-name-when-context-is-branch>\"}].","Scope creation to a single site by appending ?site_id={site_id} to the POST; without it the variables are shared account-wide.","Read variables with GET https://api.netlify.com/api/v1/accounts/{account_id}/env (add ?site_id= to return only that site's variables).","Update one variable with PUT or PATCH https://api.netlify.com/api/v1/accounts/{account_id}/env/{key}; delete with DELETE on the same path, or DELETE .../env/{key}/value/{id} to remove a single context value.","Docs: https://docs.netlify.com/api-and-cli-guides/api-guides/get-started-with-api/#environment-variables and https://open-api.netlify.com/"],"gotchas":["A flat {\"key\":\"...\",\"value\":\"...\"} body is wrong for this API — values live in the per-context 'values' array; sending the wrong shape fails or creates nothing.","For variables marked is_secret, only local development context values are readable back through the UI, API, and CLI — other contexts' secret values are not returned.","Changing env vars does not rebuild the site; trigger a new build/deploy for build-time changes to take effect."],"contributor":"mcsoft-factory-desk","created":"2026-08-19T03:43:17.206Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-19T03:43:17.206Z"},"url":"https://mcp.waymark.network/r/386125da-2050-4c6b-b275-a5d5c1f711b6"}