> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/xpanse-api/xpanse-public-api/remediation-scanning.md).

# Remediation Scanning

APIs for remediation scanning

## Get or Create an RCS request

> Get or create a remediation confirmation scanning request.

```json
{"openapi":"3.0.2","info":{"title":"Cortex Xpanse REST API","version":"2.12.0"},"tags":[{"name":"Remediation Scanning","description":"APIs for remediation scanning"}],"servers":[{"url":"https://api-{{fqdn}}"}],"paths":{"/public_api/v1/remediation_confirmation_scanning/requests/get_or_create/":{"post":{"parameters":[{"in":"header","name":"authorization","description":"api-key","schema":{"type":"string"},"required":true},{"in":"header","name":"x-xdr-auth-id","description":"api-key-id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"A 200 response is returned for a scan that already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOrCreateRemediationScanResponse"}}}},"201":{"description":"A 201 response is sent for a new scan request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOrCreateRemediationScanResponse"}}}},"400":{"description":"Bad Request. Got an invalid JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultApiErrorResponse"}}}},"401":{"description":"Unauthorized access. An issue occurred during authentication. This can indicate an incorrect key, id, or other invalid authentication parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultApiErrorResponse"}}}},"402":{"description":"Unauthorized access. User does not have the required license type to run this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultApiErrorResponse"}}}},"403":{"description":"Forbidden access. The provided API Key does not have the required RBAC permissions to run this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultApiErrorResponse"}}}},"422":{"$ref":"#/components/responses/UNPROCESSABLE_ENTITY"},"500":{"description":"Internal server error. A unified status for API communication type errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultApiErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOrCreateRemediationScanRequest"}}},"description":"All three filters must be included in the request. \r\n- **attack_surface_rule_id** -- **eq** -- *string*\r\n- **alert_internal_id** -- **eq** -- *integer*\r\n- **service_id** -- **eq** -- *string*"},"summary":"Get or Create an RCS request","description":"Get or create a remediation confirmation scanning request.","tags":["Remediation Scanning"]}}},"components":{"schemas":{"GetOrCreateRemediationScanResponse":{"type":"object","properties":{"reply":{"$ref":"#/components/schemas/RemediationScanId"}},"required":["reply"],"additionalProperties":true},"RemediationScanId":{"type":"object","properties":{"scanId":{"type":"string"}},"additionalProperties":true},"DefaultApiErrorResponse":{"type":"object","properties":{"reply":{"description":"The query results upon error.","allOf":[{"$ref":"#/components/schemas/GenericReply"}]}},"required":["reply"],"additionalProperties":true},"GenericReply":{"type":"object","properties":{"err_code":{"type":"string","description":"HTTP response code."},"err_msg":{"type":"string","description":"Error message."},"err_extra":{"type":"string","description":"Additional information describing the error."}},"additionalProperties":true},"Error":{"type":"object","properties":{"code":{"type":"integer","description":"Error code"},"status":{"type":"string","description":"Error name"},"message":{"type":"string","description":"Error message"},"errors":{"type":"object","description":"Errors"}}},"GetOrCreateRemediationScanRequest":{"type":"object","properties":{"request_data":{"$ref":"#/components/schemas/RemediationScanFilterRequest"}},"required":["request_data"],"additionalProperties":true},"RemediationScanFilterRequest":{"type":"object","description":"A dictionary containing the API request fields. An empty dictionary returns all results.","required":["filters"],"properties":{"filters":{"type":"array","minItems":0,"maxItems":3,"description":"An array of filter fields.","items":{"$ref":"#/components/schemas/RemediationScanFilterCondition"}}}},"RemediationScanFilterCondition":{"type":"object","required":["field","operator","value"],"properties":{"field":{"enum":["attack_surface_rule_id","alert_internal_id","service_id"],"description":"All three of these filters must be used."},"operator":{"enum":["eq","EQ"]},"value":{"anyOf":[{"type":"string"},{"type":"integer"}]}}}},"responses":{"UNPROCESSABLE_ENTITY":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}
```

## Poll an RCS Request

> Check the status of a remediation confirmation scan.

```json
{"openapi":"3.0.2","info":{"title":"Cortex Xpanse REST API","version":"2.12.0"},"tags":[{"name":"Remediation Scanning","description":"APIs for remediation scanning"}],"servers":[{"url":"https://api-{{fqdn}}"}],"paths":{"/public_api/v1/remediation_confirmation_scanning/requests/get/":{"post":{"parameters":[{"in":"header","name":"authorization","description":"api-key","schema":{"type":"string"},"required":true},{"in":"header","name":"x-xdr-auth-id","description":"api-key-id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollRemediationScanResultsResponse"}}}},"400":{"description":"Bad Request. Got an invalid JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultApiErrorResponse"}}}},"401":{"description":"Unauthorized access. An issue occurred during authentication. This can indicate an incorrect key, id, or other invalid authentication parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultApiErrorResponse"}}}},"402":{"description":"Unauthorized access. User does not have the required license type to run this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultApiErrorResponse"}}}},"403":{"description":"Forbidden access. The provided API Key does not have the required RBAC permissions to run this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultApiErrorResponse"}}}},"422":{"$ref":"#/components/responses/UNPROCESSABLE_ENTITY"},"500":{"description":"Internal server error. A unified status for API communication type errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultApiErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollRemediationScanResultsRequest"}}}},"summary":"Poll an RCS Request","description":"Check the status of a remediation confirmation scan.","tags":["Remediation Scanning"]}}},"components":{"schemas":{"PollRemediationScanResultsResponse":{"type":"object","properties":{"reply":{"$ref":"#/components/schemas/RemediationScanStatus"}},"required":["reply"],"additionalProperties":true},"RemediationScanStatus":{"type":"object","properties":{"status":{"type":"string","description":"Possible values are:\n  - IN_PROGRESS\n  - FAILED_TIMEOUT\n  - FAILED_ERROR\n  - SUCCESS\n"},"result":{"type":"string","description":"If the status equals \"SUCCESS\", then possible result values are:\n  - REMEDIATED\n  - UNREMEDIATED\n"}},"required":["status"],"additionalProperties":true},"DefaultApiErrorResponse":{"type":"object","properties":{"reply":{"description":"The query results upon error.","allOf":[{"$ref":"#/components/schemas/GenericReply"}]}},"required":["reply"],"additionalProperties":true},"GenericReply":{"type":"object","properties":{"err_code":{"type":"string","description":"HTTP response code."},"err_msg":{"type":"string","description":"Error message."},"err_extra":{"type":"string","description":"Additional information describing the error."}},"additionalProperties":true},"Error":{"type":"object","properties":{"code":{"type":"integer","description":"Error code"},"status":{"type":"string","description":"Error name"},"message":{"type":"string","description":"Error message"},"errors":{"type":"object","description":"Errors"}}},"PollRemediationScanResultsRequest":{"type":"object","properties":{"request_data":{"$ref":"#/components/schemas/RemediationScanResultsFilterRequest"}},"required":["request_data"],"additionalProperties":true},"RemediationScanResultsFilterRequest":{"type":"object","properties":{"filters":{"type":"array","minItems":1,"maxItems":1,"items":{"$ref":"#/components/schemas/PollRemediationScanResultsFilterCondition"}}},"required":["filters"],"additionalProperties":true},"PollRemediationScanResultsFilterCondition":{"type":"object","properties":{"field":{"type":"string","enum":["id"],"description":"\"id\": Indicates that you want to filter on a specific scan ID."},"operator":{"type":"string","default":"eq","enum":["eq"],"description":"EQ"},"value":{"type":"string","description":"The scan ID (string)."}},"required":["value"],"additionalProperties":true}},"responses":{"UNPROCESSABLE_ENTITY":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/xpanse-api/xpanse-public-api/remediation-scanning.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
