---
title: Get account filters
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Cloud Cost Management
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Get account filters{% #get-account-filters %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                                                     |
| ----------------- | -------------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/cost/account_filters/{cloud_account_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/cost/account_filters/{cloud_account_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/cost/account_filters/{cloud_account_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/cost/account_filters/{cloud_account_id}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/cost/account_filters/{cloud_account_id}  |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/cost/account_filters/{cloud_account_id} |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/cost/account_filters/{cloud_account_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/cost/account_filters/{cloud_account_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/cost/account_filters/{cloud_account_id} |

### Overview

Get the account filters for a cloud account (AWS CUR 1.0/2.0, OCI, and other clouds). This endpoint requires the `cloud_cost_management_read` permission.

OAuth apps require the `cloud_cost_management_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#cloud-cost-management) to access this endpoint.



### Arguments

#### Path Parameters

| Name                               | Type    | Description       |
| ---------------------------------- | ------- | ----------------- |
| cloud_account_id [*required*] | integer | Cloud Account id. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing the account filters for a cloud account.

| Parent field    | Field                        | Type     | Description                                                                                                             |
| --------------- | ---------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------- |
|                 | data                         | object   | The account filters for a cloud account.                                                                                |
| data            | attributes [*required*] | object   | Attributes for the account filters of a cloud account.                                                                  |
| attributes      | account_filters              | object   | The account filtering configuration.                                                                                    |
| account_filters | excluded_accounts            | [string] | The AWS account IDs to be excluded from your billing dataset. This field is used when `include_new_accounts` is `true`. |
| account_filters | include_new_accounts         | boolean  | Whether or not to automatically include new member accounts by default in your billing dataset.                         |
| account_filters | included_accounts            | [string] | The AWS account IDs to be included in your billing dataset. This field is used when `include_new_accounts` is `false`.  |
| attributes      | account_id                   | string   | The cloud account ID.                                                                                                   |
| attributes      | cloud                        | string   | The cloud provider of the account, for example `aws`, `aws_cur2`, or `oci`.                                             |
| data            | id                           | string   | The ID of the cloud account.                                                                                            |
| data            | type [*required*]       | enum     | Type of account filters. Allowed enum values: `account_filters`                                                         |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "account_filters": {
        "excluded_accounts": [
          "123456789123",
          "123456789143"
        ],
        "include_new_accounts": true,
        "included_accounts": [
          "123456789123",
          "123456789143"
        ]
      },
      "account_id": "123456789123",
      "cloud": "aws_cur2"
    },
    "id": "123456789123",
    "type": "account_filters"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Path parameters export cloud_account_id="CHANGE_ME" \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/cost/account_filters/${cloud_account_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
{% /tab %}
