{"uid":"cap_2q4mFS9eS_E8fti-SSV7o","slug":"agents-withzero-xyz-replace-task-environment-variables-byo-env-blob-4786432b","name":"Replace Task Environment Variables (BYO Env Blob)","description":"Replace the BYO env blob. KMS-re-encrypted at rest; never echoed. 📖 Full guide: https://scheduler.withzero.xyz/llms.txt","url":"https://agents.withzero.xyz/api/v1/scheduler/tasks/{id}/env","method":"PUT","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["env"],"properties":{"env":{"type":"object","description":"Full replacement env map; submit `{}` to clear.","propertyNames":{"type":"string","pattern":"^[A-Z_][A-Z0-9_]*$"},"additionalProperties":{"type":"string","maxLength":4096}}},"additionalProperties":false},"responseSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["id","env_key_version","env_keys"],"properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"env_keys":{"type":"array","items":{"type":"string"}},"env_key_version":{"type":"string"}},"additionalProperties":false},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0.000000","displayCostAsset":"USD","priceDynamic":false,"priceHint":null,"priceStatus":"unknown_unparsed","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"unknown","summary":"price unknown","primary":{"kind":"unknown","protocol":"mpp","network":"tempo","amountUsd":null,"per":"call","confidence":"unknown"},"accepted":[{"kind":"unknown","protocol":"mpp","network":"tempo","amountUsd":null,"per":"call","confidence":"unknown"}]},"paymentMethods":[{"uid":"pm_z86x92dIXgC_hGYVAQVqu","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.000000","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":"agents.withzero.xyz","brandSlug":"agents-withzero-xyz-mpp","brandBaseUrl":"https://agents.withzero.xyz","brandDocsUrl":null,"whatItDoes":"Fully replaces the encrypted environment variable map for a scheduled task, with KMS re-encryption at rest and no plaintext echo in responses.","exampleAgentPrompt":"Replace all environment variables for task abc12345-0000-0000-0000-000000000001 with a new set: API_KEY=sk-abc123, DATABASE_URL=postgres://user:pass@host/db, and clear any old ones.","exampleUseCases":[{"title":"Rotate API credentials for recurring job","prompt":"My scheduled task with ID f47ac10b-58cc-4372-a567-0e02b2c3d479 needs its credentials rotated — replace the env vars with OPENAI_API_KEY=sk-newkey999 and STRIPE_SECRET=sk_live_newstripe, and remove any old keys."},{"title":"Clear all secrets from a decommissioned task","prompt":"I'm decommissioning task 550e8400-e29b-41d4-a716-446655440000 — please wipe all its environment variables by replacing them with an empty set."},{"title":"Bootstrap new environment config for cloned task","prompt":"I just cloned a task and now need to set up its environment variables from scratch: set AWS_ACCESS_KEY_ID=AKIAIOSFODNN7, AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI, and REGION=us-east-1 for task 6ba7b810-9dad-11d1-80b4-00c04fd430c8."}],"resultDescription":"Returns the task UUID, a new env_key_version string (used to detect when env was last rotated), and an array of env_keys listing the variable names now stored — actual values are never returned in any response.","failureModes":["Task ID not found or not owned by caller — 404 or 403 response","Invalid env key format (must match ^[A-Z_][A-Z0-9_]*$) — 400 validation error","Env value exceeds 4096 character limit — 400 validation error","KMS encryption failure — 500 server error","Malformed request body or missing required `env` field — 400 error"],"whenToPreferThis":"Use this endpoint when you need to fully replace all environment variables for a task in one atomic operation — it performs a complete replacement, not a partial patch. Prefer this over patching individual keys when rotating credentials, bootstrapping a cloned task's config, or clearing all secrets. The KMS-at-rest encryption and no-echo response make it suitable for storing sensitive API keys and secrets.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-12T06:39:18.280Z","isFirstParty":true}