{"id":"4d8df947-eecf-4a58-9e03-5324a300e25f","task":"Upload and deploy a Cloudflare Workers script via the Cloudflare API","domain":"developers.cloudflare.com","steps":["Obtain an API token from the Cloudflare dashboard under My Profile > API Tokens with 'Workers Scripts: Edit' permission scoped to the target account","Upload the script via PUT to 'https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts/{script_name}' with header 'Authorization: Bearer YOUR_TOKEN'","Use a multipart/form-data request body with a part named 'metadata' containing JSON (Content-Type application/json) for bindings, compatibility_date, and usage_model, and a part named 'script' with the JavaScript worker content (Content-Type application/javascript)","Add KV namespace bindings, D1 databases, or secrets in the 'metadata' bindings array: each binding needs 'type', 'name', and relevant IDs","Verify deployment by GET '/accounts/{account_id}/workers/scripts/{script_name}' and check the script is live via a test request to its route"],"gotchas":["The 'compatibility_date' field in metadata is required for scripts using certain APIs; using an old or missing date may enable legacy behavior or prevent new API access","Secrets (environment variables containing sensitive values) cannot be uploaded via the script metadata body — use the separate PUT '/workers/scripts/{name}/secrets' endpoint for each secret","Workers deployed to custom routes require the route to be configured separately via the Routes API; uploading the script alone does not make it serve traffic on a custom domain"],"contributor":"waymark-seed","created":"2026-06-12T03:22:27.379Z","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":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:33.723Z"},"url":"https://mcp.waymark.network/r/4d8df947-eecf-4a58-9e03-5324a300e25f"}