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

# Update budget

Update an existing budget. Only the fields included in the request body are modified; omitted fields remain unchanged.

Common updates include adjusting the target amount, modifying scopes, updating subscriber lists, or changing threshold percentages.

A hierarchical budget's allocations must cover exactly the values of the scope they split, after the update as well as before it. To add or remove a value, send `scopes` in the same request as `hierarchicalAmount`, or, for a variable budget, as `periods` covering every current and future period. An update that leaves them mismatched fails with 400 and changes nothing.

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. Supplied `linkedReports` replaces the full list; [] clears links and omission retains them. Internal links use a reportID; external links use a name and URL.

`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.

The built-in Budget Report is separate from these added links and cannot be removed through linkedReports.

# 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"
        ]
      },
      "UpdateBudgetResponseBody": {
        "type": "object",
        "properties": {
          "budgetID": {
            "type": "string",
            "description": "Budget ID"
          }
        },
        "required": [
          "budgetID"
        ]
      },
      "UpdateBudgetRequestBody": {
        "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. Omit on PATCH to retain the saved period; creation defaults to a calendar month."
          },
          "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"
          },
          "linkedReports": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "internal"
                      ]
                    },
                    "reportID": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Linked Ternary report ID"
                    }
                  },
                  "required": [
                    "type",
                    "reportID"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "external"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Linked report name"
                    },
                    "url": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Linked report URL"
                    }
                  },
                  "required": [
                    "type",
                    "name",
                    "url"
                  ]
                }
              ]
            },
            "description": "Complete replacement list of linked reports. Omit to retain links; send [] to clear them. Internal links use reportID; external links use a nonempty name without HTML and an http(s) URL or a relative path starting with a single slash."
          }
        }
      }
    }
  },
  "paths": {
    "/budgets/{budgetID}": {
      "patch": {
        "summary": "Update budget",
        "tags": [
          "Budget"
        ],
        "operationId": "updateBudget",
        "description": "Update an existing budget. Only the fields included in the request body are modified; omitted fields remain unchanged.\n\nCommon updates include adjusting the target amount, modifying scopes, updating subscriber lists, or changing threshold percentages.\n\nA hierarchical budget's allocations must cover exactly the values of the scope they split, after the update as well as before it. To add or remove a value, send `scopes` in the same request as `hierarchicalAmount`, or, for a variable budget, as `periods` covering every current and future period. An update that leaves them mismatched fails with 400 and changes nothing.\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. Supplied `linkedReports` replaces the full list; [] clears links and omission retains them. Internal links use a reportID; external links use a name and URL.\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.\n\nThe built-in Budget Report is separate from these added links and cannot be removed through linkedReports.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "description": "Unique budget ID",
              "example": "GExrxkUSjvnqKQ0Njedf"
            },
            "required": true,
            "description": "Unique budget ID",
            "name": "budgetID",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBudgetRequestBody"
              },
              "examples": {
                "updateBudget": {
                  "value": {
                    "amount": 110,
                    "isVariable": true,
                    "measure": "FOCUS_SPEC_FIELD/BilledCost",
                    "name": "Updated budget demo",
                    "period": {
                      "granularity": "MONTH",
                      "type": "CALENDAR"
                    },
                    "newPeriodVersions": [
                      {
                        "amount": 0,
                        "highlighted": true,
                        "month": "2134-02"
                      }
                    ],
                    "scopes": [
                      {
                        "key": "FOCUS_SPEC_FIELD/ProviderName",
                        "values": [
                          "Google Cloud"
                        ]
                      }
                    ],
                    "subscribers": {
                      "externalEmails": [],
                      "includeAllUsers": true,
                      "userIDs": []
                    },
                    "thresholds": [
                      {
                        "percent": 500,
                        "spendBasis": "actualSpend",
                        "limitVersions": [
                          "LATEST"
                        ],
                        "warningType": "MONTHLY_SPEND"
                      }
                    ],
                    "updatedPeriodVersions": [
                      {
                        "id": "ABxrxkUSjvnqKQ0Njedf",
                        "highlighted": true,
                        "month": "7744-02"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateBudgetResponseBody"
                },
                "examples": {
                  "updateBudget": {
                    "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"
      ]
    }
  ]
}
```