> 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/xsoar-8-api/cortex-xsoar-8.x-apis/investigations.md).

# Investigations

APIs for managing playground investigations

## Retrieve an incident investigation

> Retrieve the details of an incident investigation.

```json
{"openapi":"3.0.1","info":{"title":"Cortex XSOAR 8 API","version":"XSOAR 8 Cloud"},"tags":[{"name":"Investigations","description":"APIs for managing playground investigations"}],"servers":[{"url":"https://api-yourfqdn","description":""}],"paths":{"/xsoar/public/v1/investigation/{incident_id}":{"post":{"summary":"Retrieve an incident investigation","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Investigation"}}}}},"operationId":"post-xsoar-investigation-incident_id","description":"Retrieve the details of an incident investigation.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"tags":["Investigations"]}}},"components":{"schemas":{"Investigation":{"description":"A special investigation called playground is created for each user-project combination and is a private space for the researcher to play in.","type":"object","title":"Investigation contains the investigation of a particular incident.","properties":{"ShardID":{"type":"integer","format":"int64"},"allRead":{"type":"boolean"},"allReadWrite":{"type":"boolean"},"cacheVersn":{"type":"integer","format":"int64"},"category":{"description":"Category of the investigation","type":"string"},"childInvestigations":{"description":"ChildInvestigations id's","type":"array","items":{"type":"string"}},"closed":{"description":"When was this closed","type":"string","format":"date-time"},"closingUserId":{"description":"The user ID that closed this investigation","type":"string"},"created":{"type":"string","format":"date-time"},"creatingUserId":{"description":"The user ID that created this investigation","type":"string"},"dbotCreatedBy":{"description":"Who has created this event - relevant only for manual incidents","type":"string"},"details":{"description":"User defined free text details","type":"string"},"entitlements":{"description":"One time entitlements","type":"array","items":{"type":"string"}},"entryUsers":{"description":"EntryUsers","type":"array","items":{"type":"string"}},"hasRole":{"description":"Internal field to make queries on role faster","type":"boolean"},"highPriority":{"description":"HighPriority - tasks of this investigation should run in high priority","type":"boolean"},"highlight":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"id":{"type":"string"},"indexName":{"type":"string"},"isChildInvestigation":{"description":"IsChildInvestigation","type":"boolean"},"isDebug":{"description":"IsDebug ...","type":"boolean"},"lastOpen":{"type":"string","format":"date-time"},"mirrorAutoClose":{"description":"MirrorAutoClose will tell us to close the Chat Module channel if we close investigation","type":"object","additionalProperties":{"type":"boolean"}},"mirrorTypes":{"description":"MirrorTypes holds info about mirror direction and message type to be mirrored\nmessage type can be either 'all' or 'chat'\ndirection can be either 'FromDemisto', 'ToDemisto' or 'Both' if this investigation is mirrored","type":"object","additionalProperties":{"type":"string"}},"modified":{"type":"string","format":"date-time"},"name":{"description":"The name of the investigation, which is unique to the project","type":"string"},"numericId":{"type":"integer","format":"int64"},"openDuration":{"description":"Duration from open to close time","type":"integer","format":"int64"},"parentInvestigation":{"description":"ParentInvestigation - parent id, in case this is a child investigation of another investigation","type":"string"},"persistentEntitlements":{"description":"Persistent entitlement per tag. Empty tag will also return an entitlement","type":"object","additionalProperties":{"type":"string"}},"previousAllRead":{"type":"boolean"},"previousAllReadWrite":{"type":"boolean"},"previousRoles":{"description":"Do not change this field manually","type":"array","items":{"type":"string"}},"primaryTerm":{"type":"integer","format":"int64"},"rawCategory":{"type":"string"},"reason":{"description":"The reason for the status (resolve)","type":"object","additionalProperties":{"type":"string"}},"roles":{"description":"The role assigned to this investigation","type":"array","items":{"type":"string"}},"runStatus":{"$ref":"#/components/schemas/RunStatus"},"sequenceNumber":{"type":"integer","format":"int64"},"sizeInBytes":{"type":"integer","format":"int64"},"slackMirrorAutoClose":{"description":"DEPRECATED - DeprecatedSlackMirrorAutoClose will tell us to close the Slack channel if we close investigation","type":"boolean"},"slackMirrorType":{"description":"DEPRECATED - DeprecatedSlackMirrorType holds info about mirror direction and message type to be mirror\nmessage type can be either 'all' or 'chat'\ndirection can be either 'demisto2Slack', 'slack2Demisto' or 'both' if this investigation is mirrored to Slack","type":"string"},"sortValues":{"type":"array","items":{"type":"string"}},"status":{"$ref":"#/components/schemas/InvestigationStatus"},"syncHash":{"type":"string"},"systems":{"description":"The systems involved","type":"array","items":{"$ref":"#/components/schemas/System"}},"tags":{"description":"Tags","type":"array","items":{"type":"string"}},"type":{"$ref":"#/components/schemas/InvestigationType"},"users":{"description":"The users who share this investigation","type":"array","items":{"type":"string"}},"version":{"type":"integer","format":"int64"},"xsoarHasReadOnlyRole":{"type":"boolean"},"xsoarPreviousReadOnlyRoles":{"type":"array","items":{"type":"string"}},"xsoarReadOnlyRoles":{"type":"array","items":{"type":"string"}}}},"RunStatus":{"title":"RunStatus","type":"string","description":"Run status of a job."},"InvestigationStatus":{"description":"InvestigationStatus is the status type","type":"number","format":"double"},"System":{"description":"System - URL stands for ip or hostname","type":"object","properties":{"agent":{"$ref":"#/components/schemas/SystemAgent"},"arch":{"type":"string"},"ciphers":{"type":"array","items":{"type":"string"}},"credentials":{"type":"string"},"engineId":{"type":"string"},"host":{"type":"string"},"integrationinstanceid":{"type":"string"},"issharedagent":{"type":"boolean"},"name":{"type":"string"},"os":{"type":"string"},"password":{"type":"string"},"servicesID":{"type":"string"},"smb":{"type":"integer","format":"int64"},"smbport":{"type":"integer","format":"uint16"},"sshkey":{"type":"string"},"sshport":{"type":"integer","format":"uint16"},"terminalOptions":{"$ref":"#/components/schemas/TerminalOptions"},"user":{"type":"string"},"workgroup":{"type":"string"}}},"SystemAgent":{"description":"SystemAgent - represents agent status and holds server context","type":"object","properties":{"servercontext":{"type":"array","items":{"type":"integer","format":"uint8"}}}},"TerminalOptions":{"description":"TerminalOptions - terminal options to use in case of using pty","type":"object","properties":{"Echo":{"type":"integer","format":"uint32"},"Terminal":{"type":"boolean"},"TerminalHeight":{"type":"integer","format":"int64"},"TerminalType":{"type":"string"},"TerminalWidth":{"type":"integer","format":"int64"},"TyISpeed":{"type":"integer","format":"uint32"},"TyOSpeed":{"type":"integer","format":"uint32"}}},"InvestigationType":{"type":"number","format":"double","title":"InvestigationType ..."}}}}
```

## Reopen a closed incident

> Reopen the specified closed incident.

```json
{"openapi":"3.0.1","info":{"title":"Cortex XSOAR 8 API","version":"XSOAR 8 Cloud"},"tags":[{"name":"Investigations","description":"APIs for managing playground investigations"}],"servers":[{"url":"https://api-yourfqdn","description":""}],"paths":{"/xsoar/public/v1/investigation/{incident_id}/reopen":{"post":{"summary":"Reopen a closed incident","tags":["Investigations"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"cacheVersn":{"type":"integer"},"category":{"type":"string"},"childs":{"type":"null"},"closed":{"type":"string"},"closingUserId":{"type":"string"},"created":{"type":"string"},"creatingUserId":{"type":"string"},"dbotCreatedBy":{"type":"string"},"details":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"IndicatorTimeline":{"type":"null"},"InstanceID":{"type":"string"},"Relationships":{"type":"null"},"brand":{"type":"string"},"cacheVersn":{"type":"integer"},"category":{"type":"string"},"contents":{"type":"string"},"contentsSize":{"type":"integer"},"created":{"type":"string"},"cronView":{"type":"boolean"},"dbotCreatedBy":{"type":"string"},"endingDate":{"type":"string"},"entryTask":{"type":"null"},"errorSource":{"type":"string"},"file":{"type":"string"},"fileID":{"type":"string"},"fileMetadata":{"type":"null"},"format":{"type":"string"},"id":{"type":"string"},"incidentCreationTime":{"type":"string"},"investigationCreationTime":{"type":"string"},"investigationId":{"type":"string"},"isTodo":{"type":"boolean"},"mirrored":{"type":"boolean"},"modified":{"type":"string"},"note":{"type":"boolean"},"parentContent":{"type":"null"},"parentEntryTruncated":{"type":"boolean"},"parentId":{"type":"string"},"pinned":{"type":"boolean"},"playbookId":{"type":"string"},"recurrent":{"type":"boolean"},"reputationSize":{"type":"integer"},"reputations":{"type":"null"},"retryTime":{"type":"string"},"scheduled":{"type":"boolean"},"scheduledEntryGuid":{"type":"string"},"sizeInBytes":{"type":"integer"},"startDate":{"type":"string"},"system":{"type":"string"},"tags":{"type":"null"},"tagsRaw":{"type":"null"},"taskId":{"type":"string"},"times":{"type":"integer"},"timezoneOffset":{"type":"integer"},"type":{"type":"integer"},"user":{"type":"string"},"version":{"type":"integer"}}}},"entryUsers":{"type":"array","items":{"type":"string"}},"highPriority":{"type":"boolean"},"id":{"type":"string"},"invContext":{"type":"object","properties":{"cacheVersn":{"type":"integer"},"context":{"type":"null"},"created":{"type":"string"},"findings":{"type":"null"},"id":{"type":"string"},"importantKeys":{"type":"object","properties":{}},"modified":{"type":"string"},"sizeInBytes":{"type":"integer"},"version":{"type":"integer"}}},"isDebug":{"type":"boolean"},"lastOpen":{"type":"string"},"mirrorAutoClose":{"type":"null"},"mirrorTypes":{"type":"null"},"modified":{"type":"string"},"name":{"type":"string"},"openDuration":{"type":"integer"},"rawCategory":{"type":"string"},"reason":{"type":"object","properties":{"Close Notes":{"type":"string"},"Close Reason":{"type":"string"}}},"runStatus":{"type":"string"},"sizeInBytes":{"type":"integer"},"slackMirrorAutoClose":{"type":"boolean"},"slackMirrorType":{"type":"string"},"status":{"type":"integer"},"systems":{"type":"null"},"tags":{"type":"null"},"totalEntries":{"type":"integer"},"type":{"type":"integer"},"users":{"type":"array","items":{"type":"string"}},"version":{"type":"integer"}}}}}}},"operationId":"post-xsoar-investigation-incident_id-reopen","description":"Reopen the specified closed incident.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"integer"}}}}}}}}}}
```

## Get investigation workplan

> Get the investigation workplan for the specified incident.

```json
{"openapi":"3.0.1","info":{"title":"Cortex XSOAR 8 API","version":"XSOAR 8 Cloud"},"tags":[{"name":"Investigations","description":"APIs for managing playground investigations"}],"servers":[{"url":"https://api-yourfqdn","description":""}],"paths":{"/xsoar/public/v1/investigation/{incident_id}/workplan":{"get":{"summary":"Get investigation workplan","tags":["Investigations"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"cacheVersn":{"type":"integer"},"category":{"type":"string"},"childs":{"type":"null"},"closed":{"type":"string"},"closingUserId":{"type":"string"},"created":{"type":"string"},"creatingUserId":{"type":"string"},"dbotCreatedBy":{"type":"string"},"details":{"type":"string"},"entryUsers":{"type":"array","items":{"type":"string"}},"highPriority":{"type":"boolean"},"id":{"type":"string"},"invContext":{"type":"null"},"invPlaybook":{"type":"null"},"isDebug":{"type":"boolean"},"lastOpen":{"type":"string"},"mirrorAutoClose":{"type":"null"},"mirrorTypes":{"type":"null"},"modified":{"type":"string"},"name":{"type":"string"},"openDuration":{"type":"integer"},"rawCategory":{"type":"string"},"reason":{"type":"object","properties":{"Close Notes":{"type":"string"},"Close Reason":{"type":"string"}}},"runStatus":{"type":"string"},"sizeInBytes":{"type":"integer"},"slackMirrorAutoClose":{"type":"boolean"},"slackMirrorType":{"type":"string"},"status":{"type":"integer"},"systems":{"type":"null"},"tags":{"type":"null"},"totalEntries":{"type":"integer"},"type":{"type":"integer"},"users":{"type":"array","items":{"type":"string"}},"version":{"type":"integer"}}}}}}},"operationId":"get-xsoar-investigation-incident_id-workplan","description":"Get the investigation workplan for the specified incident."}}}}
```

## Retrieve an investigation workplan task list

> Retrieve the details of an investigation workplan task list.

```json
{"openapi":"3.0.1","info":{"title":"Cortex XSOAR 8 API","version":"XSOAR 8 Cloud"},"tags":[{"name":"Investigations","description":"APIs for managing playground investigations"}],"servers":[{"url":"https://api-yourfqdn","description":""}],"paths":{"/xsoar/public/v1/investigation/{incident_id}/workplan/tasks":{"post":{"summary":"Retrieve an investigation workplan task list","tags":["Investigations"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"Reopen":{"type":"boolean"},"ancestors":{"type":"array","items":{"type":"string"}},"completedDate":{"type":"string"},"continueOnErrorType":{"type":"string"},"dueDate":{"type":"string"},"evidenceData":{"type":"object","properties":{}},"hasErrorEntries":{"type":"boolean"},"id":{"type":"string"},"indent":{"type":"integer"},"patched":{"type":"boolean"},"previousTasks":{"type":"object","properties":{"#none#":{"type":"array","items":{"type":"string"}}}},"startDate":{"type":"string"},"state":{"type":"string"},"task":{"type":"object","properties":{"cacheVersn":{"type":"integer"},"id":{"type":"string"},"modified":{"type":"string"},"name":{"type":"string"},"sizeInBytes":{"type":"integer"},"type":{"type":"string"},"version":{"type":"integer"}}},"taskId":{"type":"string"},"type":{"type":"string"},"view":{"type":"object","properties":{"position":{"type":"object","properties":{"x":{"type":"integer"},"y":{"type":"integer"}}}}}}}}}}}},"operationId":"post-xsoar-investigation-incident_id-workplan-tasks","description":"Retrieve the details of an investigation workplan task list.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"states":{"type":"array","items":{"type":"string"}},"types":{"type":"array","items":{"type":"string"}}}}}}}}}}}
```

## Get investigation ID context

> Retrieve all context values from the specified investigation.> \\
>
> \
> You can use the \[Cortex XSOAR Transform Language (DT)]\(<https://xsoar.pan.dev/docs/integrations/dt>).> \\
>
> \
> For example, if you have context data in the specified investigation as follows: \`my\_key: "my\_value"\`, you can run the following API query:> \
> \`\`\`> \
> <https://api-{fqdn}/xsoar/public/v1/investigation/{investigation\\_id}/context>' -H "Authorization:$api\_key" -H "x-xdr-auth-id:$api\_key\_id" -H "Content-Type:application/json" -d '{"query":"${.}"}> \
> \`\`\`> \
> you would get the following response:> \
> \`\`\`json> \
> {> \
> &#x20;   "my\_key":"my\_value"> \
> &#x20;   }> \
> \`\`\`> \\
>
> \
> If you run the following query:> \
> \`\`\`> \
> <https://api-{fqdn}/xsoar/public/v1/investigation/{investigation\\_id}/context>' -H "Authorization:$api\_key" -H "x-xdr-auth-id:$api\_key\_id" -H "Content-Type:application/json" -d '{"query":"${.my\_key}"}> \
> \`\`\`> \
> you would get the following response:> \
> \`\`\`json> \
> "my\_value"> \
> \`\`\`

````json
{"openapi":"3.0.1","info":{"title":"Cortex XSOAR 8 API","version":"XSOAR 8 Cloud"},"tags":[{"name":"Investigations","description":"APIs for managing playground investigations"}],"servers":[{"url":"https://api-yourfqdn","description":""}],"paths":{"/xsoar/public/v1/investigation/{investigation_id}/context":{"post":{"summary":"Get investigation ID context","tags":["Investigations"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"my_key":{"type":"string"}}}}}}},"operationId":"post-investigation-id-context","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","properties":{"query":{"type":"string"}}}}},"description":""},"description":"Retrieve all context values from the specified investigation.\r\n\r\nYou can use the [Cortex XSOAR Transform Language (DT)](https://xsoar.pan.dev/docs/integrations/dt).\r\n\r\nFor example, if you have context data in the specified investigation as follows: `my_key: \"my_value\"`, you can run the following API query:\r\n```\r\nhttps://api-{fqdn}/xsoar/public/v1/investigation/{investigation_id}/context' -H \"Authorization:$api_key\" -H \"x-xdr-auth-id:$api_key_id\" -H \"Content-Type:application/json\" -d '{\"query\":\"${.}\"}\r\n```\r\nyou would get the following response:\r\n```json\r\n{\r\n    \"my_key\":\"my_value\"\r\n    }\r\n```\r\n\r\nIf you run the following query:\r\n```\r\nhttps://api-{fqdn}/xsoar/public/v1/investigation/{investigation_id}/context' -H \"Authorization:$api_key\" -H \"x-xdr-auth-id:$api_key_id\" -H \"Content-Type:application/json\" -d '{\"query\":\"${.my_key}\"}\r\n```\r\nyou would get the following response:\r\n```json\r\n\"my_value\"\r\n```"}}}}
````

## Close an investigation

> Close the specified investigation.

```json
{"openapi":"3.0.1","info":{"title":"Cortex XSOAR 8 API","version":"XSOAR 8 Cloud"},"tags":[{"name":"Investigations","description":"APIs for managing playground investigations"}],"servers":[{"url":"https://api-yourfqdn","description":""}],"paths":{"/xsoar/public/v1/investigation/{investigation_id}/close":{"post":{"summary":"Close an investigation","tags":["Investigations"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"integer"},"cacheVersn":{"type":"integer"},"modified":{"type":"string"},"sizeInBytes":{"type":"integer"},"type":{"type":"integer"},"created":{"type":"string"},"incidentCreationTime":{"type":"string"},"investigationCreationTime":{"type":"string"},"retryTime":{"type":"string"},"user":{"type":"string"},"errorSource":{"type":"string"},"contents":{"type":"string"},"format":{"type":"string"},"investigationId":{"type":"string"},"file":{"type":"string"},"fileID":{"type":"string"},"parentId":{"type":"string"},"pinned":{"type":"boolean"},"fileMetadata":{"type":"null"},"parentContent":{"type":"null"},"parentEntryTruncated":{"type":"boolean"},"system":{"type":"string"},"reputations":{"type":"null"},"category":{"type":"string"},"note":{"type":"boolean"},"isTodo":{"type":"boolean"},"tags":{"type":"null"},"tagsRaw":{"type":"null"},"startDate":{"type":"string"},"times":{"type":"integer"},"recurrent":{"type":"boolean"},"endingDate":{"type":"string"},"timezoneOffset":{"type":"integer"},"cronView":{"type":"boolean"},"scheduled":{"type":"boolean"},"scheduledEntryGuid":{"type":"string"},"entryTask":{"type":"null"},"taskId":{"type":"string"},"playbookId":{"type":"string"},"reputationSize":{"type":"integer"},"contentsSize":{"type":"integer"},"InstanceID":{"type":"string"},"IndicatorTimeline":{"type":"null"},"Relationships":{"type":"null"},"mirrored":{"type":"boolean"}}}}}}},"operationId":"post-investigation-incident_id-close","description":"Close the specified investigation.","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","properties":{"closeNotes":{"type":"string","description":"Descriptive notes explaining why the investigation is closed."},"closeReason":{"type":"string","description":"Reason the investigation is closed."}}}}}}}}}}
```


---

# 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/xsoar-8-api/cortex-xsoar-8.x-apis/investigations.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.
