> 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/xdr-3-api/cortex-xdr-3.x-apis/rule-management.md).

# Rule Management

APIs for managing rules

## Insert Simple Indicators, CSV

> Upload IOCs in CSV format that you retrieved from external threat intelligence sources. \
> \
> Note: Cortex XDR does not scan historic data, but rather only new incoming data.\
> \
> Required license: \*\*Cortex XDR Pro per Endpoint\*\* or \*\*Cortex XDR Pro per GB\*\*

```json
{"openapi":"3.0.0","info":{"title":"Cortex XDR REST API","version":"3.18"},"tags":[{"name":"Rule Management","description":"APIs for managing rules"}],"servers":[{"url":"https://api-yourfqdn"}],"paths":{"/public_api/v1/indicators/insert_csv":{"post":{"operationId":"postInsertCsv","parameters":[{"schema":{"type":"string"},"in":"header","name":"Authorization","description":"{api_key}","required":true},{"schema":{"type":"string"},"in":"header","name":"x-xdr-auth-id","description":"{api_key_id}","required":true},{"schema":{"type":"string","default":"gzip"},"in":"header","name":"Accept-Encoding","description":"For retrieving a compressed gzipped response"}],"summary":"Insert Simple Indicators, CSV","description":"Upload IOCs in CSV format that you retrieved from external threat intelligence sources. \n\nNote: Cortex XDR does not scan historic data, but rather only new incoming data.\n\nRequired license: **Cortex XDR Pro per Endpoint** or **Cortex XDR Pro per GB**","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"request_data":{"type":"string","description":"The body of this request contains a JSON object with a single field: `request_data`. This field is required. Its value is as string containing two or more comma-separated lines. The first line must contain the CSV header. All subsequent lines must represent IOC data. Each line must include at a minimum the required CSV fields, which are identified below. To help you validate the upload, you can send a separate validate field to view an array of errors with an unsuccessful call.\r\n\r\nSee the [Insert Parsed IOCs Fields](https://app.gitbook.com/s/bcaz3nnErYwzhJKuv5Ls/cortex-xdr-3.x-apis/cortex-xdr-tables#insert-parsed-iocs-fields) table."},"validate":{"type":"boolean","description":"Indicates whether to return an array of errors in the case of an unsuccessful update indicator API request."}},"required":["request_data"]}}},"description":""},"responses":{"200":{"description":"SUCCESS","content":{"application/json":{"schema":{"type":"object","properties":{"reply":{"type":"object","properties":{"success":{"type":"boolean","description":"true=upload successful"},"validation_errors":{"type":"array","description":"Array of the following fields:\n- indicator: Name of the indicator that failed to upload.\n- error: Description of the error that caused the indicator to upload.","items":{"type":"object","properties":{"indicator":{"type":"string"},"error":{"type":"string"}}}}}}}}}}},"400":{"description":"Bad Request. Got an invalid JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reply"}}}},"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/reply"}}}},"402":{"description":"Unauthorized access. User does not have the required license type to run this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reply"}}}},"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/reply"}}}},"500":{"description":"Internal server error. A unified status for API communication type errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reply"}}}}},"tags":["Rule Management"]}}},"components":{"schemas":{"reply":{"title":"reply","type":"object","description":"The query result upon error.","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."}}}}}}
```

## Insert Simple Indicators, JSON

> Upload IOCs as JSON objects that you retrieved from external threat intelligence sources.\
> \
> Note: Cortex XDR does not scan historic data, but rather only new incoming data.\
> \
> Required License: \*\*Cortex XDR Pro per Endpoint\*\* or \*\*Cortex XDR Pro per GB\*\*

```json
{"openapi":"3.0.0","info":{"title":"Cortex XDR REST API","version":"3.18"},"tags":[{"name":"Rule Management","description":"APIs for managing rules"}],"servers":[{"url":"https://api-yourfqdn"}],"paths":{"/public_api/v1/indicators/insert_jsons":{"post":{"operationId":"postInsertJsons","parameters":[{"schema":{"type":"string"},"in":"header","name":"Authorization","description":"{api_key}","required":true},{"schema":{"type":"string"},"in":"header","name":"x-xdr-auth-id","description":"{api_key_id}","required":true},{"schema":{"type":"string","default":"gzip"},"in":"header","name":"Accept-Encoding","description":"For retrieving a compressed gzipped response"}],"summary":"Insert Simple Indicators, JSON","tags":["Rule Management"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"reply":{"type":"object","description":"JSON object containing a query result.","properties":{"success":{"type":"boolean","description":"Indicates if any of the IOCs were upload successfully."},"validation_errors":{"type":"array","description":"Array of the IOCs that did not upload.","items":{"type":"object","properties":{"indicator":{"type":"string","description":"Name of the indicator that failed to upload."},"error":{"type":"string","description":"Description of the error that caused the indicator to fail upload."}}}}}}}}}}},"400":{"description":"Bad Request. Got an invalid JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reply"}}}},"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/reply"}}}},"402":{"description":"Unauthorized access. User does not have the required license type to run this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reply"}}}},"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/reply"}}}},"500":{"description":"Internal server error. A unified status for API communication type errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reply"}}}}},"description":"Upload IOCs as JSON objects that you retrieved from external threat intelligence sources.\n\nNote: Cortex XDR does not scan historic data, but rather only new incoming data.\n\nRequired License: **Cortex XDR Pro per Endpoint** or **Cortex XDR Pro per GB**","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"request_data":{"type":"array","items":{"type":"object","properties":{"indicator":{"type":"string","description":"String that identifies the indicator you want to insert into Cortex XDR."},"type":{"type":"string","enum":["HASH","IP","DOMAIN_NAME","FILENAME"],"description":"Identifies the type of indicator."},"severity":{"type":"string","enum":["INFO","LOW","MEDIUM","HIGH","CRITICAL","unknown"],"description":"The indicator's severity."},"expiration_date":{"type":"integer","description":"Integer representing the indicator's expiration timestamp. Thisis a Unix epoch timestamp value, in milliseconds. If this indicator has no expiration, use `Never`. If this value is `NULL`, the indicator\nreceives the indicator's type value with the default expirationdate. Valid values are:\n- 7 days\n- 30 days\n- 90 days\n- 180 days"},"comment":{"type":"string","description":"A descriptive comment."},"reputation":{"type":"string","description":"Keyword representing the indicator's reputation.","enum":["GOOD","BAD","SUSPICIOUS","UNKNOWN","NO_REPUTATION"]},"reliability":{"description":"Character representing the indicator's reliability rating. Valid values are A - F. A is the most reliable, F is the least.","enum":["A","B","C","D","E","F","G"]},"vendors":{"type":"array","description":"A list of vendors including vendor name, reliability, and reputation.","items":{"type":"object","properties":{"vendor_name":{"type":"string","description":"Vendor name."},"reliability":{"type":"string","description":"Vendor reliability."},"reputation":{"type":"string","description":"Vendor reputation."}}}},"class":{"type":"string"}},"required":["indicator","type","severity"]}},"validate":{"type":"boolean","description":"Whether to return an array of errors in the case of an unsuccessful update indicator API request."}},"required":["request_data"]}}},"description":"The body of this request contains a JSON object with a single field: `request_data`. This field is required. Its value is an array of JSON objects, each element of which represents IOC data. Each object must include at a minimum the required fields, which are identified below.\n\nNote: Cortex XDR recommends you send the validate field in your request call to view the API validation errors. Without sending the validate field, the API may return a reply of “true” without any information of why the IOC failed to upload."}}}},"components":{"schemas":{"reply":{"title":"reply","type":"object","description":"The query result upon error.","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."}}}}}}
```


---

# 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/xdr-3-api/cortex-xdr-3.x-apis/rule-management.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.
