> ## Documentation Index
> Fetch the complete documentation index at: https://docs.costory.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List alert templates



## OpenAPI

````yaml https://app-api.costory.io/docs/openapi.json get /alerts-v2/templates
openapi: 3.0.0
info:
  title: Costory
  version: '1.0'
  description: API Documentation
servers:
  - url: ''
    description: Production server
security: []
paths:
  /alerts-v2/templates:
    get:
      tags:
        - Alerts V2
      summary: List alert templates
      operationId: listAlertTemplatesV2
      responses:
        '200':
          description: Available and unavailable alert templates
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertTemplatesResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
      security:
        - bearerAuth: []
components:
  schemas:
    AlertTemplatesResponse:
      type: object
      properties:
        templates:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                enum:
                  - weekly-costs-threshold
                  - unused-reservation-cost
                  - kubernetes-waste
                  - aws-savings-plan-coverage
                  - marginal-cost
                  - rd-weekend-cost
                  - egress-costs
                  - untagged-resources
                  - rolling-7d-relative-change
                  - service-7d-cost-increase
                  - never-seen-sku
              name:
                type: string
              description:
                type: string
              type:
                type: string
                enum:
                  - COST
                  - BUDGET
              icon:
                type: string
              available:
                type: boolean
              unavailableReason:
                type: string
                enum:
                  - MISSING_DATASOURCE
                  - MISSING_METRIC
                  - FEATURE_NOT_AVAILABLE
                  - MISSING_LABEL
                  - MISSING_COLUMN
              unavailableTooltip:
                type: string
              config:
                type: object
                properties:
                  alertForm:
                    type: object
                    properties:
                      name:
                        type: string
                        minLength: 1
                      currency:
                        type: string
                        enum:
                          - USD
                          - EUR
                          - GBP
                          - CNY
                          - KRW
                      thresholds:
                        type: array
                        items:
                          type: object
                          properties:
                            value:
                              type: number
                            severityLevel:
                              type: string
                              enum:
                                - INFO
                                - WARNING
                                - RED
                            metricMode:
                              type: string
                              nullable: true
                              enum:
                                - ABSOLUTE_SPEND
                                - PERIOD_OVER_PERIOD_CHANGE
                                - null
                            changeBasis:
                              type: string
                              nullable: true
                              enum:
                                - ABSOLUTE_DELTA
                                - PERCENT_CHANGE
                                - null
                          required:
                            - value
                            - severityLevel
                        default: []
                      queryName:
                        type: string
                        default: ''
                      evaluationPeriod:
                        type: string
                        enum:
                          - DAILY
                          - WEEKLY
                          - MONTHLY
                        default: DAILY
                      thresholdType:
                        type: string
                        enum:
                          - ABOVE
                          - UNDER
                        default: ABOVE
                      description:
                        type: string
                        default: ''
                      tagIds:
                        type: array
                        items:
                          type: string
                        default: []
                      type:
                        type: string
                        enum:
                          - PRIVATE
                          - PUBLIC
                      teamId:
                        type: string
                        nullable: true
                      scout:
                        type: string
                        nullable: true
                        minLength: 1
                      scopeId:
                        type: string
                        nullable: true
                      condition:
                        type: string
                        nullable: true
                      dedup:
                        oneOf:
                          - type: object
                            properties:
                              kind:
                                type: string
                                enum:
                                  - CALENDAR
                              calendarUnit:
                                type: string
                                enum:
                                  - WEEK
                                  - MONTH
                            required:
                              - kind
                              - calendarUnit
                          - type: object
                            properties:
                              kind:
                                type: string
                                enum:
                                  - ROLLING
                              windowDays:
                                type: integer
                                minimum: 0
                                exclusiveMinimum: true
                            required:
                              - kind
                              - windowDays
                          - nullable: true
                            type: string
                            enum:
                              - null
                      messageWidgets:
                        type: array
                        items:
                          allOf:
                            - type: object
                              properties:
                                id:
                                  type: string
                                  format: cuid
                                title:
                                  type: string
                                  default: ''
                                description:
                                  type: string
                                  default: ''
                            - oneOf:
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - ALERT
                                      description: >-
                                        Frozen body of a triggered cost alert
                                        notification.
                                  required:
                                    - type
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - TEXT
                                      description: >-
                                        Free-form Markdown block (headings,
                                        notes, context).
                                    contentMarkdown:
                                      type: string
                                      minLength: 1
                                      maxLength: 10000
                                      description: Markdown content, 1–10,000 characters.
                                  required:
                                    - type
                                    - contentMarkdown
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - GRAPH_SNAPSHOT
                                      description: >-
                                        Rendered snapshot of an Advanced
                                        Explorer chart.
                                    advancedExplorerRequest:
                                      type: object
                                      properties:
                                        period:
                                          type: object
                                          properties:
                                            startDate:
                                              type: string
                                              nullable: true
                                              format: date-time
                                            endDate:
                                              type: string
                                              nullable: true
                                              format: date-time
                                            datePreset:
                                              type: string
                                              nullable: true
                                              enum:
                                                - TRAILING_90_DAYS
                                                - TRAILING_30_DAYS
                                                - TRAILING_45_DAYS
                                                - TRAILING_7_DAYS
                                                - TRAILING_3_DAYS
                                                - TRAILING_1_DAYS
                                                - TRAILING_14_WEEKS
                                                - MTD
                                                - QTD
                                                - YTD
                                                - CURRENT_MONTH
                                                - CURRENT_QUARTER
                                                - CURRENT_YEAR
                                                - LAST_WEEK
                                                - LAST_MONTH
                                                - LAST_6_MONTHS
                                                - LAST_12_MONTHS
                                                - LAST_4_YEARS
                                                - LAST_3_MONTHS
                                                - LAST_INVOICE_MONTH
                                                - null
                                            aggBy:
                                              type: string
                                              enum:
                                                - Hour
                                                - Day
                                                - Week
                                                - Month
                                                - Period
                                            forecastDays:
                                              type: integer
                                              minimum: 0
                                            comparisonPeriod:
                                              type: object
                                              properties:
                                                startDate:
                                                  type: string
                                                  nullable: true
                                                  format: date-time
                                                endDate:
                                                  type: string
                                                  nullable: true
                                                  format: date-time
                                                enabled:
                                                  type: boolean
                                                chartType:
                                                  type: string
                                                  enum:
                                                    - WATERFALL
                                                    - TABLE
                                                    - KPI_BREAKDOWN
                                              required:
                                                - startDate
                                                - endDate
                                                - enabled
                                                - chartType
                                          required:
                                            - aggBy
                                        queries:
                                          type: array
                                          items:
                                            oneOf:
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - condition
                                                  expression:
                                                    type: string
                                                    minLength: 1
                                                  name:
                                                    type: string
                                                    pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                                  alias:
                                                    type: string
                                                    minLength: 1
                                                    maxLength: 50
                                                  visible:
                                                    type: boolean
                                                    default: true
                                                  colorIndex:
                                                    type: number
                                                  chartType:
                                                    type: string
                                                    enum:
                                                      - BAR
                                                      - LINE
                                                      - AREA
                                                      - WATERFALL
                                                      - TABLE
                                                required:
                                                  - type
                                                  - expression
                                                  - name
                                                  - colorIndex
                                                  - chartType
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - formula
                                                  formula:
                                                    type: string
                                                  unitOverride:
                                                    type: string
                                                  name:
                                                    type: string
                                                    pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                                  alias:
                                                    type: string
                                                    minLength: 1
                                                    maxLength: 50
                                                  visible:
                                                    type: boolean
                                                    default: true
                                                  colorIndex:
                                                    type: number
                                                  chartType:
                                                    type: string
                                                    enum:
                                                      - BAR
                                                      - LINE
                                                      - AREA
                                                      - WATERFALL
                                                      - TABLE
                                                  rollingAggregation:
                                                    type: object
                                                    properties:
                                                      aggregator:
                                                        type: string
                                                        enum:
                                                          - SUM
                                                          - AVG
                                                          - MAX
                                                          - MIN
                                                      window:
                                                        type: object
                                                        properties:
                                                          preset:
                                                            type: string
                                                            enum:
                                                              - MONTH
                                                              - WEEK
                                                          relativeDays:
                                                            type: integer
                                                            minimum: 1
                                                    required:
                                                      - aggregator
                                                      - window
                                                  shiftAmount:
                                                    type: integer
                                                  shiftUnit:
                                                    type: string
                                                    enum:
                                                      - DAY
                                                      - WEEK
                                                      - MONTH
                                                required:
                                                  - type
                                                  - formula
                                                  - name
                                                  - colorIndex
                                                  - chartType
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - metric
                                                  metricId:
                                                    type: string
                                                  rawMetric:
                                                    type: string
                                                  groupBy:
                                                    anyOf:
                                                      - type: string
                                                      - type: array
                                                        items:
                                                          type: string
                                                          minLength: 1
                                                      - nullable: true
                                                        type: string
                                                        enum:
                                                          - null
                                                  unitOverride:
                                                    type: string
                                                  aggregator:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                  reducer:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                  name:
                                                    type: string
                                                    pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                                  alias:
                                                    type: string
                                                    minLength: 1
                                                    maxLength: 50
                                                  visible:
                                                    type: boolean
                                                    default: true
                                                  colorIndex:
                                                    type: number
                                                  chartType:
                                                    type: string
                                                    enum:
                                                      - BAR
                                                      - LINE
                                                      - AREA
                                                      - WATERFALL
                                                      - TABLE
                                                  colorPalette:
                                                    type: string
                                                    enum:
                                                      - DEFAULT
                                                      - PIYG
                                                      - RDYLBU
                                                      - CLASSIC
                                                    default: DEFAULT
                                                  rollingAggregation:
                                                    type: object
                                                    properties:
                                                      aggregator:
                                                        type: string
                                                        enum:
                                                          - SUM
                                                          - AVG
                                                          - MAX
                                                          - MIN
                                                      window:
                                                        type: object
                                                        properties:
                                                          preset:
                                                            type: string
                                                            enum:
                                                              - MONTH
                                                              - WEEK
                                                          relativeDays:
                                                            type: integer
                                                            minimum: 1
                                                    required:
                                                      - aggregator
                                                      - window
                                                  shiftAmount:
                                                    type: integer
                                                  shiftUnit:
                                                    type: string
                                                    enum:
                                                      - DAY
                                                      - WEEK
                                                      - MONTH
                                                required:
                                                  - type
                                                  - metricId
                                                  - aggregator
                                                  - name
                                                  - colorIndex
                                                  - chartType
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - cost
                                                  groupBy:
                                                    anyOf:
                                                      - type: string
                                                      - type: array
                                                        items:
                                                          type: string
                                                          minLength: 1
                                                      - nullable: true
                                                        type: string
                                                        enum:
                                                          - null
                                                  aggregator:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                  currency:
                                                    type: string
                                                    enum:
                                                      - USD
                                                      - EUR
                                                      - GBP
                                                      - CNY
                                                      - KRW
                                                  whereClause:
                                                    type: object
                                                    properties: {}
                                                    additionalProperties: {}
                                                  metricId:
                                                    type: string
                                                    enum:
                                                      - cost
                                                      - effective_cost
                                                      - list_cost
                                                      - contracted_cost
                                                      - unblended_cost
                                                      - net_unblended_cost
                                                      - amortized_cost
                                                      - net_amortized_cost
                                                  extendDashboardConditions:
                                                    type: boolean
                                                    default: true
                                                  name:
                                                    type: string
                                                    pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                                  alias:
                                                    type: string
                                                    minLength: 1
                                                    maxLength: 50
                                                  reducer:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                  visible:
                                                    type: boolean
                                                    default: true
                                                  colorIndex:
                                                    type: number
                                                  chartType:
                                                    type: string
                                                    enum:
                                                      - BAR
                                                      - LINE
                                                      - AREA
                                                      - WATERFALL
                                                      - TABLE
                                                  colorPalette:
                                                    type: string
                                                    enum:
                                                      - DEFAULT
                                                      - PIYG
                                                      - RDYLBU
                                                      - CLASSIC
                                                    default: DEFAULT
                                                  rollingAggregation:
                                                    type: object
                                                    properties:
                                                      aggregator:
                                                        type: string
                                                        enum:
                                                          - SUM
                                                          - AVG
                                                          - MAX
                                                          - MIN
                                                      window:
                                                        type: object
                                                        properties:
                                                          preset:
                                                            type: string
                                                            enum:
                                                              - MONTH
                                                              - WEEK
                                                          relativeDays:
                                                            type: integer
                                                            minimum: 1
                                                    required:
                                                      - aggregator
                                                      - window
                                                  excludeGroupByValue:
                                                    type: object
                                                    properties:
                                                      source:
                                                        type: object
                                                        properties:
                                                          type:
                                                            type: string
                                                            enum:
                                                              - indexation
                                                        required:
                                                          - type
                                                        additionalProperties: false
                                                    required:
                                                      - source
                                                    additionalProperties: false
                                                    description: >-
                                                      Exclude group-by values already present
                                                      in the billing-stats indexation catalog
                                                      before the query window. HTTP API only;
                                                      not available on MCP query.
                                                  shiftAmount:
                                                    type: integer
                                                  shiftUnit:
                                                    type: string
                                                    enum:
                                                      - DAY
                                                      - WEEK
                                                      - MONTH
                                                required:
                                                  - type
                                                  - aggregator
                                                  - whereClause
                                                  - name
                                                  - colorIndex
                                                  - chartType
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - usage
                                                  whereClause:
                                                    type: object
                                                    properties: {}
                                                    additionalProperties: {}
                                                  aggregator:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                  groupBy:
                                                    anyOf:
                                                      - type: string
                                                      - type: array
                                                        items:
                                                          type: string
                                                          minLength: 1
                                                      - nullable: true
                                                        type: string
                                                        enum:
                                                          - null
                                                  metricId:
                                                    type: string
                                                  extendDashboardConditions:
                                                    type: boolean
                                                    default: true
                                                  name:
                                                    type: string
                                                    pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                                  alias:
                                                    type: string
                                                    minLength: 1
                                                    maxLength: 50
                                                  reducer:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                  visible:
                                                    type: boolean
                                                    default: true
                                                  colorIndex:
                                                    type: number
                                                  chartType:
                                                    type: string
                                                    enum:
                                                      - BAR
                                                      - LINE
                                                      - AREA
                                                      - WATERFALL
                                                      - TABLE
                                                  colorPalette:
                                                    type: string
                                                    enum:
                                                      - DEFAULT
                                                      - PIYG
                                                      - RDYLBU
                                                      - CLASSIC
                                                    default: DEFAULT
                                                  rollingAggregation:
                                                    type: object
                                                    properties:
                                                      aggregator:
                                                        type: string
                                                        enum:
                                                          - SUM
                                                          - AVG
                                                          - MAX
                                                          - MIN
                                                      window:
                                                        type: object
                                                        properties:
                                                          preset:
                                                            type: string
                                                            enum:
                                                              - MONTH
                                                              - WEEK
                                                          relativeDays:
                                                            type: integer
                                                            minimum: 1
                                                    required:
                                                      - aggregator
                                                      - window
                                                  excludeGroupByValue:
                                                    type: object
                                                    properties:
                                                      source:
                                                        type: object
                                                        properties:
                                                          type:
                                                            type: string
                                                            enum:
                                                              - indexation
                                                        required:
                                                          - type
                                                        additionalProperties: false
                                                    required:
                                                      - source
                                                    additionalProperties: false
                                                    description: >-
                                                      Exclude group-by values already present
                                                      in the billing-stats indexation catalog
                                                      before the query window. HTTP API only;
                                                      not available on MCP query.
                                                  shiftAmount:
                                                    type: integer
                                                  shiftUnit:
                                                    type: string
                                                    enum:
                                                      - DAY
                                                      - WEEK
                                                      - MONTH
                                                required:
                                                  - type
                                                  - whereClause
                                                  - aggregator
                                                  - metricId
                                                  - name
                                                  - colorIndex
                                                  - chartType
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - budget
                                                  budgetId:
                                                    type: string
                                                  budgetLineId:
                                                    type: string
                                                  groupBy:
                                                    anyOf:
                                                      - type: string
                                                      - type: array
                                                        items:
                                                          type: string
                                                          minLength: 1
                                                      - nullable: true
                                                        type: string
                                                        enum:
                                                          - null
                                                  name:
                                                    type: string
                                                    pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                                  alias:
                                                    type: string
                                                    minLength: 1
                                                    maxLength: 50
                                                  virtualDimensionValue:
                                                    type: string
                                                  visible:
                                                    type: boolean
                                                    default: true
                                                  colorIndex:
                                                    type: number
                                                  chartType:
                                                    type: string
                                                    enum:
                                                      - BAR
                                                      - LINE
                                                      - AREA
                                                      - WATERFALL
                                                      - TABLE
                                                  colorPalette:
                                                    type: string
                                                    enum:
                                                      - DEFAULT
                                                      - PIYG
                                                      - RDYLBU
                                                      - CLASSIC
                                                    default: DEFAULT
                                                  rollingAggregation:
                                                    type: object
                                                    properties:
                                                      aggregator:
                                                        type: string
                                                        enum:
                                                          - SUM
                                                          - AVG
                                                          - MAX
                                                          - MIN
                                                      window:
                                                        type: object
                                                        properties:
                                                          preset:
                                                            type: string
                                                            enum:
                                                              - MONTH
                                                              - WEEK
                                                          relativeDays:
                                                            type: integer
                                                            minimum: 1
                                                    required:
                                                      - aggregator
                                                      - window
                                                  aggregator:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                    default: SUM
                                                required:
                                                  - type
                                                  - budgetId
                                                  - name
                                                  - colorIndex
                                                  - chartType
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - externalMetric
                                                  provider:
                                                    type: string
                                                    enum:
                                                      - tsuga
                                                      - bigquery
                                                      - datadog
                                                      - cloudwatch
                                                      - s3
                                                      - amplitude
                                                      - snowflake
                                                      - cloudmonitoring
                                                      - push
                                                  integrationId:
                                                    type: string
                                                    minLength: 1
                                                    description: >-
                                                      External metric integration ID from
                                                      list_metrics(includeExternal: true).
                                                  query:
                                                    type: string
                                                    minLength: 1
                                                  metricName:
                                                    type: string
                                                    default: ''
                                                  aggregator:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                  groupByFields:
                                                    type: array
                                                    items:
                                                      type: string
                                                      minLength: 1
                                                    maxItems: 7
                                                    default: []
                                                  conditions:
                                                    type: string
                                                  dateColumn:
                                                    type: string
                                                    minLength: 1
                                                  metricColumn:
                                                    type: string
                                                    minLength: 1
                                                  gapFillingMethod:
                                                    type: string
                                                    enum:
                                                      - ZERO
                                                      - FORWARD_FILL
                                                      - LINEAR_INTERPOLATION
                                                      - SPREAD
                                                  name:
                                                    type: string
                                                    pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                                  alias:
                                                    type: string
                                                    minLength: 1
                                                    maxLength: 50
                                                  visible:
                                                    type: boolean
                                                    default: true
                                                  colorIndex:
                                                    type: number
                                                  chartType:
                                                    type: string
                                                    enum:
                                                      - BAR
                                                      - LINE
                                                      - AREA
                                                      - WATERFALL
                                                      - TABLE
                                                  colorPalette:
                                                    type: string
                                                    enum:
                                                      - DEFAULT
                                                      - PIYG
                                                      - RDYLBU
                                                      - CLASSIC
                                                    default: DEFAULT
                                                  rollingAggregation:
                                                    type: object
                                                    properties:
                                                      aggregator:
                                                        type: string
                                                        enum:
                                                          - SUM
                                                          - AVG
                                                          - MAX
                                                          - MIN
                                                      window:
                                                        type: object
                                                        properties:
                                                          preset:
                                                            type: string
                                                            enum:
                                                              - MONTH
                                                              - WEEK
                                                          relativeDays:
                                                            type: integer
                                                            minimum: 1
                                                    required:
                                                      - aggregator
                                                      - window
                                                  unitOverride:
                                                    type: string
                                                required:
                                                  - type
                                                  - provider
                                                  - integrationId
                                                  - name
                                                  - colorIndex
                                                  - chartType
                                            discriminator:
                                              propertyName: type
                                        eventsFilter:
                                          type: object
                                          nullable: true
                                          properties:
                                            sources:
                                              type: array
                                              items:
                                                type: string
                                                enum:
                                                  - custom
                                                  - provider
                                                  - github
                                                  - api
                                                  - agent
                                              default:
                                                - custom
                                                - api
                                            githubSourceRepos:
                                              type: array
                                              items:
                                                type: string
                                              default: []
                                            search:
                                              type: string
                                              default: ''
                                        bookmarkedEvents:
                                          type: array
                                          items:
                                            type: string
                                        scopeId:
                                          type: string
                                          nullable: true
                                        limitOverride:
                                          type: integer
                                          minimum: 1
                                          maximum: 1000
                                        displayOptions:
                                          type: object
                                          properties:
                                            sort:
                                              type: object
                                              properties:
                                                by:
                                                  type: string
                                                  minLength: 1
                                                direction:
                                                  type: string
                                                  enum:
                                                    - ASC
                                                    - DESC
                                                  default: DESC
                                              required:
                                                - by
                                            hideEmptyRows:
                                              type: boolean
                                            topN:
                                              type: integer
                                              minimum: 1
                                              maximum: 100
                                            showTotal:
                                              type: boolean
                                            precision:
                                              type: integer
                                              minimum: 0
                                              maximum: 6
                                            pivot:
                                              type: object
                                              properties:
                                                rows:
                                                  type: array
                                                  items:
                                                    type: string
                                                    enum:
                                                      - groupBy
                                                      - query
                                                      - time
                                                  minItems: 1
                                                columns:
                                                  type: array
                                                  items:
                                                    type: string
                                                    enum:
                                                      - groupBy
                                                      - query
                                                      - time
                                                  minItems: 1
                                              required:
                                                - rows
                                                - columns
                                              additionalProperties: false
                                          additionalProperties: false
                                      required:
                                        - period
                                        - queries
                                        - bookmarkedEvents
                                      description: >-
                                        Optional explicit query override. Omit
                                        to inherit the alert's first source cost
                                        query (resolved with the alert currency,
                                        scope, and effective-date period at send
                                        time).
                                  required:
                                    - type
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - TOP_FLOP
                                      description: >-
                                        Ranked table of the biggest cost
                                        increases and decreases.
                                    topN:
                                      type: integer
                                      minimum: 0
                                      maximum: 100
                                      description: >-
                                        Number of largest-increase rows to
                                        include.
                                    flopN:
                                      type: integer
                                      minimum: 0
                                      maximum: 100
                                      description: >-
                                        Number of largest-decrease rows to
                                        include.
                                    cutOff:
                                      type: number
                                      minimum: 0
                                      default: 10
                                      description: >-
                                        Minimum absolute cost change for a row
                                        to qualify. Rows below this are dropped.
                                    comparison:
                                      oneOf:
                                        - type: object
                                          properties:
                                            kind:
                                              type: string
                                              enum:
                                                - PREVIOUS_PERIOD
                                          required:
                                            - kind
                                          additionalProperties: false
                                        - type: object
                                          properties:
                                            kind:
                                              type: string
                                              enum:
                                                - CUSTOM
                                            from:
                                              type: string
                                              minLength: 1
                                            to:
                                              type: string
                                              minLength: 1
                                          required:
                                            - kind
                                            - from
                                            - to
                                      default:
                                        kind: PREVIOUS_PERIOD
                                      description: >-
                                        Baseline the current period is compared
                                        against: PREVIOUS_PERIOD (default) or a
                                        CUSTOM { from, to } range.
                                      discriminator:
                                        propertyName: kind
                                    advancedExplorerRequest:
                                      type: object
                                      properties:
                                        period:
                                          type: object
                                          properties:
                                            startDate:
                                              type: string
                                              nullable: true
                                              format: date-time
                                            endDate:
                                              type: string
                                              nullable: true
                                              format: date-time
                                            datePreset:
                                              type: string
                                              nullable: true
                                              enum:
                                                - TRAILING_90_DAYS
                                                - TRAILING_30_DAYS
                                                - TRAILING_45_DAYS
                                                - TRAILING_7_DAYS
                                                - TRAILING_3_DAYS
                                                - TRAILING_1_DAYS
                                                - TRAILING_14_WEEKS
                                                - MTD
                                                - QTD
                                                - YTD
                                                - CURRENT_MONTH
                                                - CURRENT_QUARTER
                                                - CURRENT_YEAR
                                                - LAST_WEEK
                                                - LAST_MONTH
                                                - LAST_6_MONTHS
                                                - LAST_12_MONTHS
                                                - LAST_4_YEARS
                                                - LAST_3_MONTHS
                                                - LAST_INVOICE_MONTH
                                                - null
                                            aggBy:
                                              type: string
                                              enum:
                                                - Hour
                                                - Day
                                                - Week
                                                - Month
                                                - Period
                                            forecastDays:
                                              type: integer
                                              minimum: 0
                                            comparisonPeriod:
                                              type: object
                                              properties:
                                                startDate:
                                                  type: string
                                                  nullable: true
                                                  format: date-time
                                                endDate:
                                                  type: string
                                                  nullable: true
                                                  format: date-time
                                                enabled:
                                                  type: boolean
                                                chartType:
                                                  type: string
                                                  enum:
                                                    - WATERFALL
                                                    - TABLE
                                                    - KPI_BREAKDOWN
                                              required:
                                                - startDate
                                                - endDate
                                                - enabled
                                                - chartType
                                          required:
                                            - aggBy
                                        queries:
                                          type: array
                                          items:
                                            oneOf:
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - condition
                                                  expression:
                                                    type: string
                                                    minLength: 1
                                                  name:
                                                    type: string
                                                    pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                                  alias:
                                                    type: string
                                                    minLength: 1
                                                    maxLength: 50
                                                  visible:
                                                    type: boolean
                                                    default: true
                                                  colorIndex:
                                                    type: number
                                                  chartType:
                                                    type: string
                                                    enum:
                                                      - BAR
                                                      - LINE
                                                      - AREA
                                                      - WATERFALL
                                                      - TABLE
                                                required:
                                                  - type
                                                  - expression
                                                  - name
                                                  - colorIndex
                                                  - chartType
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - formula
                                                  formula:
                                                    type: string
                                                  unitOverride:
                                                    type: string
                                                  name:
                                                    type: string
                                                    pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                                  alias:
                                                    type: string
                                                    minLength: 1
                                                    maxLength: 50
                                                  visible:
                                                    type: boolean
                                                    default: true
                                                  colorIndex:
                                                    type: number
                                                  chartType:
                                                    type: string
                                                    enum:
                                                      - BAR
                                                      - LINE
                                                      - AREA
                                                      - WATERFALL
                                                      - TABLE
                                                  rollingAggregation:
                                                    type: object
                                                    properties:
                                                      aggregator:
                                                        type: string
                                                        enum:
                                                          - SUM
                                                          - AVG
                                                          - MAX
                                                          - MIN
                                                      window:
                                                        type: object
                                                        properties:
                                                          preset:
                                                            type: string
                                                            enum:
                                                              - MONTH
                                                              - WEEK
                                                          relativeDays:
                                                            type: integer
                                                            minimum: 1
                                                    required:
                                                      - aggregator
                                                      - window
                                                  shiftAmount:
                                                    type: integer
                                                  shiftUnit:
                                                    type: string
                                                    enum:
                                                      - DAY
                                                      - WEEK
                                                      - MONTH
                                                required:
                                                  - type
                                                  - formula
                                                  - name
                                                  - colorIndex
                                                  - chartType
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - metric
                                                  metricId:
                                                    type: string
                                                  rawMetric:
                                                    type: string
                                                  groupBy:
                                                    anyOf:
                                                      - type: string
                                                      - type: array
                                                        items:
                                                          type: string
                                                          minLength: 1
                                                      - nullable: true
                                                        type: string
                                                        enum:
                                                          - null
                                                  unitOverride:
                                                    type: string
                                                  aggregator:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                  reducer:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                  name:
                                                    type: string
                                                    pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                                  alias:
                                                    type: string
                                                    minLength: 1
                                                    maxLength: 50
                                                  visible:
                                                    type: boolean
                                                    default: true
                                                  colorIndex:
                                                    type: number
                                                  chartType:
                                                    type: string
                                                    enum:
                                                      - BAR
                                                      - LINE
                                                      - AREA
                                                      - WATERFALL
                                                      - TABLE
                                                  colorPalette:
                                                    type: string
                                                    enum:
                                                      - DEFAULT
                                                      - PIYG
                                                      - RDYLBU
                                                      - CLASSIC
                                                    default: DEFAULT
                                                  rollingAggregation:
                                                    type: object
                                                    properties:
                                                      aggregator:
                                                        type: string
                                                        enum:
                                                          - SUM
                                                          - AVG
                                                          - MAX
                                                          - MIN
                                                      window:
                                                        type: object
                                                        properties:
                                                          preset:
                                                            type: string
                                                            enum:
                                                              - MONTH
                                                              - WEEK
                                                          relativeDays:
                                                            type: integer
                                                            minimum: 1
                                                    required:
                                                      - aggregator
                                                      - window
                                                  shiftAmount:
                                                    type: integer
                                                  shiftUnit:
                                                    type: string
                                                    enum:
                                                      - DAY
                                                      - WEEK
                                                      - MONTH
                                                required:
                                                  - type
                                                  - metricId
                                                  - aggregator
                                                  - name
                                                  - colorIndex
                                                  - chartType
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - cost
                                                  groupBy:
                                                    anyOf:
                                                      - type: string
                                                      - type: array
                                                        items:
                                                          type: string
                                                          minLength: 1
                                                      - nullable: true
                                                        type: string
                                                        enum:
                                                          - null
                                                  aggregator:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                  currency:
                                                    type: string
                                                    enum:
                                                      - USD
                                                      - EUR
                                                      - GBP
                                                      - CNY
                                                      - KRW
                                                  whereClause:
                                                    type: object
                                                    properties: {}
                                                    additionalProperties: {}
                                                  metricId:
                                                    type: string
                                                    enum:
                                                      - cost
                                                      - effective_cost
                                                      - list_cost
                                                      - contracted_cost
                                                      - unblended_cost
                                                      - net_unblended_cost
                                                      - amortized_cost
                                                      - net_amortized_cost
                                                  extendDashboardConditions:
                                                    type: boolean
                                                    default: true
                                                  name:
                                                    type: string
                                                    pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                                  alias:
                                                    type: string
                                                    minLength: 1
                                                    maxLength: 50
                                                  reducer:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                  visible:
                                                    type: boolean
                                                    default: true
                                                  colorIndex:
                                                    type: number
                                                  chartType:
                                                    type: string
                                                    enum:
                                                      - BAR
                                                      - LINE
                                                      - AREA
                                                      - WATERFALL
                                                      - TABLE
                                                  colorPalette:
                                                    type: string
                                                    enum:
                                                      - DEFAULT
                                                      - PIYG
                                                      - RDYLBU
                                                      - CLASSIC
                                                    default: DEFAULT
                                                  rollingAggregation:
                                                    type: object
                                                    properties:
                                                      aggregator:
                                                        type: string
                                                        enum:
                                                          - SUM
                                                          - AVG
                                                          - MAX
                                                          - MIN
                                                      window:
                                                        type: object
                                                        properties:
                                                          preset:
                                                            type: string
                                                            enum:
                                                              - MONTH
                                                              - WEEK
                                                          relativeDays:
                                                            type: integer
                                                            minimum: 1
                                                    required:
                                                      - aggregator
                                                      - window
                                                  excludeGroupByValue:
                                                    type: object
                                                    properties:
                                                      source:
                                                        type: object
                                                        properties:
                                                          type:
                                                            type: string
                                                            enum:
                                                              - indexation
                                                        required:
                                                          - type
                                                        additionalProperties: false
                                                    required:
                                                      - source
                                                    additionalProperties: false
                                                    description: >-
                                                      Exclude group-by values already present
                                                      in the billing-stats indexation catalog
                                                      before the query window. HTTP API only;
                                                      not available on MCP query.
                                                  shiftAmount:
                                                    type: integer
                                                  shiftUnit:
                                                    type: string
                                                    enum:
                                                      - DAY
                                                      - WEEK
                                                      - MONTH
                                                required:
                                                  - type
                                                  - aggregator
                                                  - whereClause
                                                  - name
                                                  - colorIndex
                                                  - chartType
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - usage
                                                  whereClause:
                                                    type: object
                                                    properties: {}
                                                    additionalProperties: {}
                                                  aggregator:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                  groupBy:
                                                    anyOf:
                                                      - type: string
                                                      - type: array
                                                        items:
                                                          type: string
                                                          minLength: 1
                                                      - nullable: true
                                                        type: string
                                                        enum:
                                                          - null
                                                  metricId:
                                                    type: string
                                                  extendDashboardConditions:
                                                    type: boolean
                                                    default: true
                                                  name:
                                                    type: string
                                                    pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                                  alias:
                                                    type: string
                                                    minLength: 1
                                                    maxLength: 50
                                                  reducer:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                  visible:
                                                    type: boolean
                                                    default: true
                                                  colorIndex:
                                                    type: number
                                                  chartType:
                                                    type: string
                                                    enum:
                                                      - BAR
                                                      - LINE
                                                      - AREA
                                                      - WATERFALL
                                                      - TABLE
                                                  colorPalette:
                                                    type: string
                                                    enum:
                                                      - DEFAULT
                                                      - PIYG
                                                      - RDYLBU
                                                      - CLASSIC
                                                    default: DEFAULT
                                                  rollingAggregation:
                                                    type: object
                                                    properties:
                                                      aggregator:
                                                        type: string
                                                        enum:
                                                          - SUM
                                                          - AVG
                                                          - MAX
                                                          - MIN
                                                      window:
                                                        type: object
                                                        properties:
                                                          preset:
                                                            type: string
                                                            enum:
                                                              - MONTH
                                                              - WEEK
                                                          relativeDays:
                                                            type: integer
                                                            minimum: 1
                                                    required:
                                                      - aggregator
                                                      - window
                                                  excludeGroupByValue:
                                                    type: object
                                                    properties:
                                                      source:
                                                        type: object
                                                        properties:
                                                          type:
                                                            type: string
                                                            enum:
                                                              - indexation
                                                        required:
                                                          - type
                                                        additionalProperties: false
                                                    required:
                                                      - source
                                                    additionalProperties: false
                                                    description: >-
                                                      Exclude group-by values already present
                                                      in the billing-stats indexation catalog
                                                      before the query window. HTTP API only;
                                                      not available on MCP query.
                                                  shiftAmount:
                                                    type: integer
                                                  shiftUnit:
                                                    type: string
                                                    enum:
                                                      - DAY
                                                      - WEEK
                                                      - MONTH
                                                required:
                                                  - type
                                                  - whereClause
                                                  - aggregator
                                                  - metricId
                                                  - name
                                                  - colorIndex
                                                  - chartType
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - budget
                                                  budgetId:
                                                    type: string
                                                  budgetLineId:
                                                    type: string
                                                  groupBy:
                                                    anyOf:
                                                      - type: string
                                                      - type: array
                                                        items:
                                                          type: string
                                                          minLength: 1
                                                      - nullable: true
                                                        type: string
                                                        enum:
                                                          - null
                                                  name:
                                                    type: string
                                                    pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                                  alias:
                                                    type: string
                                                    minLength: 1
                                                    maxLength: 50
                                                  virtualDimensionValue:
                                                    type: string
                                                  visible:
                                                    type: boolean
                                                    default: true
                                                  colorIndex:
                                                    type: number
                                                  chartType:
                                                    type: string
                                                    enum:
                                                      - BAR
                                                      - LINE
                                                      - AREA
                                                      - WATERFALL
                                                      - TABLE
                                                  colorPalette:
                                                    type: string
                                                    enum:
                                                      - DEFAULT
                                                      - PIYG
                                                      - RDYLBU
                                                      - CLASSIC
                                                    default: DEFAULT
                                                  rollingAggregation:
                                                    type: object
                                                    properties:
                                                      aggregator:
                                                        type: string
                                                        enum:
                                                          - SUM
                                                          - AVG
                                                          - MAX
                                                          - MIN
                                                      window:
                                                        type: object
                                                        properties:
                                                          preset:
                                                            type: string
                                                            enum:
                                                              - MONTH
                                                              - WEEK
                                                          relativeDays:
                                                            type: integer
                                                            minimum: 1
                                                    required:
                                                      - aggregator
                                                      - window
                                                  aggregator:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                    default: SUM
                                                required:
                                                  - type
                                                  - budgetId
                                                  - name
                                                  - colorIndex
                                                  - chartType
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - externalMetric
                                                  provider:
                                                    type: string
                                                    enum:
                                                      - tsuga
                                                      - bigquery
                                                      - datadog
                                                      - cloudwatch
                                                      - s3
                                                      - amplitude
                                                      - snowflake
                                                      - cloudmonitoring
                                                      - push
                                                  integrationId:
                                                    type: string
                                                    minLength: 1
                                                    description: >-
                                                      External metric integration ID from
                                                      list_metrics(includeExternal: true).
                                                  query:
                                                    type: string
                                                    minLength: 1
                                                  metricName:
                                                    type: string
                                                    default: ''
                                                  aggregator:
                                                    type: string
                                                    enum:
                                                      - SUM
                                                      - AVG
                                                      - MAX
                                                      - MIN
                                                  groupByFields:
                                                    type: array
                                                    items:
                                                      type: string
                                                      minLength: 1
                                                    maxItems: 7
                                                    default: []
                                                  conditions:
                                                    type: string
                                                  dateColumn:
                                                    type: string
                                                    minLength: 1
                                                  metricColumn:
                                                    type: string
                                                    minLength: 1
                                                  gapFillingMethod:
                                                    type: string
                                                    enum:
                                                      - ZERO
                                                      - FORWARD_FILL
                                                      - LINEAR_INTERPOLATION
                                                      - SPREAD
                                                  name:
                                                    type: string
                                                    pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                                  alias:
                                                    type: string
                                                    minLength: 1
                                                    maxLength: 50
                                                  visible:
                                                    type: boolean
                                                    default: true
                                                  colorIndex:
                                                    type: number
                                                  chartType:
                                                    type: string
                                                    enum:
                                                      - BAR
                                                      - LINE
                                                      - AREA
                                                      - WATERFALL
                                                      - TABLE
                                                  colorPalette:
                                                    type: string
                                                    enum:
                                                      - DEFAULT
                                                      - PIYG
                                                      - RDYLBU
                                                      - CLASSIC
                                                    default: DEFAULT
                                                  rollingAggregation:
                                                    type: object
                                                    properties:
                                                      aggregator:
                                                        type: string
                                                        enum:
                                                          - SUM
                                                          - AVG
                                                          - MAX
                                                          - MIN
                                                      window:
                                                        type: object
                                                        properties:
                                                          preset:
                                                            type: string
                                                            enum:
                                                              - MONTH
                                                              - WEEK
                                                          relativeDays:
                                                            type: integer
                                                            minimum: 1
                                                    required:
                                                      - aggregator
                                                      - window
                                                  unitOverride:
                                                    type: string
                                                required:
                                                  - type
                                                  - provider
                                                  - integrationId
                                                  - name
                                                  - colorIndex
                                                  - chartType
                                            discriminator:
                                              propertyName: type
                                        eventsFilter:
                                          type: object
                                          nullable: true
                                          properties:
                                            sources:
                                              type: array
                                              items:
                                                type: string
                                                enum:
                                                  - custom
                                                  - provider
                                                  - github
                                                  - api
                                                  - agent
                                              default:
                                                - custom
                                                - api
                                            githubSourceRepos:
                                              type: array
                                              items:
                                                type: string
                                              default: []
                                            search:
                                              type: string
                                              default: ''
                                        bookmarkedEvents:
                                          type: array
                                          items:
                                            type: string
                                        scopeId:
                                          type: string
                                          nullable: true
                                        limitOverride:
                                          type: integer
                                          minimum: 1
                                          maximum: 1000
                                        displayOptions:
                                          type: object
                                          properties:
                                            sort:
                                              type: object
                                              properties:
                                                by:
                                                  type: string
                                                  minLength: 1
                                                direction:
                                                  type: string
                                                  enum:
                                                    - ASC
                                                    - DESC
                                                  default: DESC
                                              required:
                                                - by
                                            hideEmptyRows:
                                              type: boolean
                                            topN:
                                              type: integer
                                              minimum: 1
                                              maximum: 100
                                            showTotal:
                                              type: boolean
                                            precision:
                                              type: integer
                                              minimum: 0
                                              maximum: 6
                                            pivot:
                                              type: object
                                              properties:
                                                rows:
                                                  type: array
                                                  items:
                                                    type: string
                                                    enum:
                                                      - groupBy
                                                      - query
                                                      - time
                                                  minItems: 1
                                                columns:
                                                  type: array
                                                  items:
                                                    type: string
                                                    enum:
                                                      - groupBy
                                                      - query
                                                      - time
                                                  minItems: 1
                                              required:
                                                - rows
                                                - columns
                                              additionalProperties: false
                                          additionalProperties: false
                                      required:
                                        - period
                                        - queries
                                        - bookmarkedEvents
                                      description: >-
                                        Optional explicit query override. Omit
                                        to inherit the alert's first source cost
                                        query (resolved with the alert currency,
                                        scope, and effective-date period at send
                                        time).
                                  required:
                                    - type
                                    - topN
                                    - flopN
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - DASHBOARD_PDF
                                      description: >-
                                        A dashboard rendered to PDF and attached
                                        to the report.
                                    dashboardV2Id:
                                      type: string
                                      minLength: 1
                                      description: Id of the dashboard to render as a PDF.
                                    datePreset:
                                      type: string
                                      nullable: true
                                      enum:
                                        - TRAILING_90_DAYS
                                        - TRAILING_30_DAYS
                                        - TRAILING_45_DAYS
                                        - TRAILING_7_DAYS
                                        - TRAILING_3_DAYS
                                        - TRAILING_1_DAYS
                                        - TRAILING_14_WEEKS
                                        - MTD
                                        - QTD
                                        - YTD
                                        - CURRENT_MONTH
                                        - CURRENT_QUARTER
                                        - CURRENT_YEAR
                                        - LAST_WEEK
                                        - LAST_MONTH
                                        - LAST_6_MONTHS
                                        - LAST_12_MONTHS
                                        - LAST_4_YEARS
                                        - LAST_3_MONTHS
                                        - LAST_INVOICE_MONTH
                                        - null
                                      description: >-
                                        Optional period override for every
                                        dashboard widget in the PDF. Omit to
                                        inherit the report (and destination)
                                        period. Mutually exclusive with
                                        startDate/endDate.
                                    startDate:
                                      type: string
                                      nullable: true
                                      description: >-
                                        Optional custom range start
                                        (YYYY-MM-DD). Use with endDate instead
                                        of datePreset.
                                    endDate:
                                      type: string
                                      nullable: true
                                      description: >-
                                        Optional custom range end (inclusive,
                                        YYYY-MM-DD). Use with startDate instead
                                        of datePreset.
                                  required:
                                    - type
                                    - dashboardV2Id
                              discriminator:
                                propertyName: type
                    required:
                      - name
                      - currency
                  explorerRequest:
                    type: object
                    properties:
                      period:
                        type: object
                        properties:
                          startDate:
                            type: string
                            nullable: true
                            format: date-time
                          endDate:
                            type: string
                            nullable: true
                            format: date-time
                          datePreset:
                            type: string
                            nullable: true
                            enum:
                              - TRAILING_90_DAYS
                              - TRAILING_30_DAYS
                              - TRAILING_45_DAYS
                              - TRAILING_7_DAYS
                              - TRAILING_3_DAYS
                              - TRAILING_1_DAYS
                              - TRAILING_14_WEEKS
                              - MTD
                              - QTD
                              - YTD
                              - CURRENT_MONTH
                              - CURRENT_QUARTER
                              - CURRENT_YEAR
                              - LAST_WEEK
                              - LAST_MONTH
                              - LAST_6_MONTHS
                              - LAST_12_MONTHS
                              - LAST_4_YEARS
                              - LAST_3_MONTHS
                              - LAST_INVOICE_MONTH
                              - null
                          aggBy:
                            type: string
                            enum:
                              - Hour
                              - Day
                              - Week
                              - Month
                              - Period
                          forecastDays:
                            type: integer
                            minimum: 0
                          comparisonPeriod:
                            type: object
                            properties:
                              startDate:
                                type: string
                                nullable: true
                                format: date-time
                              endDate:
                                type: string
                                nullable: true
                                format: date-time
                              enabled:
                                type: boolean
                              chartType:
                                type: string
                                enum:
                                  - WATERFALL
                                  - TABLE
                                  - KPI_BREAKDOWN
                            required:
                              - startDate
                              - endDate
                              - enabled
                              - chartType
                        required:
                          - aggBy
                      queries:
                        type: array
                        items:
                          oneOf:
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - condition
                                expression:
                                  type: string
                                  minLength: 1
                                name:
                                  type: string
                                  pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                alias:
                                  type: string
                                  minLength: 1
                                  maxLength: 50
                                visible:
                                  type: boolean
                                  default: true
                                colorIndex:
                                  type: number
                                chartType:
                                  type: string
                                  enum:
                                    - BAR
                                    - LINE
                                    - AREA
                                    - WATERFALL
                                    - TABLE
                              required:
                                - type
                                - expression
                                - name
                                - colorIndex
                                - chartType
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - formula
                                formula:
                                  type: string
                                unitOverride:
                                  type: string
                                name:
                                  type: string
                                  pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                alias:
                                  type: string
                                  minLength: 1
                                  maxLength: 50
                                visible:
                                  type: boolean
                                  default: true
                                colorIndex:
                                  type: number
                                chartType:
                                  type: string
                                  enum:
                                    - BAR
                                    - LINE
                                    - AREA
                                    - WATERFALL
                                    - TABLE
                                rollingAggregation:
                                  type: object
                                  properties:
                                    aggregator:
                                      type: string
                                      enum:
                                        - SUM
                                        - AVG
                                        - MAX
                                        - MIN
                                    window:
                                      type: object
                                      properties:
                                        preset:
                                          type: string
                                          enum:
                                            - MONTH
                                            - WEEK
                                        relativeDays:
                                          type: integer
                                          minimum: 1
                                  required:
                                    - aggregator
                                    - window
                                shiftAmount:
                                  type: integer
                                shiftUnit:
                                  type: string
                                  enum:
                                    - DAY
                                    - WEEK
                                    - MONTH
                              required:
                                - type
                                - formula
                                - name
                                - colorIndex
                                - chartType
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - metric
                                metricId:
                                  type: string
                                rawMetric:
                                  type: string
                                groupBy:
                                  anyOf:
                                    - type: string
                                    - type: array
                                      items:
                                        type: string
                                        minLength: 1
                                    - nullable: true
                                      type: string
                                      enum:
                                        - null
                                unitOverride:
                                  type: string
                                aggregator:
                                  type: string
                                  enum:
                                    - SUM
                                    - AVG
                                    - MAX
                                    - MIN
                                reducer:
                                  type: string
                                  enum:
                                    - SUM
                                    - AVG
                                    - MAX
                                    - MIN
                                name:
                                  type: string
                                  pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                alias:
                                  type: string
                                  minLength: 1
                                  maxLength: 50
                                visible:
                                  type: boolean
                                  default: true
                                colorIndex:
                                  type: number
                                chartType:
                                  type: string
                                  enum:
                                    - BAR
                                    - LINE
                                    - AREA
                                    - WATERFALL
                                    - TABLE
                                colorPalette:
                                  type: string
                                  enum:
                                    - DEFAULT
                                    - PIYG
                                    - RDYLBU
                                    - CLASSIC
                                  default: DEFAULT
                                rollingAggregation:
                                  type: object
                                  properties:
                                    aggregator:
                                      type: string
                                      enum:
                                        - SUM
                                        - AVG
                                        - MAX
                                        - MIN
                                    window:
                                      type: object
                                      properties:
                                        preset:
                                          type: string
                                          enum:
                                            - MONTH
                                            - WEEK
                                        relativeDays:
                                          type: integer
                                          minimum: 1
                                  required:
                                    - aggregator
                                    - window
                                shiftAmount:
                                  type: integer
                                shiftUnit:
                                  type: string
                                  enum:
                                    - DAY
                                    - WEEK
                                    - MONTH
                              required:
                                - type
                                - metricId
                                - aggregator
                                - name
                                - colorIndex
                                - chartType
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - cost
                                groupBy:
                                  anyOf:
                                    - type: string
                                    - type: array
                                      items:
                                        type: string
                                        minLength: 1
                                    - nullable: true
                                      type: string
                                      enum:
                                        - null
                                aggregator:
                                  type: string
                                  enum:
                                    - SUM
                                    - AVG
                                    - MAX
                                    - MIN
                                currency:
                                  type: string
                                  enum:
                                    - USD
                                    - EUR
                                    - GBP
                                    - CNY
                                    - KRW
                                whereClause:
                                  type: object
                                  properties: {}
                                  additionalProperties: {}
                                metricId:
                                  type: string
                                  enum:
                                    - cost
                                    - effective_cost
                                    - list_cost
                                    - contracted_cost
                                    - unblended_cost
                                    - net_unblended_cost
                                    - amortized_cost
                                    - net_amortized_cost
                                extendDashboardConditions:
                                  type: boolean
                                  default: true
                                name:
                                  type: string
                                  pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                alias:
                                  type: string
                                  minLength: 1
                                  maxLength: 50
                                reducer:
                                  type: string
                                  enum:
                                    - SUM
                                    - AVG
                                    - MAX
                                    - MIN
                                visible:
                                  type: boolean
                                  default: true
                                colorIndex:
                                  type: number
                                chartType:
                                  type: string
                                  enum:
                                    - BAR
                                    - LINE
                                    - AREA
                                    - WATERFALL
                                    - TABLE
                                colorPalette:
                                  type: string
                                  enum:
                                    - DEFAULT
                                    - PIYG
                                    - RDYLBU
                                    - CLASSIC
                                  default: DEFAULT
                                rollingAggregation:
                                  type: object
                                  properties:
                                    aggregator:
                                      type: string
                                      enum:
                                        - SUM
                                        - AVG
                                        - MAX
                                        - MIN
                                    window:
                                      type: object
                                      properties:
                                        preset:
                                          type: string
                                          enum:
                                            - MONTH
                                            - WEEK
                                        relativeDays:
                                          type: integer
                                          minimum: 1
                                  required:
                                    - aggregator
                                    - window
                                excludeGroupByValue:
                                  type: object
                                  properties:
                                    source:
                                      type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - indexation
                                      required:
                                        - type
                                      additionalProperties: false
                                  required:
                                    - source
                                  additionalProperties: false
                                  description: >-
                                    Exclude group-by values already present in
                                    the billing-stats indexation catalog before
                                    the query window. HTTP API only; not
                                    available on MCP query.
                                shiftAmount:
                                  type: integer
                                shiftUnit:
                                  type: string
                                  enum:
                                    - DAY
                                    - WEEK
                                    - MONTH
                              required:
                                - type
                                - aggregator
                                - whereClause
                                - name
                                - colorIndex
                                - chartType
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - usage
                                whereClause:
                                  type: object
                                  properties: {}
                                  additionalProperties: {}
                                aggregator:
                                  type: string
                                  enum:
                                    - SUM
                                    - AVG
                                    - MAX
                                    - MIN
                                groupBy:
                                  anyOf:
                                    - type: string
                                    - type: array
                                      items:
                                        type: string
                                        minLength: 1
                                    - nullable: true
                                      type: string
                                      enum:
                                        - null
                                metricId:
                                  type: string
                                extendDashboardConditions:
                                  type: boolean
                                  default: true
                                name:
                                  type: string
                                  pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                alias:
                                  type: string
                                  minLength: 1
                                  maxLength: 50
                                reducer:
                                  type: string
                                  enum:
                                    - SUM
                                    - AVG
                                    - MAX
                                    - MIN
                                visible:
                                  type: boolean
                                  default: true
                                colorIndex:
                                  type: number
                                chartType:
                                  type: string
                                  enum:
                                    - BAR
                                    - LINE
                                    - AREA
                                    - WATERFALL
                                    - TABLE
                                colorPalette:
                                  type: string
                                  enum:
                                    - DEFAULT
                                    - PIYG
                                    - RDYLBU
                                    - CLASSIC
                                  default: DEFAULT
                                rollingAggregation:
                                  type: object
                                  properties:
                                    aggregator:
                                      type: string
                                      enum:
                                        - SUM
                                        - AVG
                                        - MAX
                                        - MIN
                                    window:
                                      type: object
                                      properties:
                                        preset:
                                          type: string
                                          enum:
                                            - MONTH
                                            - WEEK
                                        relativeDays:
                                          type: integer
                                          minimum: 1
                                  required:
                                    - aggregator
                                    - window
                                excludeGroupByValue:
                                  type: object
                                  properties:
                                    source:
                                      type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - indexation
                                      required:
                                        - type
                                      additionalProperties: false
                                  required:
                                    - source
                                  additionalProperties: false
                                  description: >-
                                    Exclude group-by values already present in
                                    the billing-stats indexation catalog before
                                    the query window. HTTP API only; not
                                    available on MCP query.
                                shiftAmount:
                                  type: integer
                                shiftUnit:
                                  type: string
                                  enum:
                                    - DAY
                                    - WEEK
                                    - MONTH
                              required:
                                - type
                                - whereClause
                                - aggregator
                                - metricId
                                - name
                                - colorIndex
                                - chartType
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - budget
                                budgetId:
                                  type: string
                                budgetLineId:
                                  type: string
                                groupBy:
                                  anyOf:
                                    - type: string
                                    - type: array
                                      items:
                                        type: string
                                        minLength: 1
                                    - nullable: true
                                      type: string
                                      enum:
                                        - null
                                name:
                                  type: string
                                  pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                alias:
                                  type: string
                                  minLength: 1
                                  maxLength: 50
                                virtualDimensionValue:
                                  type: string
                                visible:
                                  type: boolean
                                  default: true
                                colorIndex:
                                  type: number
                                chartType:
                                  type: string
                                  enum:
                                    - BAR
                                    - LINE
                                    - AREA
                                    - WATERFALL
                                    - TABLE
                                colorPalette:
                                  type: string
                                  enum:
                                    - DEFAULT
                                    - PIYG
                                    - RDYLBU
                                    - CLASSIC
                                  default: DEFAULT
                                rollingAggregation:
                                  type: object
                                  properties:
                                    aggregator:
                                      type: string
                                      enum:
                                        - SUM
                                        - AVG
                                        - MAX
                                        - MIN
                                    window:
                                      type: object
                                      properties:
                                        preset:
                                          type: string
                                          enum:
                                            - MONTH
                                            - WEEK
                                        relativeDays:
                                          type: integer
                                          minimum: 1
                                  required:
                                    - aggregator
                                    - window
                                aggregator:
                                  type: string
                                  enum:
                                    - SUM
                                    - AVG
                                    - MAX
                                    - MIN
                                  default: SUM
                              required:
                                - type
                                - budgetId
                                - name
                                - colorIndex
                                - chartType
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - externalMetric
                                provider:
                                  type: string
                                  enum:
                                    - tsuga
                                    - bigquery
                                    - datadog
                                    - cloudwatch
                                    - s3
                                    - amplitude
                                    - snowflake
                                    - cloudmonitoring
                                    - push
                                integrationId:
                                  type: string
                                  minLength: 1
                                  description: >-
                                    External metric integration ID from
                                    list_metrics(includeExternal: true).
                                query:
                                  type: string
                                  minLength: 1
                                metricName:
                                  type: string
                                  default: ''
                                aggregator:
                                  type: string
                                  enum:
                                    - SUM
                                    - AVG
                                    - MAX
                                    - MIN
                                groupByFields:
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                                  maxItems: 7
                                  default: []
                                conditions:
                                  type: string
                                dateColumn:
                                  type: string
                                  minLength: 1
                                metricColumn:
                                  type: string
                                  minLength: 1
                                gapFillingMethod:
                                  type: string
                                  enum:
                                    - ZERO
                                    - FORWARD_FILL
                                    - LINEAR_INTERPOLATION
                                    - SPREAD
                                name:
                                  type: string
                                  pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                alias:
                                  type: string
                                  minLength: 1
                                  maxLength: 50
                                visible:
                                  type: boolean
                                  default: true
                                colorIndex:
                                  type: number
                                chartType:
                                  type: string
                                  enum:
                                    - BAR
                                    - LINE
                                    - AREA
                                    - WATERFALL
                                    - TABLE
                                colorPalette:
                                  type: string
                                  enum:
                                    - DEFAULT
                                    - PIYG
                                    - RDYLBU
                                    - CLASSIC
                                  default: DEFAULT
                                rollingAggregation:
                                  type: object
                                  properties:
                                    aggregator:
                                      type: string
                                      enum:
                                        - SUM
                                        - AVG
                                        - MAX
                                        - MIN
                                    window:
                                      type: object
                                      properties:
                                        preset:
                                          type: string
                                          enum:
                                            - MONTH
                                            - WEEK
                                        relativeDays:
                                          type: integer
                                          minimum: 1
                                  required:
                                    - aggregator
                                    - window
                                unitOverride:
                                  type: string
                              required:
                                - type
                                - provider
                                - integrationId
                                - name
                                - colorIndex
                                - chartType
                          discriminator:
                            propertyName: type
                      eventsFilter:
                        type: object
                        nullable: true
                        properties:
                          sources:
                            type: array
                            items:
                              type: string
                              enum:
                                - custom
                                - provider
                                - github
                                - api
                                - agent
                            default:
                              - custom
                              - api
                          githubSourceRepos:
                            type: array
                            items:
                              type: string
                            default: []
                          search:
                            type: string
                            default: ''
                      bookmarkedEvents:
                        type: array
                        items:
                          type: string
                      scopeId:
                        type: string
                        nullable: true
                      limitOverride:
                        type: integer
                        minimum: 1
                        maximum: 1000
                      displayOptions:
                        type: object
                        properties:
                          sort:
                            type: object
                            properties:
                              by:
                                type: string
                                minLength: 1
                              direction:
                                type: string
                                enum:
                                  - ASC
                                  - DESC
                                default: DESC
                            required:
                              - by
                          hideEmptyRows:
                            type: boolean
                          topN:
                            type: integer
                            minimum: 1
                            maximum: 100
                          showTotal:
                            type: boolean
                          precision:
                            type: integer
                            minimum: 0
                            maximum: 6
                          pivot:
                            type: object
                            properties:
                              rows:
                                type: array
                                items:
                                  type: string
                                  enum:
                                    - groupBy
                                    - query
                                    - time
                                minItems: 1
                              columns:
                                type: array
                                items:
                                  type: string
                                  enum:
                                    - groupBy
                                    - query
                                    - time
                                minItems: 1
                            required:
                              - rows
                              - columns
                            additionalProperties: false
                        additionalProperties: false
                    required:
                      - period
                      - queries
                      - bookmarkedEvents
                required:
                  - alertForm
                  - explorerRequest
            required:
              - id
              - name
              - description
              - type
              - icon
              - available
      required:
        - templates
    Unauthorized:
      type: object
      properties:
        error:
          type: string
          description: Unauthorized error message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or Clerk ak_* API key
      description: >-
        Send `Authorization: Bearer <credential>` using either a Clerk session
        JWT or a Clerk API key (`ak_*`). API keys may identify a user (`user_*`)
        or organization (`org_*`) principal and are generated in the Clerk
        Dashboard under API keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.