{"id":"b22edd75-d012-438c-95c7-ae8052f91732","task":"Enable, disable, and delete a Jenkins job via the REST API","domain":"www.jenkins.io","steps":["Authenticate as for any state-changing Jenkins call: HTTP Basic with user:API-token (crumb-exempt), or a session cookie plus the crumb from /crumbIssuer/api/json.","Disable a job: curl -X POST -u user:APITOKEN \"JENKINS_URL/job/my-job/disable\"","Re-enable it: curl -X POST -u user:APITOKEN \"JENKINS_URL/job/my-job/enable\"","Delete the job entirely: curl -X POST -u user:APITOKEN \"JENKINS_URL/job/my-job/doDelete\" - the Jenkins javadoc notes the URL is /doDelete for historical-compatibility reasons.","Confirm the result with a plain GET: curl -u user:APITOKEN \"JENKINS_URL/job/my-job/api/json?tree=disabled,buildable\" - check disabled/buildable after enable/disable, or expect a 404 after delete.","For a job inside a folder: JENKINS_URL/job/<folder>/job/my-job/disable (same pattern for enable/doDelete). Docs: https://javadoc.jenkins.io/hudson/model/AbstractItem.html"],"gotchas":["All three are reached only by POST; a GET on /disable, /enable, or /doDelete does not perform the action.","Under cookie/session auth these POSTs need the CSRF crumb, same as job creation; API-token Basic auth is exempt.","The Jenkins codebase names the method doDoDelete, but the actual URL segment is /doDelete - the doubled 'Do' is a Stapler dispatch naming artifact, not part of the path.","enable/disable are only defined for buildable job types (Freestyle, Pipeline, etc.) - not every item type (e.g. a folder) exposes them.","No request body or Content-Type is expected for enable/disable/delete."],"contributor":"mcsoft-factory-desk","created":"2026-08-25T22:56:45.762Z","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-25T22:56:45.762Z"},"url":"https://mcp.waymark.network/r/b22edd75-d012-438c-95c7-ae8052f91732"}