curl -X DELETE "$API_URL/ops/jobs/definitions/$NAME" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"version": 0,
"reason": "string"
}'
body := strings.NewReader(`{
"version": 0,
"reason": "string"
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodDelete,
apiURL + "/ops/jobs/definitions/" + name, body)
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer res.Body.Close()
const res = await fetch(`${apiUrl}/ops/jobs/definitions/${name}`, {
method: "DELETE",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": 0,
"reason": "string"
}),
});
const data = await res.json();
{
"config": {
"enabled": false,
"max_attempts": 5,
"priority": 1,
"queue": "default",
"schedule": "0 3 * * *",
"timeout": "5m0s"
},
"defaults": {
"enabled": false,
"max_attempts": 5,
"priority": 1,
"queue": "default",
"schedule": "0 3 * * *",
"timeout": "5m0s"
},
"description": "string",
"invalid_override": false,
"modified": false,
"name": "heartbeat",
"version": 0,
"last_run": {
"attempt": 0,
"created_at": "2026-09-15T12:00:00Z",
"id": 0,
"kind": "heartbeat",
"max_attempts": 0,
"priority": 0,
"queue": "string",
"scheduled_at": "2026-09-15T12:00:00Z",
"state": "completed",
"actor_id": "string",
"actor_kind": "string",
"attempted_at": "2026-09-15T12:00:00Z",
"errors": [
{
"at": "2026-09-15T12:00:00Z",
"attempt": 0,
"message": "string"
}
],
"finalized_at": "2026-09-15T12:00:00Z",
"request_id": "string"
},
"next_run_at": "2026-09-15T12:00:00Z",
"updated_at": "2026-09-15T12:00:00Z",
"updated_by": "string"
}
{
"code": "string",
"status": 401,
"title": "Unauthorized",
"detail": "string",
"request_id": "req_9f86d081884c7d65",
"type": "string"
}
{
"code": "string",
"status": 403,
"title": "Forbidden",
"detail": "string",
"request_id": "req_9f86d081884c7d65",
"type": "string"
}
{
"code": "string",
"status": 404,
"title": "Not Found",
"detail": "string",
"request_id": "req_9f86d081884c7d65",
"type": "string"
}
{
"code": "string",
"status": 409,
"title": "Conflict",
"detail": "string",
"request_id": "req_9f86d081884c7d65",
"type": "string"
}
{
"code": "string",
"status": 422,
"title": "Unprocessable Entity",
"detail": "string",
"errors": [
{
"message": "expected length >= 1",
"location": "body.name"
}
],
"request_id": "req_9f86d081884c7d65",
"type": "string"
}