| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 | --:api: delete-job :request: DeleteJobRequest:response: AcknowledgedResponse--[role="xpack"][id="{upid}-{api}"]=== Delete {anomaly-job} APIDeletes an {anomaly-job} that exists in the cluster.[id="{upid}-{api}-request"]==== Delete {anomaly-job} requestA +{request}+ object requires a non-null `jobId` and can optionally set `force`.["source","java",subs="attributes,callouts,macros"]---------------------------------------------------include-tagged::{doc-tests-file}[{api}-request]---------------------------------------------------<1> Constructing a new request referencing an existing `jobId`==== Optional argumentsThe following arguments are optional:["source","java",subs="attributes,callouts,macros"]---------------------------------------------------include-tagged::{doc-tests-file}[{api}-request-force]---------------------------------------------------<1> Use to forcefully delete an opened job. This method is quicker than closingand deleting the job. Defaults to `false`.["source","java",subs="attributes,callouts,macros"]---------------------------------------------------include-tagged::{doc-tests-file}[{api}-request-wait-for-completion]---------------------------------------------------<1> Use to set whether the request should wait until the operation has completedbefore returning. Defaults to `true`.[id="{upid}-{api}-response"]==== Delete {anomaly-job} responseThe returned +{response}+ object indicates the acknowledgement of the jobdeletion or the deletion task depending on whether the request was set to waitfor completion:["source","java",subs="attributes,callouts,macros"]---------------------------------------------------include-tagged::{doc-tests-file}[{api}-response]---------------------------------------------------<1> Whether job deletion was acknowledged or not. It will be `null` when setto not wait for completion.<2> The ID of the job deletion task. It will be `null` when set to wait forcompletion.include::../execution.asciidoc[]
 |