---
updatedAt: 2026-07-22T12:59:29.000Z
agentTools:
  projectIndex: https://developer.doit.com/llms.txt
---

# Retrieve a dimension

Returns a dimension by type and key.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "DoiT Cloud Intelligence",
    "description": "Programmatic access to DoiT Platform",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.doit.com"
    }
  ],
  "security": [
    {
      "api_key": []
    },
    {
      "tenantId": [],
      "api_key": []
    }
  ],
  "tags": [
    {
      "name": "Dimensions",
      "description": "View available dimensions for analysis."
    }
  ],
  "paths": {
    "/analytics/v1/dimension": {
      "get": {
        "tags": [
          "Dimensions"
        ],
        "summary": "Retrieve a dimension",
        "description": "Returns a dimension by type and key.",
        "operationId": "getDimensions",
        "x-cli-name": "get-dimension",
        "x-cli-aliases": [
          "get-dimensions"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Dimension type",
            "required": true,
            "example": "fixed",
            "schema": {
              "$ref": "#/components/schemas/DimensionsTypes"
            }
          },
          {
            "name": "id",
            "in": "query",
            "description": "Dimension id",
            "required": true,
            "example": "service_description",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK - The dimension returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DimensionsExternalAPIGetResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DimensionsExternalAPIGetResponse": {
        "type": "object",
        "description": "Dimension metadata returned by the API.",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/DimensionsTypes"
          },
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalAPIGetValue"
            }
          }
        }
      },
      "DimensionsTypes": {
        "description": "Dimension filter type. Always pair `type` with `id` on scope filters. Discover valid `id` + `type` pairs for your account with `GET /analytics/v1/dimensions`. `allocation_rule` replaces `attribution`; `allocation` replaces `attribution_group`.",
        "type": "string",
        "enum": [
          "datetime",
          "fixed",
          "optional",
          "label",
          "tag",
          "project_label",
          "system_label",
          "attribution",
          "attribution_group",
          "allocation",
          "allocation_rule",
          "gke",
          "gke_label"
        ],
        "x-enumDescriptions": {
          "fixed": "Standard built-in billing dimensions (Service, Provider, Project/Account ID, SKU, Region, etc.).",
          "label": "Customer-defined resource labels; id is the label key, values are label values.",
          "tag": "AWS cost allocation tags; id is the tag key.",
          "project_label": "Google Cloud project-level labels; id is the label key.",
          "system_label": "DoiT- or provider-generated system labels; id is the system label key.",
          "optional": "Console grouping for label/tag keys; use label, tag, project_label, or system_label in API scopes.",
          "datetime": "Time dimensions (Year, Month, Day) for date-based filtering or grouping.",
          "allocation_rule": "Allocation rule filter; id must be allocation_rule, values are rule IDs.",
          "allocation": "Allocation group filter; id is the allocation group ID.",
          "gke": "Google Kubernetes Engine cost-allocation dimensions.",
          "gke_label": "GKE workload labels; id is the label key.",
          "attribution": "Deprecated. Use allocation_rule.",
          "attribution_group": "Deprecated. Use allocation."
        }
      },
      "Error": {
        "type": "object",
        "description": "Standard error response structure.",
        "properties": {
          "error": {
            "type": "string",
            "description": "Detailed error message."
          }
        }
      },
      "ExternalAPIGetValue": {
        "type": "object",
        "description": "Single value entry used by some dimension endpoints.",
        "properties": {
          "cloud": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "400": {
        "description": "Bad Request - The server cannot process the request, often due to a malformed request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "401": {
        "description": "Unauthorized - Invalid API key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "403": {
        "description": "Forbidden - The client is not authorized to perform the request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "404": {
        "description": "Not Found - The requested resource does not exist.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error - Something went wrong with the DoiT API server.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "Authorization",
        "description": "Use the \"Bearer <API_KEY>\" format or sign in for autofill",
        "in": "header"
      },
      "tenantId": {
        "type": "apiKey",
        "name": "X-Tenant-Id",
        "description": "Customer (tenant) ID for the request. Separate from your API token: always authenticate with `Authorization: Bearer <token>` (personal or service account). See [Get Started](https://developer.doit.com/docs/start). Omit when your token is scoped to a single customer (resolved automatically). A service account can select an active direct or nested descendant of its home customer; the endpoint's normal permissions, entitlements, and resource-ownership checks still apply. A service-account target outside that customer subtree returns `403 Forbidden`. Prefer this header over the legacy `customerContext` query parameter, which only applies to legacy API keys and is ignored by personal and service account tokens.",
        "in": "header"
      }
    }
  },
  "x-samples-languages": [
    "curl",
    "go",
    "node",
    "python"
  ],
  "x-cli-config": {
    "security": "oauth2",
    "params": {
      "client_id": "cli"
    }
  }
}
```