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

# Widgets

APIs for managing widgets

## Reset ROI widget

> Reset ROI widget

```json
{"openapi":"3.0.1","info":{"title":"Cortex XSOAR 6 API","version":"6"},"tags":[{"name":"Widgets","description":"APIs for managing widgets"}],"servers":[{"url":"https://hostname"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header"}}},"paths":{"/statistics/application/roi":{"delete":{"summary":"Reset ROI widget","description":"Reset ROI widget","operationId":"resetROIWidget","responses":{"200":{"description":"ROI widget has been reset"}},"tags":["Widgets"]}}}}
```

## \[Deprecated] Get Widget Statistics

> Get a given widget object statistics result.\
> Note: This route has many return types based on the widget type and data. Each 200X represent a 200 OK request of specific widget type and data\
> \
> Deprecated - use "/v2/statistics/widgets/query

```json
{"openapi":"3.0.1","info":{"title":"Cortex XSOAR 6 API","version":"6"},"tags":[{"name":"Widgets","description":"APIs for managing widgets"}],"servers":[{"url":"https://hostname"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header"}}},"paths":{"/statistics/widgets/query":{"post":{"summary":"[Deprecated] Get Widget Statistics","description":"Get a given widget object statistics result.\nNote: This route has many return types based on the widget type and data. Each 200X represent a 200 OK request of specific widget type and data\n\nDeprecated - use \"/v2/statistics/widgets/query","operationId":"GetStatsForWidgetOldFormat","responses":{"200":{"description":"Response differ according to the widget type\n  -  Incident data type of a \"table\" or \"list\" widget returns incidentSearchResponse\n     total:\n       type: integer\n       data:\n         type: array\n      items:\n        \"$ref\": \"#/definitions/Incident\"\n    - Indicators data type of a \"table\" or \"list\" widget returns IoCsResponse\n      total:\n        type: integer\n      data:\n        type: array\n        items:\n          \"$ref\": \"#/definitions/IocObject\"\n    - Number widget returns a simple number\n      type: integer\n    - Trend widget returns a trend object\n      \"$ref\": \"#/definitions/StatsTrendsResponse\"\n    - Text widget returns a text object, describing the final text and the placeholders values.\n      \"$ref\": \"#/definitions/StatsTextResponse\"\n    - A chart data array by groups. When requesting a date, the key is the date string, according to the specified time frame. Empty groups (dates) are also returned.\n      type: array\n      items:\n        \"$ref\": \"#/definitions/Group\"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Widgets"]}}}}
```

## Get Widget Statistics

> Get the statistics for the specified widget.\
> \*\*Note:\*\* This endpoint has many return types depending on the widget type and data. Each 200X represents a 200 OK request of specific widget type and data.

```json
{"openapi":"3.0.1","info":{"title":"Cortex XSOAR 6 API","version":"6"},"tags":[{"name":"Widgets","description":"APIs for managing widgets"}],"servers":[{"url":"https://hostname"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header"}}},"paths":{"/v2/statistics/widgets/query":{"post":{"summary":"Get Widget Statistics","description":"Get the statistics for the specified widget.\n**Note:** This endpoint has many return types depending on the widget type and data. Each 200X represents a 200 OK request of specific widget type and data.","operationId":"GetStatsForWidget","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"dataType":{"type":"string"},"widgetType":{"type":"string"},"query":{"type":"string"},"dateRange":{"type":"object","properties":{"fromDate":{"type":"string"},"toDate":{"type":"string"}}},"params":{"type":"object","properties":{"groupBy":{"type":"array","items":{"type":"string"}}}},"category":{"type":"string"}}}},"application/xml":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"dataType":{"type":"string"},"widgetType":{"type":"string"},"query":{"type":"string"},"dateRange":{"type":"object","properties":{"fromDate":{"type":"string"},"toDate":{"type":"string"}}},"params":{"type":"object","properties":{"groupBy":{"type":"array","items":{"type":"string"}}}},"category":{"type":"string"}}}}}},"responses":{"200":{"description":"Response differ according to the widget type\n  -  Incident data type of a \"table\" or \"list\" widget returns incidentSearchResponse\n     total:\n       type: integer\n       data:\n         type: array\n      items:\n        \"$ref\": \"#/definitions/Incident\"\n    - Indicators data type of a \"table\" or \"list\" widget returns IoCsResponse\n      total:\n        type: integer\n      data:\n        type: array\n        items:\n          \"$ref\": \"#/definitions/IocObject\"\n    - Number widget returns a simple number\n      type: integer\n    - Trend widget returns a trend object\n      \"$ref\": \"#/definitions/StatsTrendsResponse\"\n    - Text widget returns a text object, describing the final text and the placeholders values.\n      \"$ref\": \"#/definitions/StatsTextResponse\"\n    - Line chart widget or Column chart widget returns StatsResponseWithReferenceLine\n      \"$ref\": \"#/definitions/StatsResponseWithReferenceLine\"\n    - A chart data array by groups. When requesting a date, the key is the date string, according to the specified time frame. Empty groups (dates) are also returned.\n      type: array\n      items:\n        \"$ref\": \"#/definitions/Group\"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Widgets"]}}}}
```

## GET /widgets

> Get all widgets

```json
{"openapi":"3.0.1","info":{"title":"Cortex XSOAR 6 API","version":"6"},"tags":[{"name":"Widgets","description":"APIs for managing widgets"}],"servers":[{"url":"https://hostname"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"Widget":{"type":"object","description":"Widget describe a widget component used to get statistics requests, based on parameters such as\ndataType and widgetType. A widget can be a part of widgets collection inside a dashboard.","properties":{"Cache":{"type":"object","description":"Cache of join functions","additionalProperties":{"type":"array","items":{"type":"string"}}},"accounts":{"type":"object","description":"Accounts list of accounts to query the widget data from","additionalProperties":{"type":"object"}},"cacheVersn":{"type":"integer","format":"int64"},"category":{"type":"string","description":"Category the widget is related to. Used to display in widget library under category or dataType if empty."},"commitMessage":{"type":"string"},"created":{"type":"string","format":"date-time"},"dataType":{"type":"string","description":"Data type of the widget. Describes what data does the widget query. supporting data types \"incidents\",\"messages\",\"system\",\"entries\",\"tasks\", \"audit\"."},"dateRange":{"$ref":"#/components/schemas/DateRange"},"definition":{"$ref":"#/components/schemas/GenericObjectDefinition"},"definitionId":{"type":"string"},"description":{"type":"string","description":"The description of the widget's usage and data representation."},"fromServerVersion":{"$ref":"#/components/schemas/Version"},"highlight":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"id":{"type":"string"},"ignoreWorkers":{"type":"boolean","description":"Do not use workers mechanism while searching bleve"},"indexName":{"type":"string"},"isPredefined":{"type":"boolean","description":"Is the widget a system widget."},"itemVersion":{"$ref":"#/components/schemas/Version"},"locked":{"type":"boolean","description":"Is the widget locked for editing."},"modified":{"type":"string","format":"date-time"},"name":{"type":"string","description":"Default name of the widget."},"numericId":{"type":"integer","format":"int64"},"packID":{"type":"string"},"packName":{"type":"string"},"packPropagationLabels":{"type":"array","items":{"type":"string"}},"page":{"type":"integer","description":"0-based page","format":"int64"},"params":{"type":"object","description":"Additional parameters for this widget, depends on widget type and data.","additionalProperties":{"type":"object"}},"prevName":{"type":"string","description":"The previous name of the widget."},"primaryTerm":{"type":"integer","format":"int64"},"propagationLabels":{"type":"array","items":{"type":"string"}},"query":{"type":"string","description":"Query to search on the dataType."},"remote":{"type":"boolean"},"searchAfter":{"type":"array","description":"Efficient next page, pass max sort value from previous page","items":{"type":"string"}},"searchAfterElastic":{"type":"array","description":"Efficient next page, pass max ES sort value from previous page","items":{"type":"string"}},"searchAfterMap":{"type":"object","description":"Map accounts search after values - stores next page sort values per account.\nThere is no need to store searchBeforeMap as [current page searchBefore] equals to [prev page searchAfter]\nMore, there is no way to generate correct searchBefore from current page as some tenants may not appear at all.\nThe map is relevant in proxy mode and used by tenants, each tenant extracts the searchAfter keys from the map.","additionalProperties":{"type":"array","items":{"type":"string"}}},"searchAfterMapOrder":{"type":"object","additionalProperties":{"type":"integer","format":"int64"}},"searchBefore":{"type":"array","description":"Efficient prev page, pass min sort value from next page","items":{"type":"string"}},"searchBeforeElastic":{"type":"array","description":"Efficient prev page, pass min ES sort value from next page","items":{"type":"string"}},"sequenceNumber":{"type":"integer","format":"int64"},"shouldCommit":{"type":"boolean"},"size":{"type":"integer","description":"Size is limited to 1000, if not passed it defaults to 0, and no results will return","format":"int64"},"sizeInBytes":{"type":"integer","format":"int64"},"skipAggregateAccounts":{"type":"boolean","description":"SkipAggregateAccounts flag that indicates whether to skip aggregate accounts results"},"sort":{"type":"array","description":"The sort order","items":{"$ref":"#/components/schemas/Order"}},"sortValues":{"type":"array","items":{"type":"string"}},"syncHash":{"type":"string"},"toServerVersion":{"$ref":"#/components/schemas/Version"},"vcShouldIgnore":{"type":"boolean"},"vcShouldKeepItemLegacyProdMachine":{"type":"boolean"},"version":{"type":"integer","format":"int64"},"widgetType":{"type":"string","description":"Widget type describes how does the widget should recieve the data, and display it. Supporting types: \"bar\", \"column\", \"pie\", \"list\", \"number\", \"trend\", \"text\", \"duration\", \"image\", \"line\", and \"table\"."}},"required":["name","widgetType"]},"DateRange":{"type":"object","description":"DateRange provides common fields for date filtering","properties":{"fromDate":{"type":"string","format":"date-time"},"fromDateLicense":{"type":"string","format":"date-time"},"period":{"$ref":"#/components/schemas/Period"},"toDate":{"type":"string","format":"date-time"}}},"Period":{"type":"object","title":"Period holds the 'Period' query, such as last 3 days, last 6 hours, between 6 days from now until 3 days from now.","properties":{"by":{"type":"string","description":"By is used for legacty, and if exists it will override ByTo and ByFrom"},"byFrom":{"type":"string"},"byTo":{"type":"string"},"field":{"type":"string"},"fromValue":{"type":"string","format":"duration"},"toValue":{"type":"string","format":"duration"}}},"GenericObjectDefinition":{"type":"object","title":"GenericObjectDefinition ...","properties":{"auditable":{"type":"boolean"},"cacheVersn":{"type":"integer","format":"int64"},"commitMessage":{"type":"string"},"created":{"type":"string","format":"date-time"},"definitionId":{"type":"string"},"fromServerVersion":{"$ref":"#/components/schemas/Version"},"highlight":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"id":{"type":"string"},"indexName":{"type":"string"},"itemVersion":{"$ref":"#/components/schemas/Version"},"locked":{"type":"boolean"},"modified":{"type":"string","format":"date-time"},"name":{"type":"string"},"numericId":{"type":"integer","format":"int64"},"packID":{"type":"string"},"packName":{"type":"string"},"packPropagationLabels":{"type":"array","items":{"type":"string"}},"partitioned":{"type":"boolean"},"pluralName":{"type":"string"},"prevName":{"type":"string"},"primaryTerm":{"type":"integer","format":"int64"},"propagationLabels":{"type":"array","items":{"type":"string"}},"rbacSupport":{"type":"boolean"},"remote":{"type":"boolean"},"sequenceNumber":{"type":"integer","format":"int64"},"shouldCommit":{"type":"boolean"},"sizeInBytes":{"type":"integer","format":"int64"},"sortValues":{"type":"array","items":{"type":"string"}},"syncHash":{"type":"string"},"system":{"type":"boolean"},"toServerVersion":{"$ref":"#/components/schemas/Version"},"vcShouldIgnore":{"type":"boolean"},"vcShouldKeepItemLegacyProdMachine":{"type":"boolean"},"version":{"type":"integer","format":"int64"}}},"Version":{"type":"object","title":"Version represents a version.","properties":{"Digits":{"type":"array","description":"WARNING: when adding new attributes or changing the names\nof the existing ones, remember to add support in UnmarshalJSON\nfor items that were exported by msgpack.","items":{"type":"integer","format":"int64"}},"Label":{"type":"string"}}},"Order":{"type":"object","description":"Order struct holds a sort field and the direction of sorting","properties":{"asc":{"type":"boolean"},"field":{"type":"string"},"fieldType":{"type":"string"}}}}},"paths":{"/widgets":{"get":{"description":"Get all widgets","operationId":"getAllWidgets","responses":{"200":{"description":"Return all the widgets in the system.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Widget"}}}}}},"tags":["Widgets"]}}}}
```

## Add or update a widget

> Add or update a given widget based on Id.

```json
{"openapi":"3.0.1","info":{"title":"Cortex XSOAR 6 API","version":"6"},"tags":[{"name":"Widgets","description":"APIs for managing widgets"}],"servers":[{"url":"https://hostname"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"Widget":{"type":"object","description":"Widget describe a widget component used to get statistics requests, based on parameters such as\ndataType and widgetType. A widget can be a part of widgets collection inside a dashboard.","properties":{"Cache":{"type":"object","description":"Cache of join functions","additionalProperties":{"type":"array","items":{"type":"string"}}},"accounts":{"type":"object","description":"Accounts list of accounts to query the widget data from","additionalProperties":{"type":"object"}},"cacheVersn":{"type":"integer","format":"int64"},"category":{"type":"string","description":"Category the widget is related to. Used to display in widget library under category or dataType if empty."},"commitMessage":{"type":"string"},"created":{"type":"string","format":"date-time"},"dataType":{"type":"string","description":"Data type of the widget. Describes what data does the widget query. supporting data types \"incidents\",\"messages\",\"system\",\"entries\",\"tasks\", \"audit\"."},"dateRange":{"$ref":"#/components/schemas/DateRange"},"definition":{"$ref":"#/components/schemas/GenericObjectDefinition"},"definitionId":{"type":"string"},"description":{"type":"string","description":"The description of the widget's usage and data representation."},"fromServerVersion":{"$ref":"#/components/schemas/Version"},"highlight":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"id":{"type":"string"},"ignoreWorkers":{"type":"boolean","description":"Do not use workers mechanism while searching bleve"},"indexName":{"type":"string"},"isPredefined":{"type":"boolean","description":"Is the widget a system widget."},"itemVersion":{"$ref":"#/components/schemas/Version"},"locked":{"type":"boolean","description":"Is the widget locked for editing."},"modified":{"type":"string","format":"date-time"},"name":{"type":"string","description":"Default name of the widget."},"numericId":{"type":"integer","format":"int64"},"packID":{"type":"string"},"packName":{"type":"string"},"packPropagationLabels":{"type":"array","items":{"type":"string"}},"page":{"type":"integer","description":"0-based page","format":"int64"},"params":{"type":"object","description":"Additional parameters for this widget, depends on widget type and data.","additionalProperties":{"type":"object"}},"prevName":{"type":"string","description":"The previous name of the widget."},"primaryTerm":{"type":"integer","format":"int64"},"propagationLabels":{"type":"array","items":{"type":"string"}},"query":{"type":"string","description":"Query to search on the dataType."},"remote":{"type":"boolean"},"searchAfter":{"type":"array","description":"Efficient next page, pass max sort value from previous page","items":{"type":"string"}},"searchAfterElastic":{"type":"array","description":"Efficient next page, pass max ES sort value from previous page","items":{"type":"string"}},"searchAfterMap":{"type":"object","description":"Map accounts search after values - stores next page sort values per account.\nThere is no need to store searchBeforeMap as [current page searchBefore] equals to [prev page searchAfter]\nMore, there is no way to generate correct searchBefore from current page as some tenants may not appear at all.\nThe map is relevant in proxy mode and used by tenants, each tenant extracts the searchAfter keys from the map.","additionalProperties":{"type":"array","items":{"type":"string"}}},"searchAfterMapOrder":{"type":"object","additionalProperties":{"type":"integer","format":"int64"}},"searchBefore":{"type":"array","description":"Efficient prev page, pass min sort value from next page","items":{"type":"string"}},"searchBeforeElastic":{"type":"array","description":"Efficient prev page, pass min ES sort value from next page","items":{"type":"string"}},"sequenceNumber":{"type":"integer","format":"int64"},"shouldCommit":{"type":"boolean"},"size":{"type":"integer","description":"Size is limited to 1000, if not passed it defaults to 0, and no results will return","format":"int64"},"sizeInBytes":{"type":"integer","format":"int64"},"skipAggregateAccounts":{"type":"boolean","description":"SkipAggregateAccounts flag that indicates whether to skip aggregate accounts results"},"sort":{"type":"array","description":"The sort order","items":{"$ref":"#/components/schemas/Order"}},"sortValues":{"type":"array","items":{"type":"string"}},"syncHash":{"type":"string"},"toServerVersion":{"$ref":"#/components/schemas/Version"},"vcShouldIgnore":{"type":"boolean"},"vcShouldKeepItemLegacyProdMachine":{"type":"boolean"},"version":{"type":"integer","format":"int64"},"widgetType":{"type":"string","description":"Widget type describes how does the widget should recieve the data, and display it. Supporting types: \"bar\", \"column\", \"pie\", \"list\", \"number\", \"trend\", \"text\", \"duration\", \"image\", \"line\", and \"table\"."}},"required":["name","widgetType"]},"DateRange":{"type":"object","description":"DateRange provides common fields for date filtering","properties":{"fromDate":{"type":"string","format":"date-time"},"fromDateLicense":{"type":"string","format":"date-time"},"period":{"$ref":"#/components/schemas/Period"},"toDate":{"type":"string","format":"date-time"}}},"Period":{"type":"object","title":"Period holds the 'Period' query, such as last 3 days, last 6 hours, between 6 days from now until 3 days from now.","properties":{"by":{"type":"string","description":"By is used for legacty, and if exists it will override ByTo and ByFrom"},"byFrom":{"type":"string"},"byTo":{"type":"string"},"field":{"type":"string"},"fromValue":{"type":"string","format":"duration"},"toValue":{"type":"string","format":"duration"}}},"GenericObjectDefinition":{"type":"object","title":"GenericObjectDefinition ...","properties":{"auditable":{"type":"boolean"},"cacheVersn":{"type":"integer","format":"int64"},"commitMessage":{"type":"string"},"created":{"type":"string","format":"date-time"},"definitionId":{"type":"string"},"fromServerVersion":{"$ref":"#/components/schemas/Version"},"highlight":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"id":{"type":"string"},"indexName":{"type":"string"},"itemVersion":{"$ref":"#/components/schemas/Version"},"locked":{"type":"boolean"},"modified":{"type":"string","format":"date-time"},"name":{"type":"string"},"numericId":{"type":"integer","format":"int64"},"packID":{"type":"string"},"packName":{"type":"string"},"packPropagationLabels":{"type":"array","items":{"type":"string"}},"partitioned":{"type":"boolean"},"pluralName":{"type":"string"},"prevName":{"type":"string"},"primaryTerm":{"type":"integer","format":"int64"},"propagationLabels":{"type":"array","items":{"type":"string"}},"rbacSupport":{"type":"boolean"},"remote":{"type":"boolean"},"sequenceNumber":{"type":"integer","format":"int64"},"shouldCommit":{"type":"boolean"},"sizeInBytes":{"type":"integer","format":"int64"},"sortValues":{"type":"array","items":{"type":"string"}},"syncHash":{"type":"string"},"system":{"type":"boolean"},"toServerVersion":{"$ref":"#/components/schemas/Version"},"vcShouldIgnore":{"type":"boolean"},"vcShouldKeepItemLegacyProdMachine":{"type":"boolean"},"version":{"type":"integer","format":"int64"}}},"Version":{"type":"object","title":"Version represents a version.","properties":{"Digits":{"type":"array","description":"WARNING: when adding new attributes or changing the names\nof the existing ones, remember to add support in UnmarshalJSON\nfor items that were exported by msgpack.","items":{"type":"integer","format":"int64"}},"Label":{"type":"string"}}},"Order":{"type":"object","description":"Order struct holds a sort field and the direction of sorting","properties":{"asc":{"type":"boolean"},"field":{"type":"string"},"fieldType":{"type":"string"}}}}},"paths":{"/widgets":{"post":{"summary":"Add or update a widget","description":"Add or update a given widget based on Id.","operationId":"saveWidget","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Widget"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Widget"}}}},"responses":{"200":{"description":"The saved widget newest version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Widget"}}}}},"tags":["Widgets"]}}}}
```

## Import a widget

> Import a widget to the system, ignoring ID or version, used to import new widgets.

```json
{"openapi":"3.0.1","info":{"title":"Cortex XSOAR 6 API","version":"6"},"tags":[{"name":"Widgets","description":"APIs for managing widgets"}],"servers":[{"url":"https://hostname"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"Widget":{"type":"object","description":"Widget describe a widget component used to get statistics requests, based on parameters such as\ndataType and widgetType. A widget can be a part of widgets collection inside a dashboard.","properties":{"Cache":{"type":"object","description":"Cache of join functions","additionalProperties":{"type":"array","items":{"type":"string"}}},"accounts":{"type":"object","description":"Accounts list of accounts to query the widget data from","additionalProperties":{"type":"object"}},"cacheVersn":{"type":"integer","format":"int64"},"category":{"type":"string","description":"Category the widget is related to. Used to display in widget library under category or dataType if empty."},"commitMessage":{"type":"string"},"created":{"type":"string","format":"date-time"},"dataType":{"type":"string","description":"Data type of the widget. Describes what data does the widget query. supporting data types \"incidents\",\"messages\",\"system\",\"entries\",\"tasks\", \"audit\"."},"dateRange":{"$ref":"#/components/schemas/DateRange"},"definition":{"$ref":"#/components/schemas/GenericObjectDefinition"},"definitionId":{"type":"string"},"description":{"type":"string","description":"The description of the widget's usage and data representation."},"fromServerVersion":{"$ref":"#/components/schemas/Version"},"highlight":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"id":{"type":"string"},"ignoreWorkers":{"type":"boolean","description":"Do not use workers mechanism while searching bleve"},"indexName":{"type":"string"},"isPredefined":{"type":"boolean","description":"Is the widget a system widget."},"itemVersion":{"$ref":"#/components/schemas/Version"},"locked":{"type":"boolean","description":"Is the widget locked for editing."},"modified":{"type":"string","format":"date-time"},"name":{"type":"string","description":"Default name of the widget."},"numericId":{"type":"integer","format":"int64"},"packID":{"type":"string"},"packName":{"type":"string"},"packPropagationLabels":{"type":"array","items":{"type":"string"}},"page":{"type":"integer","description":"0-based page","format":"int64"},"params":{"type":"object","description":"Additional parameters for this widget, depends on widget type and data.","additionalProperties":{"type":"object"}},"prevName":{"type":"string","description":"The previous name of the widget."},"primaryTerm":{"type":"integer","format":"int64"},"propagationLabels":{"type":"array","items":{"type":"string"}},"query":{"type":"string","description":"Query to search on the dataType."},"remote":{"type":"boolean"},"searchAfter":{"type":"array","description":"Efficient next page, pass max sort value from previous page","items":{"type":"string"}},"searchAfterElastic":{"type":"array","description":"Efficient next page, pass max ES sort value from previous page","items":{"type":"string"}},"searchAfterMap":{"type":"object","description":"Map accounts search after values - stores next page sort values per account.\nThere is no need to store searchBeforeMap as [current page searchBefore] equals to [prev page searchAfter]\nMore, there is no way to generate correct searchBefore from current page as some tenants may not appear at all.\nThe map is relevant in proxy mode and used by tenants, each tenant extracts the searchAfter keys from the map.","additionalProperties":{"type":"array","items":{"type":"string"}}},"searchAfterMapOrder":{"type":"object","additionalProperties":{"type":"integer","format":"int64"}},"searchBefore":{"type":"array","description":"Efficient prev page, pass min sort value from next page","items":{"type":"string"}},"searchBeforeElastic":{"type":"array","description":"Efficient prev page, pass min ES sort value from next page","items":{"type":"string"}},"sequenceNumber":{"type":"integer","format":"int64"},"shouldCommit":{"type":"boolean"},"size":{"type":"integer","description":"Size is limited to 1000, if not passed it defaults to 0, and no results will return","format":"int64"},"sizeInBytes":{"type":"integer","format":"int64"},"skipAggregateAccounts":{"type":"boolean","description":"SkipAggregateAccounts flag that indicates whether to skip aggregate accounts results"},"sort":{"type":"array","description":"The sort order","items":{"$ref":"#/components/schemas/Order"}},"sortValues":{"type":"array","items":{"type":"string"}},"syncHash":{"type":"string"},"toServerVersion":{"$ref":"#/components/schemas/Version"},"vcShouldIgnore":{"type":"boolean"},"vcShouldKeepItemLegacyProdMachine":{"type":"boolean"},"version":{"type":"integer","format":"int64"},"widgetType":{"type":"string","description":"Widget type describes how does the widget should recieve the data, and display it. Supporting types: \"bar\", \"column\", \"pie\", \"list\", \"number\", \"trend\", \"text\", \"duration\", \"image\", \"line\", and \"table\"."}},"required":["name","widgetType"]},"DateRange":{"type":"object","description":"DateRange provides common fields for date filtering","properties":{"fromDate":{"type":"string","format":"date-time"},"fromDateLicense":{"type":"string","format":"date-time"},"period":{"$ref":"#/components/schemas/Period"},"toDate":{"type":"string","format":"date-time"}}},"Period":{"type":"object","title":"Period holds the 'Period' query, such as last 3 days, last 6 hours, between 6 days from now until 3 days from now.","properties":{"by":{"type":"string","description":"By is used for legacty, and if exists it will override ByTo and ByFrom"},"byFrom":{"type":"string"},"byTo":{"type":"string"},"field":{"type":"string"},"fromValue":{"type":"string","format":"duration"},"toValue":{"type":"string","format":"duration"}}},"GenericObjectDefinition":{"type":"object","title":"GenericObjectDefinition ...","properties":{"auditable":{"type":"boolean"},"cacheVersn":{"type":"integer","format":"int64"},"commitMessage":{"type":"string"},"created":{"type":"string","format":"date-time"},"definitionId":{"type":"string"},"fromServerVersion":{"$ref":"#/components/schemas/Version"},"highlight":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"id":{"type":"string"},"indexName":{"type":"string"},"itemVersion":{"$ref":"#/components/schemas/Version"},"locked":{"type":"boolean"},"modified":{"type":"string","format":"date-time"},"name":{"type":"string"},"numericId":{"type":"integer","format":"int64"},"packID":{"type":"string"},"packName":{"type":"string"},"packPropagationLabels":{"type":"array","items":{"type":"string"}},"partitioned":{"type":"boolean"},"pluralName":{"type":"string"},"prevName":{"type":"string"},"primaryTerm":{"type":"integer","format":"int64"},"propagationLabels":{"type":"array","items":{"type":"string"}},"rbacSupport":{"type":"boolean"},"remote":{"type":"boolean"},"sequenceNumber":{"type":"integer","format":"int64"},"shouldCommit":{"type":"boolean"},"sizeInBytes":{"type":"integer","format":"int64"},"sortValues":{"type":"array","items":{"type":"string"}},"syncHash":{"type":"string"},"system":{"type":"boolean"},"toServerVersion":{"$ref":"#/components/schemas/Version"},"vcShouldIgnore":{"type":"boolean"},"vcShouldKeepItemLegacyProdMachine":{"type":"boolean"},"version":{"type":"integer","format":"int64"}}},"Version":{"type":"object","title":"Version represents a version.","properties":{"Digits":{"type":"array","description":"WARNING: when adding new attributes or changing the names\nof the existing ones, remember to add support in UnmarshalJSON\nfor items that were exported by msgpack.","items":{"type":"integer","format":"int64"}},"Label":{"type":"string"}}},"Order":{"type":"object","description":"Order struct holds a sort field and the direction of sorting","properties":{"asc":{"type":"boolean"},"field":{"type":"string"},"fieldType":{"type":"string"}}}}},"paths":{"/widgets/import":{"post":{"summary":"Import a widget","description":"Import a widget to the system, ignoring ID or version, used to import new widgets.","operationId":"importWidget","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"description":"The JSON file of the widget to import.","type":"string"}}}}}},"responses":{"200":{"description":"The saved widget","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Widget"}}}}},"tags":["Widgets"]}}}}
```

## Get widget by ID

> Get a widget object by a given ID.

```json
{"openapi":"3.0.1","info":{"title":"Cortex XSOAR 6 API","version":"6"},"tags":[{"name":"Widgets","description":"APIs for managing widgets"}],"servers":[{"url":"https://hostname"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"Widget":{"type":"object","description":"Widget describe a widget component used to get statistics requests, based on parameters such as\ndataType and widgetType. A widget can be a part of widgets collection inside a dashboard.","properties":{"Cache":{"type":"object","description":"Cache of join functions","additionalProperties":{"type":"array","items":{"type":"string"}}},"accounts":{"type":"object","description":"Accounts list of accounts to query the widget data from","additionalProperties":{"type":"object"}},"cacheVersn":{"type":"integer","format":"int64"},"category":{"type":"string","description":"Category the widget is related to. Used to display in widget library under category or dataType if empty."},"commitMessage":{"type":"string"},"created":{"type":"string","format":"date-time"},"dataType":{"type":"string","description":"Data type of the widget. Describes what data does the widget query. supporting data types \"incidents\",\"messages\",\"system\",\"entries\",\"tasks\", \"audit\"."},"dateRange":{"$ref":"#/components/schemas/DateRange"},"definition":{"$ref":"#/components/schemas/GenericObjectDefinition"},"definitionId":{"type":"string"},"description":{"type":"string","description":"The description of the widget's usage and data representation."},"fromServerVersion":{"$ref":"#/components/schemas/Version"},"highlight":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"id":{"type":"string"},"ignoreWorkers":{"type":"boolean","description":"Do not use workers mechanism while searching bleve"},"indexName":{"type":"string"},"isPredefined":{"type":"boolean","description":"Is the widget a system widget."},"itemVersion":{"$ref":"#/components/schemas/Version"},"locked":{"type":"boolean","description":"Is the widget locked for editing."},"modified":{"type":"string","format":"date-time"},"name":{"type":"string","description":"Default name of the widget."},"numericId":{"type":"integer","format":"int64"},"packID":{"type":"string"},"packName":{"type":"string"},"packPropagationLabels":{"type":"array","items":{"type":"string"}},"page":{"type":"integer","description":"0-based page","format":"int64"},"params":{"type":"object","description":"Additional parameters for this widget, depends on widget type and data.","additionalProperties":{"type":"object"}},"prevName":{"type":"string","description":"The previous name of the widget."},"primaryTerm":{"type":"integer","format":"int64"},"propagationLabels":{"type":"array","items":{"type":"string"}},"query":{"type":"string","description":"Query to search on the dataType."},"remote":{"type":"boolean"},"searchAfter":{"type":"array","description":"Efficient next page, pass max sort value from previous page","items":{"type":"string"}},"searchAfterElastic":{"type":"array","description":"Efficient next page, pass max ES sort value from previous page","items":{"type":"string"}},"searchAfterMap":{"type":"object","description":"Map accounts search after values - stores next page sort values per account.\nThere is no need to store searchBeforeMap as [current page searchBefore] equals to [prev page searchAfter]\nMore, there is no way to generate correct searchBefore from current page as some tenants may not appear at all.\nThe map is relevant in proxy mode and used by tenants, each tenant extracts the searchAfter keys from the map.","additionalProperties":{"type":"array","items":{"type":"string"}}},"searchAfterMapOrder":{"type":"object","additionalProperties":{"type":"integer","format":"int64"}},"searchBefore":{"type":"array","description":"Efficient prev page, pass min sort value from next page","items":{"type":"string"}},"searchBeforeElastic":{"type":"array","description":"Efficient prev page, pass min ES sort value from next page","items":{"type":"string"}},"sequenceNumber":{"type":"integer","format":"int64"},"shouldCommit":{"type":"boolean"},"size":{"type":"integer","description":"Size is limited to 1000, if not passed it defaults to 0, and no results will return","format":"int64"},"sizeInBytes":{"type":"integer","format":"int64"},"skipAggregateAccounts":{"type":"boolean","description":"SkipAggregateAccounts flag that indicates whether to skip aggregate accounts results"},"sort":{"type":"array","description":"The sort order","items":{"$ref":"#/components/schemas/Order"}},"sortValues":{"type":"array","items":{"type":"string"}},"syncHash":{"type":"string"},"toServerVersion":{"$ref":"#/components/schemas/Version"},"vcShouldIgnore":{"type":"boolean"},"vcShouldKeepItemLegacyProdMachine":{"type":"boolean"},"version":{"type":"integer","format":"int64"},"widgetType":{"type":"string","description":"Widget type describes how does the widget should recieve the data, and display it. Supporting types: \"bar\", \"column\", \"pie\", \"list\", \"number\", \"trend\", \"text\", \"duration\", \"image\", \"line\", and \"table\"."}},"required":["name","widgetType"]},"DateRange":{"type":"object","description":"DateRange provides common fields for date filtering","properties":{"fromDate":{"type":"string","format":"date-time"},"fromDateLicense":{"type":"string","format":"date-time"},"period":{"$ref":"#/components/schemas/Period"},"toDate":{"type":"string","format":"date-time"}}},"Period":{"type":"object","title":"Period holds the 'Period' query, such as last 3 days, last 6 hours, between 6 days from now until 3 days from now.","properties":{"by":{"type":"string","description":"By is used for legacty, and if exists it will override ByTo and ByFrom"},"byFrom":{"type":"string"},"byTo":{"type":"string"},"field":{"type":"string"},"fromValue":{"type":"string","format":"duration"},"toValue":{"type":"string","format":"duration"}}},"GenericObjectDefinition":{"type":"object","title":"GenericObjectDefinition ...","properties":{"auditable":{"type":"boolean"},"cacheVersn":{"type":"integer","format":"int64"},"commitMessage":{"type":"string"},"created":{"type":"string","format":"date-time"},"definitionId":{"type":"string"},"fromServerVersion":{"$ref":"#/components/schemas/Version"},"highlight":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"id":{"type":"string"},"indexName":{"type":"string"},"itemVersion":{"$ref":"#/components/schemas/Version"},"locked":{"type":"boolean"},"modified":{"type":"string","format":"date-time"},"name":{"type":"string"},"numericId":{"type":"integer","format":"int64"},"packID":{"type":"string"},"packName":{"type":"string"},"packPropagationLabels":{"type":"array","items":{"type":"string"}},"partitioned":{"type":"boolean"},"pluralName":{"type":"string"},"prevName":{"type":"string"},"primaryTerm":{"type":"integer","format":"int64"},"propagationLabels":{"type":"array","items":{"type":"string"}},"rbacSupport":{"type":"boolean"},"remote":{"type":"boolean"},"sequenceNumber":{"type":"integer","format":"int64"},"shouldCommit":{"type":"boolean"},"sizeInBytes":{"type":"integer","format":"int64"},"sortValues":{"type":"array","items":{"type":"string"}},"syncHash":{"type":"string"},"system":{"type":"boolean"},"toServerVersion":{"$ref":"#/components/schemas/Version"},"vcShouldIgnore":{"type":"boolean"},"vcShouldKeepItemLegacyProdMachine":{"type":"boolean"},"version":{"type":"integer","format":"int64"}}},"Version":{"type":"object","title":"Version represents a version.","properties":{"Digits":{"type":"array","description":"WARNING: when adding new attributes or changing the names\nof the existing ones, remember to add support in UnmarshalJSON\nfor items that were exported by msgpack.","items":{"type":"integer","format":"int64"}},"Label":{"type":"string"}}},"Order":{"type":"object","description":"Order struct holds a sort field and the direction of sorting","properties":{"asc":{"type":"boolean"},"field":{"type":"string"},"fieldType":{"type":"string"}}}}},"paths":{"/widgets/{id}":{"get":{"summary":"Get widget by ID","description":"Get a widget object by a given ID.","operationId":"getWidget","parameters":[{"name":"id","in":"path","description":"The ID of widget to get.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return the widget if found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Widget"}}}}},"tags":["Widgets"]}}}}
```

## Remove existing widget

> Remove a given widget Id from the system.

```json
{"openapi":"3.0.1","info":{"title":"Cortex XSOAR 6 API","version":"6"},"tags":[{"name":"Widgets","description":"APIs for managing widgets"}],"servers":[{"url":"https://hostname"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header"}}},"paths":{"/widgets/{id}":{"delete":{"summary":"Remove existing widget","description":"Remove a given widget Id from the system.","operationId":"deleteWidget","parameters":[{"name":"id","in":"path","description":"Widget id to remove (returned from widget save or widgets get)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"widget deleted"}},"tags":["Widgets"]}}}}
```


---

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