> 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-5-api/cortex-platform/playbooks.md).

# Playbooks

APIs for managing playbooks

## Get a playbook

> &#x20;Get a playbook by filtering based on its name or ID. The playbook's YAML is returned in a ZIP file.\
> \
> &#x20;Requires the granular RBAC permission for this feature.

```json
{"openapi":"3.0.0","info":{"title":"Cortex XDR Platform APIs","version":"Cortex XDR 5.2"},"tags":[{"name":"Playbooks","description":"APIs for managing playbooks"}],"servers":[{"url":"https://api-yourfqdn"}],"paths":{"/public_api/v1/playbooks/get":{"post":{"summary":"Get a playbook","tags":["Playbooks"],"responses":{"200":{"description":"OK","content":{}}},"operationId":"post-public_api-v1-playbooks-get","description":" Get a playbook by filtering based on its name or ID. The playbook's YAML is returned in a ZIP file.\n\n Requires the granular RBAC permission for this feature.","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}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["request_data"],"properties":{"request_data":{"type":"object","properties":{"filter":{"type":"object","description":"Filter fields.","properties":{"field":{"enum":["id","name"],"description":"Identifies the playbook field the filter is matching. Filters are based on the following keywords:\r\n- `name`: Playbook name\r\n- `id`: Playbook ID"},"value":{"type":"string","description":"Value that this filter must match."}}}}}}}}}}}}}}
```

## Insert or update playbooks

> Add or update a playbook by passing the YAML in a ZIP file.\
> \
> Requires the granular RBAC permission for this feature.

```json
{"openapi":"3.0.0","info":{"title":"Cortex XDR Platform APIs","version":"Cortex XDR 5.2"},"tags":[{"name":"Playbooks","description":"APIs for managing playbooks"}],"servers":[{"url":"https://api-yourfqdn"}],"paths":{"/public_api/v1/playbooks/insert":{"post":{"summary":"Insert or update playbooks","tags":["Playbooks"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"objects_count":{"type":"integer","description":"The number of playbooks identified and attempted to be added."},"objects":{"type":"object","properties":{"failures_items":{"type":"array","description":"This field in the response indicates that the playbook IDs listed failed to be added.","items":{"type":"object","properties":{"error":{"type":"string","description":"Error message."},"id":{"type":"string","description":"Playbook ID of the playbook that failed to be added."}}}}}}}}}}}},"operationId":"post-public_api-v1-playbooks-insert","description":"Add or update a playbook by passing the YAML in a ZIP file.\n\nRequires the granular RBAC permission for this feature.","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}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}}}}}}
```

## Delete a playbook

> Delete a playbook by filtering based on its name or ID.\
> \
> Requires the granular RBAC permission for this feature.

```json
{"openapi":"3.0.0","info":{"title":"Cortex XDR Platform APIs","version":"Cortex XDR 5.2"},"tags":[{"name":"Playbooks","description":"APIs for managing playbooks"}],"servers":[{"url":"https://api-yourfqdn"}],"paths":{"/public_api/v1/playbooks/delete":{"post":{"summary":"Delete a playbook","tags":["Playbooks"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"objects_count":{"type":"integer","description":"The number of playbooks identified and attempted to be deleted."},"objects":{"type":"object","properties":{"failures_items":{"type":"array","description":"This field in the response indicates that the playbook IDs listed failed to be deleted.","items":{"type":"object","properties":{"error":{"type":"string","description":"Error message."},"id":{"type":"string","description":"Playbook ID of the playbook that failed to be deleted."}}}},"succeeded_items":{"type":"array","description":"This field in the response indicates that the playbook IDs listed were successfully deleted.","items":{"type":"object","properties":{"id":{"type":"string","description":"Playbook ID of the playbook that was successfully deleted."}}}}}}}}}}}},"operationId":"post-public_api-v1-playbooks-delete","description":"Delete a playbook by filtering based on its name or ID.\n\nRequires the granular RBAC permission for this feature.","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}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["request_data"],"properties":{"request_data":{"type":"object","properties":{"filter":{"type":"object","description":"Filter fields.","properties":{"field":{"enum":["id","name"],"description":"Identifies the playbook field the filter is matching. Filters are based on the following keywords:\r\n- `name`: Playbook name\r\n- `id`: Playbook ID"},"value":{"type":"string","description":"Value that this filter must match."}}}}}}}}}}}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/xdr-5-api/cortex-platform/playbooks.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
