> 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/xsiam-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 XSIAM Platform APIs","version":"Cortex XSIAM 3.6"},"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 XSIAM Platform APIs","version":"Cortex XSIAM 3.6"},"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 XSIAM Platform APIs","version":"Cortex XSIAM 3.6"},"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 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/xsiam-api/cortex-platform/playbooks.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.
