---
title: "Get available fields for usage summary"
method: GET
path: "/api/v2/usage/summary/available_fields"
tags: ["Usage Metering"]
---

# Get available fields for usage summary

`GET /api/v2/usage/summary/available_fields`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/usage/summary/available_fields`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `usage_read`

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/).

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))
            }
        }
    }
}
```

## Response `200`

OK.

- UsageSummaryAvailableFieldsResponse: 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.
  - `data` UsageSummaryAvailableFieldsBody: Available-fields data.
    - `attributes` UsageSummaryAvailableFieldsAttributes: 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`.
      - `date_fields` string[]: Sorted list of every key returned inside each `UsageSummaryDate` entry of `usage[]` (typed fields and `additionalProperties` keys combined).
      - `date_org_fields` string[]: Sorted list of every key returned inside each `UsageSummaryDateOrg` entry of `usage[].orgs[]` (typed fields and `additionalProperties` keys combined).
      - `response_fields` string[]: Sorted list of every key returned as a direct property of `UsageSummaryResponse` (typed fields and `additionalProperties` keys combined).
    - `id` string: The identifier for the discovery scope. Always `"all"`.
    - `type` 'usage_summary_available_fields': Type of available-fields data.

## Other responses

- `403`: Forbidden - User is not authorized.
- `429`: Too many requests.

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
