{"uid":"cap_63xzmnEOT20T0s9jKtCYS","slug":"scheduler-withzero-xyz-replace-task-environment-variables-byo-env-blob-6465a241","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://scheduler.withzero.xyz/api/v1/tasks/{id}/env?utm_source=zero.xyz","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","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"proven_free","priceSource":"registry","requiresHandshake":false,"reviewCount":1,"rating":{"score":"1.00","successRate":"0.92","reviews":1,"stars":"5.0","state":"rated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"free","summary":"Free","primary":null,"accepted":[]},"paymentMethods":[],"brandName":"scheduler.withzero.xyz","brandSlug":"scheduler-withzero-xyz-mpp","brandBaseUrl":"https://scheduler.withzero.xyz","brandDocsUrl":null,"whatItDoes":"Fully replaces the encrypted environment variable map for a scheduled cron task, with KMS re-encryption at rest and no plaintext echo in responses.","exampleAgentPrompt":"Update the environment variables for my scheduled task (ID: a3f1c2d4-...) — replace everything with DATABASE_URL=postgres://... and API_KEY=sk-abc123, and clear out any other existing vars.","exampleUseCases":null,"resultDescription":"Returns the task UUID, the new env_key_version string (for tracking secret rotations), and env_keys — an array of the stored variable names (without values, since plaintext is never echoed back).","failureModes":["404 if the task ID does not exist or is not owned by the caller","400 if env key names do not match the required SCREAMING_SNAKE_CASE pattern (^[A-Z_][A-Z0-9_]*$)","400 if any env value exceeds 4096 characters","401/403 if caller lacks ownership proof for the task","422 if the request body structure is invalid or missing the required 'env' property","500 if KMS re-encryption fails internally"],"whenToPreferThis":"Use this endpoint when you need to fully replace all environment variables for an existing scheduled task — e.g. rotating secrets, updating API keys, or clearing the env. If you only want to update task metadata like notify_email or tool_list, use the PATCH metadata endpoint instead. If no task exists yet, create the task first and then call this endpoint.","instructions":"# Replace Task Env — BYO secrets blob\n\n## Contract\n- Full replace (not a merge). KMS-re-encrypted at rest; never echoed back (Get Task omits env).\n- Read these in your task code via the runtime env (process.env / os.environ).","reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":12,"lastUsedAt":"2026-08-10T20:36:06.738Z","lastSuccessfullyRanAt":"2026-08-10T20:36:06.738Z","lastHealthCheckAt":"2026-10-12T18:37:27.068Z","isFirstParty":true,"canonicalSlug":"scheduler-withzero-xyz-replace-task-environment-variables-byo-env-blob-6465a241"}