Create Mitigation Job

Use this API to create Windows and Linux Mitigation Jobs. You can create both Run Once and On-Demand jobs using this API. 

POST/mtg/v1/deploymentjob

Sample - Create Windows On-Demand Mitigation JobSample - Create Windows On-Demand Mitigation Job

API Request

curl -X 'POST' \
  '<qualys_base_url>/mtg/v1/deploymentjob' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <JWT_Token>' \
  -H 'Content-Type: application/json' \
  -d 

API Body

{
    "qids": [
        378985,
        90044
    ],
    "assetTagIds": [
        "576b4fab-2682-433e-b3e6-c4ea9861ae75",
        "2f0abeac-8fe5-48a0-aef8-c25bb98ec6f8"
    ],
    "name": "MTG_WINDOWS_ONDEMAND_DEMO",
    "description": "Test Mitigation Job",
    "scheduleType": "On-demand",
    "schemaVersion": "1.0",
    "startDateTime": null,
    "status": "Enabled",
    "timezone": null,
    "timezoneType": null,
    "type": "Install",
    "filterType": "Any",
    "exclusionFilterType": "Any",
    "exclusionTagIds": [
        "9947851b-017f-4df5-8831-5073392a51c2"
    ],
    "matchAllTagIds": [],
    "coAuthorUserIds": [
        "430c474e-2309-47bf-832b-a6e5685c3866"
    ],
    "platform": "Windows",
    "notification": {
        "notificationTypes": {
            "email": true
        },
        "notificationConfigs": {
            "recipientEmails": "johnd@qualys.com,danielm@qualys.com",
            "completedPercentage": 80
        },
        "notificationEvents": {
            "onJobStart": true,
            "onJobComplete": true
        }
    }
}

API Response

{
  "customerId": "bbb55e58-b06f-fd7b-81b8-92a7c5407282",
  "id": "72a50f23-d80d-4abf-84ff-4509ba17b732",
  "schemaVersion": "1.0",
  "name": "MTG_WINDOWS_ONDEMAND_DEMO",
  "description": "Test Mitigation Job",
  "type": "Install",
  "status": "Enabled",
  "assetIds": null,
  "coAuthorUserIds": [
    "430c474e-2309-47bf-832b-a6e5685c3866"
  ],
  "scheduleType": "On-demand",
  "startDateTime": "2025-7-01 09:57:18 AM",
  "recurring": false,
  "timezoneType": "SPECIFIC_TZ",
  "timezone": "UTC",
  "createdBy": {
    "user": {
      "id": "b0f469fe-8f5e-f169-80e1-95e8a728bb5d",
      "name": "quaysxkm35",
      "fullName": "John Doe"
    },
    "date": 1751363834317
  },
  "updatedBy": {
    "user": null,
    "date": null
  },
  "deletedBy": {
    "user": null,
    "date": null
  },
  "assetCount": null,
  "taggedAssetCount": 0,
  "applicableAssetCount": 0,
  "totalAssetCount": null,
  "assetResultReceivedCount": null,
  "jobCategory": 3,
  "jobTriggerStatus": null,
  "completionPercent": null,
  "jobSource": 3,
  "readOnly": false,
  "subCategory": "Mitigation",
  "platform": "Windows",
  "assetTagIds": [
    "576b4fab-2682-433e-b3e6-c4ea9861ae75",
    "2f0abeac-8fe5-48a0-aef8-c25bb98ec6f8"
  ],
  "matchAllTagIds": [],
  "exclusionTagIds": [
    "9947851b-017f-4df5-8831-5073392a51c2"
  ],
  "exclusionAssetIds": [],
  "filterType": "Any",
  "exclusionFilterType": "Any",
  "notification": {
    "notificationTypes": {
      "email": true
    },
    "notificationConfigs": {
      "recipientEmails": "johnd@qualys.com,danielm@qualys.com",
      "completedPercentage": "80"
    },
    "notificationEvents": {
      "onJobStart": true,
      "onJobComplete": true
    }
  },
  "assetDetectionsQQL": "tags.uuid: [576b4fab-2682-433e-b3e6-c4ea9861ae75,2f0abeac-8fe5-48a0-aef8-c25bb98ec6f8] AND not tags.uuid: [9947851b-017f-4df5-8831-5073392a51c2] AND trackingMethod:QAGENT",
  "preDeployActions": [
    {
      "actionId": "eb0c59e8-78eb-4f0d-9225-4fd7fe3b558e",
      "action": "Apply Mitigation",
      "actionType": "predeploy",
      "params": {
        "timeout": 180,
        "mitigationCategory": "Script-based Virtual Patch",
        "qid": 378985,
        "qidDetectionId": 0,
        "hostVulnId": 0
      },
      "mitigationList": [
        {
          "cves": [
            "CVE-2016-2183"
          ],
          "mitigationId": "3f3d2fae-96ec-4d73-83d6-3cf0264ac1dc",
          "mitigationType": "Modify registry",
          "carScriptId": 226363191,
          "customCdnUrl": "",
          "signatureHashCode": "",
          "impactFactor": 0,
          "implication": 1
        }
      ],
      "actionLinkedToJob": false
    },
    {
      "actionId": "684162a0-2ce5-46ad-9ea6-56e8a2dd1e47",
      "action": "Apply Mitigation",
      "actionType": "predeploy",
      "params": {
        "timeout": 180,
        "mitigationCategory": "Script-based Virtual Patch",
        "qid": 90044,
        "qidDetectionId": 0,
        "hostVulnId": 0
      },
      "mitigationList": [
        {
          "cves": [
            "90044"
          ],
          "mitigationId": "414d7f53-1409-4045-ba3d-7e71ef39abfb",
          "mitigationType": "Modify registry",
          "carScriptId": 494972837,
          "customCdnUrl": "",
          "signatureHashCode": "",
          "impactFactor": 0,
          "implication": 1
        }
      ],
      "actionLinkedToJob": false
    }
  ],
  "postDeployActions": null,
  "vulnQQL": "vulnerabilities.vulnerability.qid:[378985, 90044]"
}

Sample - Create Windows Run Once Mitigation JobSample - Create Windows Run Once Mitigation Job

API Request

curl -X 'POST' \
  '<qualys_base_url>/mtg/v1/deploymentjob' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <JWT_Token>' \
  -H 'Content-Type: application/json' \
  -d 

API Body

{
    "qids": [378985,90044],
    "assetTagIds": [
        "576b4fab-2682-433e-b3e6-c4ea9861ae75", "2f0abeac-8fe5-48a0-aef8-c25bb98ec6f8"
    ],
    "name": "MTG_WINDOWS_RUNONCE_DEMO",
    "description": "Test Mitigation Job",
     "scheduleType": "Once",
  "schemaVersion": "1.0",
  "startDateTime": "2025-07-01 03:37:00 PM",
  "status": "Enabled",
   "timezone": "Asia/Kolkata",
    "timezoneType": "SPECIFIC_TZ",
    "type": "Install",
    "filterType": "Any",
    "exclusionFilterType": "Any",
    "exclusionTagIds": ["9947851b-017f-4df5-8831-5073392a51c2"],
    "matchAllTagIds": [],
    "coAuthorUserIds": ["430c474e-2309-47bf-832b-a6e5685c3866"],
    "exclusionAssetIds": [],
    "platform": "Windows",
    "notification": {
        "notificationTypes": {
            "email": true
        },
        "notificationConfigs": {
            "recipientEmails": "johnd@qualys.com,danielm@qualys.com",
            "completedPercentage": 80
        },
        "notificationEvents": {
            "onJobStart": true,
            "onJobComplete": true
        }
    }
}

API Response

{
  "customerId": "bbb55e58-b06f-fd7b-81b8-92a7c5407282",
  "id": "2278d48d-1d8c-46ed-a66f-612779b67cb9",
  "schemaVersion": "1.0",
  "name": "MTG_WINDOWS_RUNONCE_DEMO",
  "description": "Test Mitigation Job",
  "type": "Install",
  "status": "Enabled",
  "coAuthorUserIds": [
    "430c474e-2309-47bf-832b-a6e5685c3866"
  ],
  "scheduleType": "Once",
  "startDateTime": "2025-07-01 03:37:00 PM",
  "recurring": false,
  "timezoneType": "SPECIFIC_TZ",
  "timezone": "Asia/Kolkata",
  "createdBy": {
    "user": {
      "id": "b0f469fe-8f5e-f169-80e1-95e8a728bb5d",
      "name": "quaysxkm35",
      "fullName": "John Doe"
    },
    "date": 1751364352541
  },
  "updatedBy": {
    "user": null,
    "date": null
  },
  "deletedBy": {
    "user": null,
    "date": null
  },
  "assetCount": null,
  "taggedAssetCount": 0,
  "applicableAssetCount": 0,
  "totalAssetCount": null,
  "assetResultReceivedCount": null,
  "jobCategory": 3,
  "jobTriggerStatus": null,
  "completionPercent": null,
  "jobSource": 3,
  "readOnly": false,
  "subCategory": "Mitigation",
  "platform": "Windows",
  "assetTagIds": [
    "576b4fab-2682-433e-b3e6-c4ea9861ae75",
    "2f0abeac-8fe5-48a0-aef8-c25bb98ec6f8"
  ],
  "matchAllTagIds": [],
  "exclusionTagIds": [
    "9947851b-017f-4df5-8831-5073392a51c2"
  ],
  "filterType": "Any",
  "exclusionFilterType": "Any",
  "notification": {
    "notificationTypes": {
      "email": true
    },
    "notificationConfigs": {
      "recipientEmails": "johnd@qualys.com,danielm@qualys.com",
      "completedPercentage": "80"
    },
    "notificationEvents": {
      "onJobStart": true,
      "onJobComplete": true
    }
  },
  "assetDetectionsQQL": "tags.uuid: [576b4fab-2682-433e-b3e6-c4ea9861ae75,2f0abeac-8fe5-48a0-aef8-c25bb98ec6f8] AND not tags.uuid: [9947851b-017f-4df5-8831-5073392a51c2] AND trackingMethod:QAGENT",
  "preDeployActions": [
    {
      "actionId": "78ad97fc-d8fe-4aa1-b42b-7c65f609a931",
      "action": "Apply Mitigation",
      "actionType": "predeploy",
      "params": {
        "timeout": 180,
        "mitigationCategory": "Script-based Virtual Patch",
        "qid": 378985,
        "qidDetectionId": 0,
        "hostVulnId": 0
      },
      "mitigationList": [
        {
          "cves": [
            "CVE-2016-2183"
          ],
          "mitigationId": "3f3d2fae-96ec-4d73-83d6-3cf0264ac1dc",
          "mitigationType": "Modify registry",
          "carScriptId": 226363191,
          "customCdnUrl": "",
          "signatureHashCode": "",
          "impactFactor": 0,
          "implication": 1
        }
      ],
      "actionLinkedToJob": false
    },
    {
      "actionId": "61db088e-5fe5-47a4-bac2-f0bd0459b832",
      "action": "Apply Mitigation",
      "actionType": "predeploy",
      "params": {
        "timeout": 180,
        "mitigationCategory": "Script-based Virtual Patch",
        "qid": 90044,
        "qidDetectionId": 0,
        "hostVulnId": 0
      },
      "mitigationList": [
        {
          "cves": [
            "90044"
          ],
          "mitigationId": "414d7f53-1409-4045-ba3d-7e71ef39abfb",
          "mitigationType": "Modify registry",
          "carScriptId": 494972837,
          "customCdnUrl": "",
          "signatureHashCode": "",
          "impactFactor": 0,
          "implication": 1
        }
      ],
      "actionLinkedToJob": false
    }
  ],
  "postDeployActions": null,
  "vulnQQL": "vulnerabilities.vulnerability.qid:[378985, 90044]"
}

Sample - Create Linux On-Demand Mitigation JobSample - Create Linux On-Demand Mitigation Job

API Request

curl -X 'POST' \
  '<qualys_base_url>/mtg/v1/deploymentjob' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <JWT_Token>' \
  -H 'Content-Type: application/json' \
  -d 

API Body

{
    "qids": [
        237627,
        351793
    ],
    "assetTagIds": [
        "576b4fab-2682-433e-b3e6-c4ea9861ae75"
    ],
    "name": "MTG_LINUX_ONDEMAND_DEMO_1",
    "description": "Test Linux Mitigation Job",
    "scheduleType": "On-demand",
    "schemaVersion": "1.0",
    "startDateTime": null,
    "status": "Enabled",
    "timezone": null,
    "timezoneType": null,
    "type": "Install",
    "filterType": "Any",
    "exclusionFilterType": "Any",
    "exclusionTagIds": [],
    "matchAllTagIds": [],
    "coAuthorUserIds": [
        "430c474e-2309-47bf-832b-a6e5685c3866"
    ],
    "platform": "Linux",
    "notification": {
        "notificationTypes": {
            "email": true
        },
        "notificationConfigs": {
            "recipientEmails": "johnd@qualys.com,danielm@qualys.com",
            "completedPercentage": 80
        },
        "notificationEvents": {
            "onJobStart": true,
            "onJobComplete": true
        }
    }
}

API Response

{
  "customerId": "bbb55e58-b06f-fd7b-81b8-92a7c5407282",
  "id": "8d53f5e1-ac9b-4cde-9327-31a2a6f35939",
  "schemaVersion": "1.0",
  "name": "MTG_LINUX_ONDEMAND_DEMO_1",
  "description": "Test Linux Mitigation Job",
  "type": "Install",
  "status": "Enabled",
  "coAuthorUserIds": [
    "430c474e-2309-47bf-832b-a6e5685c3866"
  ],
  "scheduleType": "On-demand",
  "startDateTime": "2025-7-01 10:34:39 AM",
  "recurring": false,
  "timezoneType": "SPECIFIC_TZ",
  "timezone": "UTC",
  "createdBy": {
    "user": {
      "id": "b0f469fe-8f5e-f169-80e1-95e8a728bb5d",
      "name": "quayxxx35",
      "fullName": "John Doe"
    },
    "date": 1751366077652
  },
  "updatedBy": {
    "user": null,
    "date": null
  },
  "deletedBy": {
    "user": null,
    "date": null
  },
  "assetCount": null,
  "taggedAssetCount": 0,
  "applicableAssetCount": 0,
  "totalAssetCount": null,
  "assetResultReceivedCount": null,
  "jobCategory": 3,
  "jobTriggerStatus": null,
  "completionPercent": null,
  "jobSource": 3,
  "readOnly": false,
  "subCategory": "Mitigation",
  "platform": "Linux",
  "assetTagIds": [
    "576b4fab-2682-433e-b3e6-c4ea9861ae75"
  ],
  "matchAllTagIds": [],
  "exclusionTagIds": [],
  "filterType": "Any",
  "exclusionFilterType": "Any",
  "notification": {
    "notificationTypes": {
      "email": true
    },
    "notificationConfigs":johnd@qualys.com,danielm@qualys.com",
      "completedPercentage": "80"
    },
    "notificationEvents": {
      "onJobStart": true,
      "onJobComplete": true
    }
  },
  "assetDetectionsQQL": "tags.uuid: [576b4fab-2682-433e-b3e6-c4ea9861ae75] AND trackingMethod:QAGENT",
  "preDeployActions": [
    {
      "actionId": "6a3c52f3-c4cc-4bac-919d-eff19f7704fe",
      "action": "Apply Mitigation",
      "actionType": "predeploy",
      "params": {
        "timeout": 180,
        "mitigationCategory": "Script-based Virtual Patch",
        "qid": 351793,
        "qidDetectionId": 0,
        "hostVulnId": 0
      },
      "mitigationList": [
        {
          "cves": [
            "CVE-2019-9511"
          ],
          "mitigationId": "01914b60-2b11-77c2-870f-64e0baa83fa2",
          "mitigationType": "Uninstall Software",
          "carScriptId": 517143954,
          "customCdnUrl": "",
          "signatureHashCode": "",
          "impactFactor": 100,
          "implication": 1
        },
        {
          "cves": [
            "CVE-2019-9513"
          ],
          "mitigationId": "01914b60-2b11-77c2-870f-64e0baa83fa2",
          "mitigationType": "Uninstall Software",
          "carScriptId": 517143954,
          "customCdnUrl": "",
          "signatureHashCode": "",
          "impactFactor": 100,
          "implication": 1
        }
      ],
      "actionLinkedToJob": false
    },
    {
      "actionId": "5ed22f60-66e1-4fca-bdc1-39dee977a31d",
      "action": "Apply Mitigation",
      "actionType": "predeploy",
      "params": {
        "timeout": 180,
        "mitigationCategory": "Script-based Virtual Patch",
        "qid": 237627,
        "qidDetectionId": 0,
        "hostVulnId": 0
      },
      "mitigationList": [
        {
          "cves": [
            "CVE-2019-9515"
          ],
          "mitigationId": "01914b60-2b11-77c2-870f-64e0baa83fa2",
          "mitigationType": "Uninstall Software",
          "carScriptId": 517143954,
          "customCdnUrl": "",
          "signatureHashCode": "",
          "impactFactor": 100,
          "implication": 1
        },
        {
          "cves": [
            "CVE-2019-9512"
          ],
          "mitigationId": "01914b60-2b11-77c2-870f-64e0baa83fa2",
          "mitigationType": "Uninstall Software",
          "carScriptId": 517143954,
          "customCdnUrl": "",
          "signatureHashCode": "",
          "impactFactor": 100,
          "implication": 1
        },
        {
          "cves": [
            "CVE-2019-9514"
          ],
          "mitigationId": "01914b60-2b11-77c2-870f-64e0baa83fa2",
          "mitigationType": "Uninstall Software",
          "carScriptId": 517143954,
          "customCdnUrl": "",
          "signatureHashCode": "",
          "impactFactor": 100,
          "implication": 1
        }
      ],
      "actionLinkedToJob": false
    }
  ],
  "postDeployActions": null,
  "vulnQQL": "vulnerabilities.vulnerability.qid:[351793, 237627]"
}

Sample - Create Linux Run Once Mitigation JobSample - Create Linux Run Once Mitigation Job

API Request

curl -X 'POST' \
  '<qualys_base_url>/mtg/v1/deploymentjob' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <JWT_Token>' \
  -H 'Content-Type: application/json' \
  -d 

API Body

{
    "qids": [
        237627,
        351793
    ],
    "assetTagIds": [
        "576b4fab-2682-433e-b3e6-c4ea9861ae75"
    ],
    "name": "MTG_LINUX_RUNONCE_DEMO",
    "description": "Test Linux Mitigation Job",
    "scheduleType": "Once",
    "schemaVersion": "1.0",
    "startDateTime": "2025-07-01 04:13:00 PM",
    "status": "Enabled",
    "timezone": "Asia/Kolkata",
    "timezoneType": "SPECIFIC_TZ",
    "type": "Install",
    "filterType": "Any",
    "exclusionFilterType": "Any",
    "exclusionTagIds": [],
    "matchAllTagIds": [],
    "coAuthorUserIds": [
        "430c474e-2309-47bf-832b-a6e5685c3866"
    ],
    "platform": "Linux",
    "notification": {
        "notificationTypes": {
            "email": true
        },
        "notificationConfigs": {
            "recipientEmails": "johnd@qualys.com,danielm@qualys.com",
            "completedPercentage": 80
        },
        "notificationEvents": {
            "onJobStart": true,
            "onJobComplete": true
        }
    }
}

API Response

{
  "customerId": "bbb55e58-b06f-fd7b-81b8-92a7c5407282",
  "id": "dc4e0434-3dee-4727-839f-77aabee562bc",
  "schemaVersion": "1.0",
  "name": "MTG_LINUX_RUNONCE_DEMO",
  "description": "Test Linux Mitigation Job",
  "type": "Install",
  "status": "Enabled",
  "coAuthorUserIds": [
    "430c474e-2309-47bf-832b-a6e5685c3866"
  ],
  "scheduleType": "Once",
  "startDateTime": "2025-07-01 04:13:00 PM",
  "recurring": false,
  "timezoneType": "SPECIFIC_TZ",
  "timezone": "Asia/Kolkata",
  "createdBy": {
    "user": {
      "id": "b0f469fe-8f5e-f169-80e1-95e8a728bb5d",
      "name": "quaysxkm35",
      "fullName": "John Doe"
    },
    "date": 1751366517418
  },
  "updatedBy": {
    "user": null,
    "date": null
  },
  "deletedBy": {
    "user": null,
    "date": null
  },
  "assetCount": null,
  "taggedAssetCount": 0,
  "applicableAssetCount": 0,
  "totalAssetCount": null,
  "assetResultReceivedCount": null,
  "jobCategory": 3,
  "jobTriggerStatus": null,
  "completionPercent": null,
  "jobSource": 3,
  "readOnly": false,
  "subCategory": "Mitigation",
  "platform": "Linux",
  "assetTagIds": [
    "576b4fab-2682-433e-b3e6-c4ea9861ae75"
  ],
  "matchAllTagIds": [],
  "exclusionTagIds": [],
  "filterType": "Any",
  "exclusionFilterType": "Any",
  "notification": {
    "notificationTypes": {
      "email": true
    },
    "notificationConfigs": {
      "recipientEmails": "johnd@qualys.com,danielm@qualys.com",
      "completedPercentage": "80"
    },
    "notificationEvents": {
      "onJobStart": true,
      "onJobComplete": true
    }
  },
  "assetDetectionsQQL": "tags.uuid: [576b4fab-2682-433e-b3e6-c4ea9861ae75] AND trackingMethod:QAGENT",
  "preDeployActions": [
    {
      "actionId": "125d725b-83d0-4d7a-be28-3f2bf6e9f7e4",
      "action": "Apply Mitigation",
      "actionType": "predeploy",
      "params": {
        "timeout": 180,
        "mitigationCategory": "Script-based Virtual Patch",
        "qid": 351793,
        "qidDetectionId": 0,
        "hostVulnId": 0
      },
      "mitigationList": [
        {
          "cves": [
            "CVE-2019-9511"
          ],
          "mitigationId": "01914b60-2b11-77c2-870f-64e0baa83fa2",
          "mitigationType": "Uninstall Software",
          "carScriptId": 517143954,
          "customCdnUrl": "",
          "signatureHashCode": "",
          "impactFactor": 100,
          "implication": 1
        },
        {
          "cves": [
            "CVE-2019-9513"
          ],
          "mitigationId": "01914b60-2b11-77c2-870f-64e0baa83fa2",
          "mitigationType": "Uninstall Software",
          "carScriptId": 517143954,
          "customCdnUrl": "",
          "signatureHashCode": "",
          "impactFactor": 100,
          "implication": 1
        }
      ],
      "actionLinkedToJob": false
    },
    {
      "actionId": "3ac2490c-83e4-4169-995b-96a58bcc4699",
      "action": "Apply Mitigation",
      "actionType": "predeploy",
      "params": {
        "timeout": 180,
        "mitigationCategory": "Script-based Virtual Patch",
        "qid": 237627,
        "qidDetectionId": 0,
        "hostVulnId": 0
      },
      "mitigationList": [
        {
          "cves": [
            "CVE-2019-9515"
          ],
          "mitigationId": "01914b60-2b11-77c2-870f-64e0baa83fa2",
          "mitigationType": "Uninstall Software",
          "carScriptId": 517143954,
          "customCdnUrl": "",
          "signatureHashCode": "",
          "impactFactor": 100,
          "implication": 1
        },
        {
          "cves": [
            "CVE-2019-9512"
          ],
          "mitigationId": "01914b60-2b11-77c2-870f-64e0baa83fa2",
          "mitigationType": "Uninstall Software",
          "carScriptId": 517143954,
          "customCdnUrl": "",
          "signatureHashCode": "",
          "impactFactor": 100,
          "implication": 1
        },
        {
          "cves": [
            "CVE-2019-9514"
          ],
          "mitigationId": "01914b60-2b11-77c2-870f-64e0baa83fa2",
          "mitigationType": "Uninstall Software",
          "carScriptId": 517143954,
          "customCdnUrl": "",
          "signatureHashCode": "",
          "impactFactor": 100,
          "implication": 1
        }
      ],
      "actionLinkedToJob": false
    }
  ],
  "postDeployActions": null,
  "vulnQQL": "vulnerabilities.vulnerability.qid:[351793, 237627]"
}