{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aiven/json-schema/aiven-organization-emissions-get-response-schema.json",
  "title": "OrganizationEmissionsGetResponse",
  "description": "OrganizationEmissionsGetResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aiven-organizationemissions-api-openapi.yml#/components/schemas/OrganizationEmissionsGetResponse",
  "type": "object",
  "properties": {
    "ending_time": {
      "type": "string",
      "maxLength": 36,
      "description": "End of the query period (exclusive)"
    },
    "granularity": {
      "type": "string",
      "description": "Granularity for emissions time buckets.",
      "title": "Time bucket granularity",
      "enum": [
        "day",
        "month"
      ]
    },
    "groups": {
      "type": "array",
      "description": "When group_by=none, contains a single element with org totals. When group_by=project or billing_group, contains one element per group.",
      "title": "Emissions data grouped by the specified dimension",
      "items": {
        "type": "object",
        "properties": {
          "buckets": {
            "type": "array",
            "description": "Emissions data broken down by time bucket",
            "title": "Time series data",
            "items": {
              "type": "object",
              "properties": {
                "bucket_start": {
                  "type": "string",
                  "maxLength": 36,
                  "description": "Start of the time bucket"
                },
                "co2eq_kg": {
                  "type": "number",
                  "description": "Total CO2 equivalent emissions for this bucket",
                  "title": "CO2 equivalent in kilograms"
                }
              },
              "required": [
                "bucket_start",
                "co2eq_kg"
              ]
            }
          },
          "deleted": {
            "type": "boolean",
            "description": "True if the project or billing group has been deleted. Emissions from deleted resources are still included for historical accuracy.",
            "title": "Whether the group has been deleted",
            "default": false
          },
          "group_name": {
            "type": "string",
            "description": "Name of the project or billing group. None for org-level totals.",
            "title": "Group display name"
          }
        },
        "required": [
          "buckets"
        ]
      }
    },
    "starting_time": {
      "type": "string",
      "maxLength": 36,
      "description": "Start of the query period (inclusive)"
    }
  },
  "required": [
    "ending_time",
    "granularity",
    "groups",
    "starting_time"
  ]
}