Details
| ID | Core REST API |
|---|---|
| Provider | Palo Alto Networks |
| Category | Utilities |
| From Version | 5.0.0 |
| Supported Modules | Agentix Cortex Cloud Cloud Runtime Security Cloud Posture Security XSIAM EDR |
README
Configure Core REST API in Cortex
| Parameter | Description | Required |
|---|---|---|
| Core Server URL | For Cortex XSOAR 8 or Cortex XSIAM, use the Copy API URL button on the API Keys page. For Cortex XSOAR 6, use the server URL. | True |
| API Key ID | The API Key ID that is linked to the API Key (relevant for Cortex XSIAM and Cortex XSOAR 8.0.0 and above). | True |
| API Key (Password) | The core server API key. | True |
| Authentication method | Whether authentication should be using “Standard” API key or “Advanced” API key. | True |
| Base marketplace url | The base url for the tenant marketplace. | False |
| Trust any certificate (not secure) | Trust any certificate (not secure). | False |
| Use system proxy settings | Use system proxy settings. | False |
Commands
You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.
Please Note: When updating or making changes to a custom content item (integration, script, list, etc.), it may be necessary to increment the version of the item. To do so, first fetch the current version (usually via a GET command) and then increment the version by 1. Lastly, when updating an item, please use this incremented value for the version field.
core-api-post
send HTTP POST request
Base Command
core-api-post
Input
| Argument Name | Description | Required |
|---|---|---|
| uri | Request endpoint (e.g. /incident or /public_api/v1/incidents/update_incident). | Required |
| body | Body of HTTP POST. | Optional |
Context Output
There is no context output for this command.
Command Example
!core-api-post uri=/lists/save body={\"name\":\"list_name\",\"data\":\"list_data\"}
Human Readable Output
{“response”:{“commitMessage”:””,”data”:”list_data”,”definitionId”:””,”description”:””,”fromServerVersion”:””,”id”:”list_name”,”itemVersion”:””,”locked”:false,”modified”:”2022-05-29T12:20:14.988577Z”,”name”:”list_name”,”nameLocked”:false,”packID”:””,”prevName”:”list_name”,”primaryTerm”:6,”propagationLabels”:[“all”],”sequenceNumber”:907233,”shouldCommit”:false,”system”:false,”tags”:null,”toServerVersion”:””,”truncated”:false,”type”:”plain_text”,”vcShouldIgnore”:false,”vcShouldKeepItemLegacyProdMachine”:false,”version”:1}}
core-api-get
send HTTP GET requests
Base Command
core-api-get
Input
| Argument Name | Description | Required |
|---|---|---|
| uri | Request endpoint (e.g. /user or /public_api/v1/rbac/get_users). | Required |
Context Output
There is no context output for this command.
Command Example
!core-api-get uri=/user
Human Readable Output
{“response”:{“addedSharedDashboards”:[“Threat Intelligence Feeds”,”Troubleshooting Instances”],”allRoles”:[“Administrator”],”defaultAdmin”:true,”email”:”admintest@core.com”,”id”:”admin”,”image”:”8327000###user_image_admin.png”,”lastLogin”:”2022-05-29T15:13:46.224432+03:00”,”name”:”Admin Dude”,”notificationsSettings”:{“email”:{“all”:true},”pushNotifications”:{“all”:true}},”permissions”:{“core”:[“scripts.rwx”,”playbooks.rw”]},”phone”:”+650-123456”,”playgroundId”:”beda-02ab-49ef-8fc1-c43a36f”}}
core-api-put
send HTTP PUT request
Base Command
core-api-put
Input
| Argument Name | Description | Required |
|---|---|---|
| uri | Request endpoint (e.g. /user). | Required |
| body | Request body. | Optional |
core-api-delete
send HTTP DELETE request
Base Command
core-api-delete
Input
| Argument Name | Description | Required |
|---|---|---|
| uri | Request endpoint (e.g. /user). | Required |
Context Output
There is no context output for this command.
Command Example
!core-api-delete uri=/dashboards/9a6cc590-72bb-4ed5-84e9-4577c6d8cbb9
Human Readable Output
{“response”:””}
core-api-download
Download files from core server
Base Command
core-api-download
Input
| Argument Name | Description | Required |
|---|---|---|
| uri | Request endpoint. | Required |
| filename | File name of download. | Optional |
| description | Description of file entry. | Optional |
Context Output
There is no context output for this command.
Command Example
!core-api-download uri=/log/bundle
Context Example
{
"File": {
"EntryID": "yukswe2UVanMjyvEANmLBH@bed9ccda-02ab-49ef-8fc1-c43a",
"Extension": "gz",
"Info": "gz",
"MD5": "e4e0a23740dfaa27f00b276af",
"Name": "logs-bundle-29May2215_14IDT.tar.gz",
"SHA1": "95e0ebd554ea107f04508d6c2d9e6361",
"SHA256": "83032a86295279ecdf516b63eae7a7e3e5af301bf4dfed3c82faa23b58",
"SHA512": "88a3fa0194c7dd439c749b2b0b9cbef64ce18e469d0b8b62bcf18919ffcefd1c99119c993070454d48061357ff0dd0ffe0a070936b62c7ac35035de3",
"SSDeep": "98304:wAjPMXI9/8BoAKIxrVqJVAw6LgJEBFCH73LOOFdWgiwvSJdBo:3PmI9/8jKIxrVOELrCHwq7O",
"Size": 4052002,
"Type": "gzip compressed data, original size modulo 2^32 46240256"
}
}
Human Readable Output
core-api-multipart
Send HTTP Multipart request to upload files to Core server
Base Command
core-api-multipart
Input
| Argument Name | Description | Required |
|---|---|---|
| uri | Request endpoint. | Required |
| entryID | File entry ID. | Required |
| body | Request body. | Optional |
Context Output
There is no context output for this command.
Command Example
!core-api-multipart uri=/incident/upload/204 entryID=evnKTiujxaZEkeKRxiBMig@bed9ccda-02ab-49ef-8fc1-c43a36ff38f5 body=test_bark
Human Readable Output
{“response”:{“activated”:”0001-01-01T00:00:00Z”,”attachment”:[{“description”:””,”name”:”logs-bundle-29May2214_36IDT.tar.gz”,”path”:”204_34d-836b-4b38-81eb-9b90af9c1a_logs-bundle-29May2214_36IDT.tar.gz”,”showMediaFile”:false,”type”:”application/octet-stream”}],”autime”:1653651342394000,”closed”:”0001-01-01T00:00:00Z”,”created”:”2022-05-27T13:15:51.342394+03:00”,”dueDate”:”0001-01-01T00:00:00Z”,”id”:”204”,”labels”:[{“type”:”Brand”,”value”:”Grafana”},{“type”:”Instance”,”value”:”Grafana_instance_1”}],”modified”:”2022-05-29T12:20:17.196279Z”,”name”:”Adi’s Alert”,”numericId”:204,”occurred”:”2022-05-27T02:02:30Z”,”rawName”:”Adi’s Alert”,”rawType”:”Grafana Alert”,”sequenceNumber”:545,”sourceBrand”:”Grafana”,”sourceInstance”:”Grafana_instance_1”,”type”:”Grafana Alert”,”version”:2}}
core-delete-incidents
Delete Core incidents
Base Command
core-delete-incidents
Input
| Argument Name | Description | Required |
|---|---|---|
| ids | IDs of the incidents to delete. | Required |
Context Output
There is no context output for this command.
Command Example
!core-delete-incidents ids=152
Human Readable Output
Core delete incidents
totalDeleted total notUpdated 1 143 0
core-api-install-packs
Upload packs to Core server from url or the marketplace.
Base Command
core-api-install-packs
Input
| Argument Name | Description | Required |
|---|---|---|
| packs_to_install | The packs to install in JSON format (e.g. [{“AutoFocus”: “2.0.8”}] ). | Optional |
| file_url | The pack zip file url. | Optional |
| entry_id | The War Room entry ID of the pack zip file. | Optional |
| skip_verify | If true will skip pack signature validation, Available from 6.5.0 server version. | Optional |
| skip_validation | If true will skip all pack validations, Available from 6.6.0 server version. | Optional |
| timeout_in_seconds | The request timeout in seconds. Default value is 180 (3 minutes). | Optional |
Context Output
There is no context output for this command.
Command Example
!core-api-install-packs packs_to_install=[{"AutoFocus": "2.0.8"}]
Human Readable Output
The following packs installed successfully: AutoFocus
core-api-file-upload
Upload to the incident a file that the user provided according to the entry_id or the content of the file.
Base Command
core-api-file-upload
Input
| Argument Name | Description | Required |
|---|---|---|
| incident_id | The incident’s ID. | Required |
| file_name | The new file’s name. | Optional |
| file_content | The new file’s content. | Optional |
| entry_id | The War Room entry ID of the pack zip file. | Optional |
Context Output
There is no context output for this command.
core-api-file-delete
Delete a war room (investigation) file entry.
Base Command
core-api-file-delete
Input
| Argument Name | Description | Required |
|---|---|---|
| entry_id | The War Room entry ID of the file. | Required |
Context Output
There is no context output for this command.
core-api-file-attachment-delete
Delete a file attachment from an incident — specifically from the incident’s file attachments (not from the war room).
Base Command
core-api-file-attachment-delete
Input
| Argument Name | Description | Required |
|---|---|---|
| incident_id | The incident’s ID. | Required |
| file_path | The file’s path. | Required |
| field_name | Name of the field (type attachment) from which to remove the attachment. Default is attachment. | Optional |
Command example
!core-api-file-attachment-delete file_path=1@1 incident_id=1
Human Readable Output
Attachment 1@1 deleted.
core-api-file-check
Check if the file exists in Cortex XSOAR (Context) by entry_id.
Base Command
core-api-file-check
Input
| Argument Name | Description | Required |
|---|---|---|
| entry_id | The War Room entry ID of the file. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| IsFileExists | unknown | Dictionary with EntryID as the key and boolean if the file exists as a value. |
Configuration parameters
url— Core Server URL (required)creds_apikey— API Key IDauth_method— Authentication methodmarketplace_url— Base marketplace urlinsecure— Trust any certificate (not secure)proxy— Use system proxy settingsuse_tenant— Use tenant
Commands (20)
-
core-api-deletesend HTTP DELETE request.
-
core-api-downloadDownload files from Core server.
-
core-api-file-attachment-deleteDelete a file attachment from an incident — specifically from the incident’s file attachments.
-
core-api-file-checkCheck if the file exists in Cortex XSOAR (Context) by entry_id.
-
core-api-file-deleteDelete a war room (investigation) file entry.
-
core-api-file-uploadUpload to the incident a file that the user provided according to the entry_id or the content of the file.
-
core-api-getsend HTTP GET requests.
-
core-api-install-packsUpload packs to the core server from the URL or marketplace.
-
core-api-multipartSend HTTP Multipart request to upload files to Core server.
-
core-api-postsend HTTP POST request.
-
core-api-putsend HTTP PUT request.
-
core-delete-incidentsDelete Core incidents.
-
demisto-api-deleteDeprecatedDeprecated. Use core-api-delete instead.
-
demisto-api-downloadDeprecatedDeprecated. Use core-api-download instead.
-
demisto-api-getDeprecatedDeprecated. Use core-api-get instead.
-
demisto-api-install-packsDeprecatedDeprecated. Use core-api-install-packs instead.
-
demisto-api-multipartDeprecatedDeprecated. Use core-api-multipart instead.
-
demisto-api-postDeprecatedDeprecated. Use core-api-post instead.
-
demisto-api-putDeprecatedDeprecated. Use core-api-put instead.
-
demisto-delete-incidentsDeprecatedDeprecated. Use core-delete-incidents instead.
### Generate an API Key and API Key ID <~XSIAM> 1. Go to Settings -> Configurations -> API Keys. 2. Click the **+New Key** button in the top right corner. 3. Generate a key of type **Advanced**. 4. Copy and paste the key. 5. From the ID column, copy the Key ID. </~XSIAM> <~XSOAR_SAAS> 1. Go to Settings -> API Keys. 2. Click the **+New Key** button in the top right corner. 3. Generate a key of type **Advanced**. 4. Copy and paste the key. 5. From the ID column, copy the Key ID. </~XSOAR_SAAS> <~XSOAR_ON_PREM> 1. Go to Settings -> Integrations -> API Keys. 2. Click the **Get your key** button in the top left corner. 3. Generate a key. 4. Copy and paste the key. </~XSOAR_ON_PREM> ### URL <~XSIAM> 1. Go to **Settings** -> API Keys. 2. Click the **Copy URL** button in the top right corner. </~XSIAM> <~XSOAR_SAAS> 1. Go to **Settings & Info** > **Settings** > **Integrations** > **API Keys**. 2. Click the **Copy URL** button in the top right corner. </~XSOAR_SAAS> <~XSOAR_ON_PREM> Enter the server URL. </~XSOAR_ON_PREM> ### NOTES: <~XSOAR_ON_PREM> You do not need to provide an API Key ID. </~XSOAR_ON_PREM> <~XSOAR_SAAS> Make sure your API key has the proper permissions. For more information, please refer to the [Roles Management](https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/8/Cortex-XSOAR-Cloud-Documentation/Roles-management) documentation. </~XSOAR_SAAS> <~XSIAM> Make sure your API key has the proper permissions. For more information, please refer to the [Roles Management](https://docs-cortex.paloaltonetworks.com/r/Cortex-XSIAM/Cortex-XSIAM-Administrator-Guide/Manage-Roles) documentation. </~XSIAM>