> 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/xdr-5-api/cloud-onboarding/cloud-account-management.md).

# Cloud Account Management

The cloud account APIs allow you to manage accounts within a specific cloud instance. You can have multiple cloud accounts within one cloud instance. Use these APIs to get the cloud accounts in the specified cloud instance and to enable or disable cloud accounts.

## Get accounts in the specified cloud instances

> List accounts and their details for the specified cloud instance.\
> \
> \*\*Required license:\*\* Cortex Cloud Posture Management

```json
{"openapi":"3.0.0","info":{"title":"Cloud Onboarding APIs","version":"Cortex XDR 5.x"},"tags":[{"name":"Cloud account management","description":"The cloud account APIs allow you to manage accounts within a specific cloud instance. You can have multiple cloud accounts within one cloud instance. Use these APIs to get the cloud accounts in the specified cloud instance and to enable or disable cloud accounts."}],"servers":[{"url":"https://api-yourfqdn","description":""}],"paths":{"/public_api/v1/cloud_onboarding/get_accounts":{"post":{"summary":"Get accounts in the specified cloud instances","operationId":"postGetAccounts","description":"List accounts and their details for the specified cloud instance.\n\n**Required license:** Cortex Cloud Posture Management","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":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAccountsRequestData"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAccountsResponse"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"500":{"$ref":"#/components/responses/InternalServerError"}},"tags":["Cloud account management"]}}},"components":{"schemas":{"GetAccountsRequestData":{"type":"object","properties":{"request_data":{"type":"object","required":["instance_id"],"description":"Valid values for the filter field `SEARCH_FIELD` include:\n\n- `STATUS`\n- `ACCOUNT_NAME`\n- `CLOUD_ACCOUNT_ID`\n- `ENVIRONMENT`\n- `TYPE`\n- `CREATED_AT`","properties":{"instance_id":{"type":"string","description":"The ID of the cloud instance for which to list accounts. To obtain instance IDs, use [Get Instances](https://app.gitbook.com/s/FK89utN7l3ilSek2DmU5/cloud-onboarding/cloud-instance-management#post-public_api-v1-cloud_onboarding-get_instances)."},"filter_data":{"$ref":"#/components/schemas/FilterData"}}}}},"FilterData":{"type":"object","properties":{"sort":{"type":"array","description":"Sorting criteria for the results","items":{"$ref":"#/components/schemas/SortCriteria"}},"paging":{"$ref":"#/components/schemas/Paging"},"filter":{"description":"Filter criteria for the results.","oneOf":[{"$ref":"#/components/schemas/AndPredicate"},{"$ref":"#/components/schemas/OrPredicate"},{"type":"object"}]}}},"SortCriteria":{"type":"object","properties":{"FIELD":{"type":"string","description":"The field to sort by."},"ORDER":{"type":"string","enum":["ASC","DESC"],"description":"Whether to sort in ascending (`ASC`) order or descending (`DESC`) order."}}},"Paging":{"type":"object","properties":{"from":{"type":"integer","description":"The starting index for pagination.","minimum":0},"to":{"type":"integer","description":"The ending index for pagination.","minimum":1}}},"AndPredicate":{"type":"object","properties":{"AND":{"type":"array","description":"A list of filter criteria to be combined with AND logic","items":{"$ref":"#/components/schemas/FilterCriteria"}}}},"FilterCriteria":{"type":"object","properties":{"SEARCH_FIELD":{"type":"string","description":"Specifies the field to filter by. "},"SEARCH_TYPE":{"type":"string","description":"Comparison operator to use with the filter."},"SEARCH_VALUE":{"description":"The value to filter by.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}},"OrPredicate":{"type":"object","properties":{"OR":{"type":"array","description":"A list of filter criteria to be combined with OR logic","items":{"$ref":"#/components/schemas/FilterCriteria"}}}},"GetAccountsResponse":{"type":"object","properties":{"reply":{"type":"object","properties":{"DATA":{"type":"array","items":{"$ref":"#/components/schemas/AccountItem"}},"FILTER_COUNT":{"type":"integer"},"TOTAL_COUNT":{"type":"integer"}}}}},"AccountItem":{"type":"object","description":"A single cloud account in the list response.","properties":{"account_name":{"type":"string"},"cloud_account_id":{"type":"string","description":"The cloud service provider account identifier"},"account_type":{"type":"string","description":"Type of the account","enum":["ACCOUNT","ORGANIZATION","MANAGEMENT_GROUP","TENANT","WORKSPACE_DOMAIN","PROJECT","ORGANIZATIONAL_UNIT"]},"status":{"type":"string","enum":["ENABLED","DISABLED","DELETED"]},"environment":{"type":"string","enum":["NONE","DEVELOPMENT","STAGING","TESTING","PRODUCTION"]},"created_at":{"type":"integer","format":"int64","description":"Account creation timestamp"}}},"BaseError":{"type":"object","properties":{"reply":{"type":"object","properties":{"err_code":{"type":"string","description":"Error code"},"err_msg":{"type":"string","description":"Error message"},"err_extra":{"type":"string","description":"Extra information about the error"}}}}}},"responses":{"ValidationError":{"description":"Invalid Client Request Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"InternalServerError":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}}}}}
```

## Enable or disable cloud accounts

> Enable or disable the specified cloud accounts within a specific cloud instance.\
> \
> \*\*Required license:\*\* Cortex Cloud Posture Management

```json
{"openapi":"3.0.0","info":{"title":"Cloud Onboarding APIs","version":"Cortex XDR 5.x"},"tags":[{"name":"Cloud account management","description":"The cloud account APIs allow you to manage accounts within a specific cloud instance. You can have multiple cloud accounts within one cloud instance. Use these APIs to get the cloud accounts in the specified cloud instance and to enable or disable cloud accounts."}],"servers":[{"url":"https://api-yourfqdn","description":""}],"paths":{"/public_api/v1/cloud_onboarding/enable_disable_account":{"post":{"summary":"Enable or disable cloud accounts","operationId":"postEnableDisableAccount","description":"Enable or disable the specified cloud accounts within a specific cloud instance.\n\n**Required license:** Cortex Cloud Posture Management","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":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnableDisableAccountRequestData"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnableDisableAccountResponse"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"500":{"$ref":"#/components/responses/InternalServerError"}},"tags":["Cloud account management"]}}},"components":{"schemas":{"EnableDisableAccountRequestData":{"type":"object","properties":{"request_data":{"type":"object","required":["ids","instance_id","enable"],"properties":{"ids":{"type":"array","description":"List of account IDs to enable or disable.","items":{"type":"string"}},"instance_id":{"type":"string","description":"The cloud instance ID where the cloud accounts should be disabled."},"enable":{"type":"boolean","description":"Whether to enable (`true`) or disable (`false`) to specified accounts."}}}}},"EnableDisableAccountResponse":{"type":"object","properties":{"reply":{"type":"object"}}},"BaseError":{"type":"object","properties":{"reply":{"type":"object","properties":{"err_code":{"type":"string","description":"Error code"},"err_msg":{"type":"string","description":"Error message"},"err_extra":{"type":"string","description":"Extra information about the error"}}}}}},"responses":{"ValidationError":{"description":"Invalid Client Request Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"InternalServerError":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}}}}}
```


---

# 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/xdr-5-api/cloud-onboarding/cloud-account-management.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.
