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

# Update budgets

> Update an existing budget's features. For example, to turn currency alignment on.

Update an existing budget's features. For example, to turn currency alignment on.

## Update a budget's details

<Note>
  **PATCH** `/v2/budgets/{budgetId}`
</Note>

### Request

Use this request to update an existing budget's features.

<Info>
  You'll only be able to turn on (set to `true`) a feature that is already enabled on the account.
</Info>

<Info>
  Your request body must contain at least one property. You can update `feature`, `name`, and `allowCurrencyAlignment`. Other properties such as `type`, `parentId`, `personaId`, `status`, and `currencies` cannot be changed after a budget is created.
</Info>

<Info>
  There is no endpoint to delete a budget. Budgets are a permanent part of your account structure.
</Info>

<CodeGroup>
  ```bash Sample request theme={null}
  curl -i -X PATCH \
    'https://api.equalsmoney.com/v2/budgets?accountId=F12345' \
    -H 'Authorization: ApiKey YOUR_API_KEY_HERE' \
    -H 'Content-Type: application/json' \
    -d '{
      "feature": {
        "payments": true,
        "budgetCards": true,
        "peopleCards": true
      },
      "name": "Team Party",
      "allowCurrencyAlignment": false
    }'
  ```

  ```bash Request structure theme={null}
  curl -i -X PATCH \
    'https://api.equalsmoney.com/v2/budgets?accountId={accountId}' \
    -H 'Authorization: ApiKey YOUR_API_KEY_HERE' \
    -H 'Content-Type: application/json' \
    -d '{
      "feature": {
        "payments": boolean,
        "budgetCards": boolean,
        "peopleCards": boolean
      },
      "name": "string",
      "allowCurrencyAlignment": boolean
    }'
  ```
</CodeGroup>

#### Query parameters

<ParamField body="accountId" type="string" required>
  The ID of the account associated with the budget you're updating.

  Allowable values: An existing `accountId`
</ParamField>

#### Request body schema

<ParamField body="feature" type="object" required>
  Details about the feature(s) to enable for this budget.

  Allowable values: A valid `features` object containing the following fields: `payments`, `peopleCards`, `budgetCards`
</ParamField>

<ParamField body="name" type="string">
  The name or new name of the budget. Depending on your configuration, this might appear as the payee name.

  Allowable values: ≤ 75 characters
</ParamField>

<ParamField body="allowCurrencyAlignment" type="boolean">
  Whether or not currency alignment is enabled for the budget. Currency alignment allows a cardholder to pay in a currency that is different from the budget's currency, with Equals doing the conversion.

  Allowable values: `true`, `false`
</ParamField>

### Response

If your request is successful, you'll receive a `200` response.

<CodeGroup>
  ```json Sample response theme={null}
  {
    "id": "f5b20908-2853-442a-960f-b23b6dcd4c39",
    "accountId": "F12345",
    "parentId": "5f587ee0-8a27-4cba-b586-b511b9c13033",
    "boxId": "e9b7b39a-9108-46fa-882b-b09bad71ac38",
    "name": "Test Budget",
    "type": "individual",
    "status": "active",
    "allowCurrencyAlignment": false,
    "createdAt": "2024-01-04T17:17:47.000Z",
    "updatedAt": "2024-01-04T17:17:47.000Z",
    "feature": [
      {
        "id": "b44b0da9-a431-44d2-9684-1049fa2e1f9e",
        "budgetId": "f5b20908-2853-442a-960f-b23b6dcd4c39",
        "payments": true,
        "budgetCards": true,
        "peopleCards": true,
        "forwardDeposits": false,
        "createdAt": "2024-01-04T17:17:47.000Z",
        "updatedAt": "2024-01-04T17:17:47.000Z",
        "BudgetId": "f5b20908-2853-442a-960f-b23b6dcd4c39"
      }
    ],
    "currency": [
      {
        "createdAt": "2024-01-04T17:17:47Z",
        "updatedAt": "2024-01-04T17:17:47Z",
        "id": "03416e62-a103-45f0-b6e2-8cb00b824326",
        "budgetId": "f5b20908-2853-442a-960f-b23b6dcd4c39",
        "boxCurrencyId": null,
        "currencyCode": "USD",
        "local": "unique",
        "international": "unique", 
        "BudgetId": "f5b20908-2853-442a-960f-b23b6dcd4c39"
      }
    ],
    "balance": [
      {
        "currency": "USD",
        "pendingBalance": 0,
        "ledgerAndAllocatedBalance": 0,
        "id": "8af2877b-d010-495b-b648-e1f113cf3984",
        "budgetId": "140111b6-2ff9-498a-a9ca-26ee324dfa2f",
        "currencyCode": "USD",
        "ledgerBalance": 0,
        "availableBalance": 0,
        "lastUpdatedSequentialId": 0,
        "createdAt": "2024-01-08T10:40:43.000Z",
        "updatedAt": "2024-01-09T11:01:46.000Z",
        "BudgetId": "140111b6-2ff9-498a-a9ca-26ee324dfa2f"
      }
    ]
  }
  ```

  ```json Payload structure theme={null}
  {
    "id": "string",
    "accountId": "string",
    "parentId": "string",
    "boxId": "string",
    "name": "string",
    "type": "string",
    "status": "string",
    "allowCurrencyAlignment": boolean,
    "createdAt": "string",
    "updatedAt": "string",
    "feature": [
      {
        "id": "string",
        "budgetId": "string",
        "payments": boolean,
        "budgetCards": boolean,
        "peopleCards": boolean,
        "forwardDeposits": boolean,
        "createdAt": "string",
        "updatedAt": "string",
        "BudgetId": "string",
      }
    ],
    "currency": [
      {
        "createdAt": "string",
        "updatedAt": "string",
        "id": "string",
        "budgetId": "string",
        "boxCurrencyId": null,
        "currencyCode": "string",
        "local": "string",
        "international": "string", 
        "BudgetId": "string"
      }
    ],
    "balance": [
      {
        "currency": "string",
        "pendingBalance": number,
        "ledgerAndAllocatedBalance": number,
        "id": "string",
        "budgetId": "string",
        "currencyCode": "string",
        "ledgerBalance": number,
        "availableBalance": number,
        "lastUpdatedSequentialId": number,
        "createdAt": "string",
        "updatedAt": "string",
        "BudgetId": "string"
      }
    ]
  }
  ```
</CodeGroup>

### Error responses

If your request is unsuccessful, you'll receive one of the following error responses.

```json 404 — Budget not found theme={null}
{
  "path": "/v2/budgets/f5b20908-2853-442a-960f-b23b6dcd4c39",
  "message": "budget not found"
}
```

```json 400 — Cannot update budget type theme={null}
{
  "path": "/v2/budgets/f5b20908-2853-442a-960f-b23b6dcd4c39",
  "message": "budget type: accountBalance cannot be updated"
}
```

```json 400 — Budget name cannot be updated theme={null}
{
  "path": "/v2/budgets/f5b20908-2853-442a-960f-b23b6dcd4c39",
  "message": "Budget name cannot be updated when useBalanceName is enabled"
}
```

For more detailed information about this request and its response, [see the API reference](/api-reference/budgets/update-a-budgets-details).
