---
title: "Auto-generate budgets"
method: POST
path: "/users/{user_guid}/budgets/generate"
tags: ["budgets"]
---

# Auto-generate budgets

`POST /users/{user_guid}/budgets/generate`

This endpoint will automatically create budgets for several categories based on existing transactions; these budgets are returned as an array. Specifically, budgets will only be generated if the `user` has at least one `transaction` in a given category during each of the two previous calendar months. For example, if the request is made on March 6, and there is at least one "Bills & Utilities" `transaction` in both January and February, a budget will be generated for "Bills & Utilities." If there are two "Bills & Utilities" transactions in February but none in January, no budget will be generated for that category. If budgets already exist for particular categories, new budgets will be generated and returned based on the available transactions. If one or more budgets remain unchanged, they will nevertheless be returned in the response. If no transaction data for the `user` meet the above criteria, a `422 Unprocessable Entity` error will be returned with status code 4221 along with the message, `There aren't enough transactions to automatically create any budgets`.

## Path parameters

- `user_guid` string, required

## Response `200`

OK

- BudgetResponseBody
  - `budget` BudgetResponse
    - `amount` number — A goal amount set by the user for a category's transaction total during a month.
    - `category_guid` string — Unique identifier for the budget category. Defined by MX.
    - `created_at` string — Date and time the budget was created, represented in ISO 8601 format with timestamp.
    - `guid` string — Unique identifier for the budget. Defined by MX.
    - `is_exceeded` boolean — If the budget has been exceeded, this field will be true. Otherwise, this field will be false.
    - `is_off_track` boolean — If the budget is off track, this field will be true. Otherwise, this field will be false.
    - `metadata` string, nullable — Additional information a partner can store on the budget.
    - `name` string, nullable — The name of the budget that is visible to the user (ie "Food", "Bills", "Entertainment", etc).
    - `off_track_percentage` number, nullable — The percentage amount of off track spending. (Deprecated).
    - `parent_guid` string, nullable — Unique identifier for the parent budget. Defined by MX.
    - `percent_spent` number, nullable — The percentage of a budget that has been spent during the current calendar month Calculated as the transaction total divided by the amount and then multiplied by 100.A value of zero will be returned when `amount` is zero.
    - `projected_spending` number — The projected amount of spending for the budget.
    - `revision` integer — The revision number of this budget record.
    - `transaction_total` unknown
    - `updated_at` string — Date and time the budget was updated, represented in ISO 8601 format with timestamp.
    - `user_guid` string — Unique identifier for the user. Defined by MX.

## Changes

> 29 revisions in range; 1 not diffed.

- **2024-08-14** `471bc9021d67` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/mx/apis/mx-platform-api/changes/users/:user_guid/budgets/generate/post.md)

---

[API](https://skmtc.dev/mx/apis/mx-platform-api.md) · [All operations](https://skmtc.dev/mx/apis/mx-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mx/mx-platform-api/revisions/bd74a0a2d8a9/schema)
