---
updatedAt: 2026-04-21T03:40:36.000Z
agentTools:
  projectIndex: https://docs.ternary.app/llms.txt
---

# Create budget

Create a new budget to track cloud spending.

Budgets monitor actual spend against a target amount and notify subscribers when configurable thresholds are breached. Three amount types are supported:

- **Specified amount** — A fixed dollar value for each period.
- **Variable amount** — Each `periods` entry supplies an amount for one period of the budget's cadence. Use `key`: YYYY-MM for months, YYYY-Qn for quarters, YYYY for years, or FYyyyy-Mn, FYyyyy-Qn, and FYyyyy for fiscal periods (month and quarter are unpadded). The legacy `month` field is only for calendar-month budgets.
- **Hierarchical amount** — Dimension-level allocations within the total.

Returns the `budgetID` of the newly created budget.

Threshold cadence must fit the resulting budget period: MONTH permits DAILY_SPEND and MONTHLY_SPEND; QUARTER also permits QUARTERLY_SPEND; YEAR also permits YEARLY_SPEND. Forecasted spend is allowed only for the threshold matching the full budget period; shorter daily/checkpoint thresholds use actual spend. These rules also apply to sub-budget alerts. `percent` is a numeric percentage, not a monetary amount.

`limitVersions` selects LATEST or HIGHLIGHTED budget amounts. Actual daily/checkpoint spend is compared with a percentage of the whole budget-period amount. Numeric percent is not restricted to the UI editor's 1–100 range. Incompatible cadence/forecast rules return 400 without changing the budget.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Core API",
    "description": "Ternary Resource Management API",
    "version": "1.0.0",
    "contact": {},
    "license": {
      "name": "MIT",
      "identifier": "MIT"
    }
  },
  "tags": [
    {
      "name": "Budget",
      "description": "Manage budgets for tracking cloud spending."
    }
  ],
  "servers": [
    {
      "url": "https://core-api.ternary.app/api",
      "description": "Core API"
    },
    {
      "url": "https://core-api.eu.ternary.app/api",
      "description": "Core API (EU)"
    }
  ],
  "externalDocs": {
    "description": "Raw JSON",
    "url": "https://core-api.ternary.app/api/docs.json"
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "ProviderType": {
        "type": "string",
        "enum": [
          "ALIBABA",
          "AWS",
          "AZURE",
          "CUSTOM_DATA",
          "DATABRICKS",
          "FOCUS",
          "GCP",
          "KUBERNETES",
          "MONGO_DB",
          "OCI",
          "SNOWFLAKE",
          "TERNARY"
        ],
        "description": "The provider a dimension or measure belongs to — a cloud provider, a third-party data source, or Ternary itself."
      },
      "FailureResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "HTTP status code",
            "example": "400 - Bad Request"
          },
          "message": {
            "type": "string",
            "description": "Error message",
            "example": "ERROR_INVALID_PARAMS"
          },
          "reason": {
            "type": "string",
            "description": "Error reason code"
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "CreateBudgetResponseBody": {
        "type": "object",
        "properties": {
          "budgetID": {
            "type": "string",
            "description": "Unique budget ID"
          }
        },
        "required": [
          "budgetID"
        ]
      },
      "CreateBudgetRequestBody": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "tenantID": {
                "type": "string",
                "format": "uuid",
                "description": "A unique identifier for an organization",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                "example": "92f36764-5af2-4ff5-a494-d841f32040be"
              }
            },
            "required": [
              "tenantID"
            ]
          },
          {
            "type": "object",
            "properties": {
              "amount": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Dollar value of the budget"
              },
              "hierarchicalAmount": {
                "type": "object",
                "properties": {
                  "dimension": {
                    "type": "object",
                    "properties": {
                      "displayName": {
                        "type": "string",
                        "minLength": 1
                      },
                      "providerType": {
                        "$ref": "#/components/schemas/ProviderType"
                      },
                      "schemaName": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "displayName",
                      "providerType",
                      "schemaName"
                    ]
                  },
                  "allocations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "dimensionValue": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "percentage": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "dimensionValue",
                        "amount",
                        "percentage"
                      ]
                    }
                  }
                },
                "required": [
                  "dimension",
                  "allocations"
                ]
              },
              "isVariable": {
                "type": "boolean",
                "description": "Whether the budget uses variable amounts by period. When true, a top-level numeric amount is rejected; this does not mean a fixed recurring amount."
              },
              "measure": {
                "type": "string",
                "minLength": 1,
                "description": "Budget measure"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "description": "Budget name"
              },
              "period": {
                "type": "object",
                "properties": {
                  "granularity": {
                    "type": "string",
                    "enum": [
                      "MONTH",
                      "QUARTER",
                      "YEAR"
                    ],
                    "description": "Budget period cadence"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "CALENDAR",
                      "FISCAL"
                    ],
                    "description": "Calendar the period is aligned to"
                  }
                },
                "required": [
                  "granularity",
                  "type"
                ],
                "description": "Budget period; a calendar month when omitted"
              },
              "periods": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "type": "number",
                      "description": "Amount for the period"
                    },
                    "highlighted": {
                      "type": "boolean",
                      "description": "Period highlighted"
                    },
                    "key": {
                      "type": "string",
                      "pattern": "^(?:\\d{4}(?:-(?:0[1-9]|1[0-2]|Q[1-4]))?|FY\\d{4}(?:-(?:M(?:[1-9]|1[0-2])|Q[1-4]))?)$",
                      "description": "Period key - calendar YYYY, YYYY-MM or YYYY-Qn; fiscal FYyyyy, FYyyyy-Mn or FYyyyy-Qn, with the month or quarter unpadded (FY2026-M7); a calendar month may be given as month instead"
                    },
                    "month": {
                      "type": "string",
                      "pattern": "^\\d{4}-(?:0[1-9]|1[0-2])$",
                      "description": "Calendar month; use key for a quarter or year"
                    },
                    "hierarchicalAmount": {
                      "type": "object",
                      "properties": {
                        "dimension": {
                          "type": "object",
                          "properties": {
                            "displayName": {
                              "type": "string",
                              "minLength": 1
                            },
                            "providerType": {
                              "$ref": "#/components/schemas/ProviderType"
                            },
                            "schemaName": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "displayName",
                            "providerType",
                            "schemaName"
                          ]
                        },
                        "allocations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "dimensionValue": {
                                "type": "string"
                              },
                              "amount": {
                                "type": "number"
                              },
                              "percentage": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "dimensionValue",
                              "amount",
                              "percentage"
                            ]
                          }
                        }
                      },
                      "required": [
                        "dimension",
                        "allocations"
                      ],
                      "description": "Hierarchical amount for the period"
                    }
                  },
                  "required": [
                    "highlighted"
                  ]
                },
                "description": "Period versions"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Scope key"
                    },
                    "values": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Scope value"
                    }
                  },
                  "required": [
                    "key",
                    "values"
                  ]
                },
                "minItems": 1
              },
              "slackChannelIDs": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "description": "Slack channel IDs to receive budget notifications"
              },
              "subscribers": {
                "type": "object",
                "properties": {
                  "externalEmails": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "User emails"
                  },
                  "includeAllUsers": {
                    "type": "boolean",
                    "description": "All users or specific users"
                  },
                  "userIDs": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "User IDs"
                  }
                },
                "required": [
                  "externalEmails",
                  "includeAllUsers",
                  "userIDs"
                ]
              },
              "thresholds": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "limitVersions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Threshold alert versions"
                    },
                    "percent": {
                      "type": "number",
                      "description": "Threshold alert percent"
                    },
                    "spendBasis": {
                      "type": "string",
                      "description": "Threshold alert spend basis"
                    },
                    "warningType": {
                      "type": "string",
                      "enum": [
                        "DAILY_SPEND",
                        "MONTHLY_SPEND",
                        "QUARTERLY_SPEND",
                        "YEARLY_SPEND"
                      ],
                      "description": "Threshold warning type"
                    }
                  },
                  "required": [
                    "limitVersions",
                    "percent",
                    "spendBasis",
                    "warningType"
                  ]
                }
              },
              "webhookIDs": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "description": "Webhook ID",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                  "example": "92f36764-5af2-4ff5-a494-d841f32040be"
                },
                "maxItems": 10,
                "uniqueItems": true,
                "description": "Webhook IDs to receive budget notifications"
              }
            },
            "required": [
              "measure",
              "name",
              "scopes",
              "subscribers",
              "thresholds"
            ]
          }
        ]
      }
    }
  },
  "paths": {
    "/budgets": {
      "post": {
        "summary": "Create budget",
        "tags": [
          "Budget"
        ],
        "operationId": "createBudget",
        "description": "Create a new budget to track cloud spending.\n\nBudgets monitor actual spend against a target amount and notify subscribers when configurable thresholds are breached. Three amount types are supported:\n\n- **Specified amount** — A fixed dollar value for each period.\n- **Variable amount** — Each `periods` entry supplies an amount for one period of the budget's cadence. Use `key`: YYYY-MM for months, YYYY-Qn for quarters, YYYY for years, or FYyyyy-Mn, FYyyyy-Qn, and FYyyyy for fiscal periods (month and quarter are unpadded). The legacy `month` field is only for calendar-month budgets.\n- **Hierarchical amount** — Dimension-level allocations within the total.\n\nReturns the `budgetID` of the newly created budget.\n\nThreshold cadence must fit the resulting budget period: MONTH permits DAILY_SPEND and MONTHLY_SPEND; QUARTER also permits QUARTERLY_SPEND; YEAR also permits YEARLY_SPEND. Forecasted spend is allowed only for the threshold matching the full budget period; shorter daily/checkpoint thresholds use actual spend. These rules also apply to sub-budget alerts. `percent` is a numeric percentage, not a monetary amount.\n\n`limitVersions` selects LATEST or HIGHLIGHTED budget amounts. Actual daily/checkpoint spend is compared with a percentage of the whole budget-period amount. Numeric percent is not restricted to the UI editor's 1–100 range. Incompatible cadence/forecast rules return 400 without changing the budget.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBudgetRequestBody"
              },
              "examples": {
                "createBudget": {
                  "value": {
                    "amount": 10000,
                    "tenantID": "92f36764-5af2-4ff5-a494-d841f32040be",
                    "isVariable": false,
                    "measure": "FOCUS_SPEC_FIELD/BilledCost",
                    "name": "Budget Demo",
                    "period": {
                      "granularity": "MONTH",
                      "type": "CALENDAR"
                    },
                    "periods": [],
                    "scopes": [
                      {
                        "key": "FOCUS_SPEC_FIELD/ProviderName",
                        "values": [
                          "AWS"
                        ]
                      }
                    ],
                    "subscribers": {
                      "includeAllUsers": true,
                      "userIDs": [],
                      "externalEmails": []
                    },
                    "thresholds": [
                      {
                        "percent": 500,
                        "spendBasis": "actualSpend",
                        "limitVersions": [
                          "LATEST"
                        ],
                        "warningType": "MONTHLY_SPEND"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBudgetResponseBody"
                },
                "examples": {
                  "createBudget": {
                    "value": {
                      "budgetID": "GExrxkUSjvnqKQ0Njedf"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResponse"
                },
                "examples": {
                  "400Response": {
                    "value": {
                      "code": "400 - Bad Request",
                      "message": "ERROR_INVALID_PARAMS"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResponse"
                },
                "examples": {
                  "401Response": {
                    "value": {
                      "code": "401 - Unauthorized",
                      "message": "ERROR_UNAUTHORIZED"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResponse"
                },
                "examples": {
                  "403Response": {
                    "value": {
                      "code": "403 - Forbidden",
                      "message": "ERROR_PERMISSION_DENIED"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-tagGroups": [
    {
      "name": "Core API",
      "tags": [
        "Alert Rule",
        "Alert Rule Events",
        "API Keys",
        "AWS Rate Recommendations",
        "Azure Rate Recommendations",
        "Billing Rules",
        "Budget",
        "Cases",
        "Cost Alerts",
        "Custom Label",
        "Custom Measures",
        "Data Integration",
        "Data Integration: Alibaba",
        "Data Integration: AWS",
        "Data Integration: Azure",
        "Data Integration: Custom Data",
        "Data Integration: Databricks",
        "Data Integration: GCP",
        "Data Integration: Oracle",
        "Data Integration: Snowflake",
        "Dimension Preferences",
        "GCP Rate Recommendations",
        "Integrations",
        "Label Map",
        "MCP Availability",
        "MCP Client Usage",
        "Measure Preferences",
        "MSP Billing Information",
        "MSP Child",
        "MSP Shared Payer Integrations",
        "MSP Tenant Settings",
        "Permissions",
        "Ramp Plans",
        "Report",
        "Resource Subscriptions",
        "Role",
        "Savings Opportunity Filter",
        "Scoped View",
        "Support Tickets",
        "Tenant",
        "Tenant SSO Config",
        "Usage Recommendations",
        "User",
        "User Group Config"
      ]
    }
  ]
}
```