---
title: "Create or replace a budget's custom forecast"
method: PUT
path: "/api/v2/cost/budget/custom-forecast"
tags: ["Cloud Cost Management"]
---

# Create or replace a budget's custom forecast

`PUT /api/v2/cost/budget/custom-forecast`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/cost/budget/custom-forecast`
- Auth: API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`

Create or replace the custom forecast for an existing budget.
Pass an empty `entries` list to delete the custom forecast for the budget.

## Request body

- CustomForecastUpsertRequest: Request body to upsert (create or replace) the custom forecast for a budget.
  - `data` CustomForecastUpsertRequestData, required: Custom forecast resource wrapper in an upsert request.
    - `attributes` CustomForecastUpsertRequestDataAttributes, required: Attributes of a custom forecast upsert request.
      - `budget_uid` string, required: The UUID of the budget that this custom forecast belongs to.
      - `entries` CustomForecastEntry[], required: Monthly custom forecast entries. An empty list deletes any existing custom forecast for the budget.
        - `amount` number, double, required: Forecast amount for the month.
        - `month` integer, required: Month the custom forecast entry applies to, in `YYYYMM` format.
        - `tag_filters` CustomForecastEntryTagFilter[], required: Tag filters that scope this custom forecast entry to specific resources.
          - `tag_key` string, required: The tag key to filter on.
          - `tag_value` string, required: The tag value to filter on.
    - `id` string: Unused on upsert; the resource is keyed by `budget_uid`. Send an empty string.
    - `type` 'custom_forecast', required: The type of the custom forecast resource. Must be `custom_forecast`.

## Response `200`

OK

- CustomForecastResponse: Response object containing the custom forecast for a budget.
  - `data` CustomForecastResponseData, required: Custom forecast resource wrapper in a response.
    - `attributes` CustomForecastResponseDataAttributes, required: Attributes of a custom forecast.
      - `budget_uid` string, required: The UUID of the budget that this custom forecast belongs to.
      - `created_at` integer, required: Timestamp the custom forecast was created, in Unix milliseconds.
      - `created_by` string, required: The id of the user that created the custom forecast.
      - `entries` CustomForecastEntry[], required: Monthly custom forecast entries.
        - `amount` number, double, required: Forecast amount for the month.
        - `month` integer, required: Month the custom forecast entry applies to, in `YYYYMM` format.
        - `tag_filters` CustomForecastEntryTagFilter[], required: Tag filters that scope this custom forecast entry to specific resources.
          - `tag_key` string, required: The tag key to filter on.
          - `tag_value` string, required: The tag value to filter on.
      - `updated_at` integer, required: Timestamp the custom forecast was last updated, in Unix milliseconds.
      - `updated_by` string, required: The id of the user that last updated the custom forecast.
    - `id` string, required: The unique identifier of the custom forecast.
    - `type` 'custom_forecast', required: The type of the custom forecast resource. Must be `custom_forecast`.

## Other responses

- `400`: Bad Request
- `404`: Not Found
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
