Get Business Units

Cortex Xpanse REST API

post /public_api/v1/assets/get_business_units

Fetches business unit information for all or a subset of the business units in your Cortex Xpanse tenant. The results are sorted by business_unit_name.

Request headers
authorization
String
required
api-key
Example: {{api_key}}
x-xdr-auth-id
String
required
api-key-id
Example: {{api_key_id}}
Body parameters
request_dataObject

A dictionary containing the API request fields. An empty dictionary returns all results.

filtersArray

An array of filter fields.

[
fieldObject (Enum)

Identifies the business unit field the filter is matching.

Allowed values:"business_unit_id""business_unit_name""parent_id"
operatorObject (Enum)

Identifies the comparison operator you want to use for this filter. All operators listed can be used with all filter fields.

Allowed values:"contains""eq""in""neq""not_contains"
valueString

Value depends on the filter field used. - business_unit_id: string - business_unit_name: string - parent_id: string

]
use_page_tokenBoolean

Use "use_page_token":true in the initial request to paginate the response data.

next_page_tokenString

If "use_page_token":true was included in the initial request, the response for that request will include a page token.
Use "next_page_token":"string" to pass that page token into the next request to paginate the next set of data.'

REQUEST BODY
{ "request_data": { "filters": [ { "field": "business_unit_id", "operator": "contains", "value": "string" } ], "use_page_token": true, "next_page_token": "string" } }
CURL
curl -X 'POST'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-H 'authorization: {{api_key}}' -H 'x-xdr-auth-id: {{api_key_id}}'
'https://api-}/public_api/v1/assets/get_business_units'
-d ''
Responses

OK

Body
replyObject
total_countInteger
result_countInteger
business_unitsArray
[
business_unit_idString
business_unit_nameString
parent_idString
]
RESPONSE
{ "reply": { "total_count": 0, "result_count": 0, "business_units": [ { "business_unit_id": "string", "business_unit_name": "string", "parent_id": "string" } ] } }

Bad Request. Got an invalid JSON.

Unauthorized access. An issue occurred during authentication. This can indicate an incorrect key, id, or other invalid authentication parameters.

Body
replyObject

The query results upon error.

Free-Form object
RESPONSE
{ "reply": {} }

Unauthorized access. User does not have the required license type to run this API.

Body
replyObject

The query results upon error.

Free-Form object
RESPONSE
{ "reply": {} }

Forbidden access. The provided API Key does not have the required RBAC permissions to run this API.

Body
replyObject

The query results upon error.

Free-Form object
RESPONSE
{ "reply": {} }

Unprocessable Entity

Body
codeInteger

Error code

statusString

Error name

messageString

Error message

errorsObject

Errors

RESPONSE
{ "code": 0, "status": "status_example", "message": "message_example", "errors": {} }

Internal server error. A unified status for API communication type errors.

Body
replyObject

The query results upon error.

Free-Form object
RESPONSE
{ "reply": {} }