---
title: Get available fields for usage summary
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Usage Metering
---

# Get available fields for usage summary{% #get-available-fields-for-usage-summary %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                                            |
| ----------------- | ----------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/usage/summary/available_fields |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/usage/summary/available_fields |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/usage/summary/available_fields      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/usage/summary/available_fields      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/usage/summary/available_fields  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/usage/summary/available_fields     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/usage/summary/available_fields |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/usage/summary/available_fields |

### Overview



List the field names returned by `GET /api/v1/usage/summary` at each of its three response levels. Each list contains every key the data endpoint emits—both typed fields declared in the OpenAPI spec and untyped keys exposed through `additionalProperties` (the latter used for billing dimensions and usage types added after the v1 schema freeze).

This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization.md).

Go example:

```go
fields, _, err := api.GetUsageSummaryAvailableFields(ctx)
attr := fields.Data.GetAttributes()

// resp is the *UsageSummaryResponse returned by api.GetUsageSummary(ctx, ...)
// Layer 1: UsageSummaryResponse
for _, key := range attr.GetResponseFields() {
    if val, ok := resp.AdditionalProperties[key]; ok {
        fmt.Println(key, val.(json.Number))
    }
}
// Layer 2: UsageSummaryDate (per month)
for _, date := range resp.GetUsage() {
    for _, key := range attr.GetDateFields() {
        if val, ok := date.AdditionalProperties[key]; ok {
            fmt.Println(key, val.(json.Number))
        }
    }
    // Layer 3: UsageSummaryDateOrg (per org per month)
    for _, org := range date.GetOrgs() {
        for _, key := range attr.GetDateOrgFields() {
            if val, ok := org.AdditionalProperties[key]; ok {
                fmt.Println(key, val.(json.Number))
            }
        }
    }
}
```
This endpoint requires the `usage_read` permission.
OAuth apps require the `usage_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#usage-metering) to access this endpoint.



### Response

{% tab title="200" %}
OK.
{% tab title="Model" %}
Response listing every field name returned by `GET /api/v1/usage/summary` at each of its three response levels. Includes both typed fields and untyped `additionalProperties` keys.

| Parent field | Field           | Type     | Description                                                                                                                                                                                                                                                         |
| ------------ | --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data            | object   | Available-fields data.                                                                                                                                                                                                                                              |
| data         | attributes      | object   | The lists of field names returned by `GET /api/v1/usage/summary` at each of its three response levels. Each list contains every key the data endpoint emits—both typed fields declared in the OpenAPI spec and untyped keys exposed through `additionalProperties`. |
| attributes   | date_fields     | [string] | Sorted list of every key returned inside each `UsageSummaryDate` entry of `usage[]` (typed fields and `additionalProperties` keys combined).                                                                                                                        |
| attributes   | date_org_fields | [string] | Sorted list of every key returned inside each `UsageSummaryDateOrg` entry of `usage[].orgs[]` (typed fields and `additionalProperties` keys combined).                                                                                                              |
| attributes   | response_fields | [string] | Sorted list of every key returned as a direct property of `UsageSummaryResponse` (typed fields and `additionalProperties` keys combined).                                                                                                                           |
| data         | id              | string   | The identifier for the discovery scope. Always `"all"`.                                                                                                                                                                                                             |
| data         | type            | enum     | Type of available-fields data. Allowed enum values: `usage_summary_available_fields`                                                                                                                                                                                |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "date_fields": [],
      "date_org_fields": [],
      "response_fields": []
    },
    "id": "all",
    "type": "string"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden - User is not authorized.
{% 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

##### 
                  \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/usage/summary/available_fields" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
{% /tab %}
