Skip to content

Update a scenario budget by external ID

PATCH
/scenarios/{scenario_id}/budgets/external/{external_id}/
curl --request PATCH \
--url https://app.commitly.com/api/scenarios/12459/budgets/external/ext-123457/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "amount": 777000 }'

Updates the budget with the given external_id in the given scenario. Send only the fields to change; see BudgetUpdate for how empty strings are handled. The response contains id and the fields that were sent.

external_id in the body is not required. If it differs from the path, the budget’s external_id is changed to the new value. Do not send scenario_id in the body; the scenario is taken from the path.

Note: Budgets of a committed plan cannot be updated or deleted (403). Other checks that the COMMITLY app applies may not apply to the API. Only change budgets that your integration created, for example by filtering on external_source (list parameter source).

scenario_id
required
integer

Scenario ID (id of a plan with type SCENARIO from GET /plans/).

Example
12459
external_id
required
string

The external_id set when the budget was created. Budgets whose external_id contains . or / cannot be addressed by this path. The trailing slash after the external_id is required.

Example
ext-123457

Only the fields to change.

Media typeapplication/json

Budget for partial update (PATCH). Send only the fields to change. Empty strings do not mean “unchanged”:

FieldEffect of ""
description, external_source, frequency, sequence_typeClears the field
account, inter_company, inter_categorySets the field to null
name, category, external_id400
Numbers (amount, rate, d, r, …), dates, booleans, lists400

Leave out fields you want to keep.

object
category

ID of a leaf category (a category without subcategories). A numeric string is also accepted.

integer
name
string
description
string
amount

Decimal with at most 12 digits and 2 decimal places. Negative for outflows, positive for inflows. A JSON number or a numeric string.

number | string
settlement_date
string format: date
tags
Array<string>
external_id

Your own ID for the budget; used in the /external/{external_id}/ paths. Unique per plan: the forecast and each scenario count as separate plans. Creating a budget with an external_id that already exists in the same plan returns 400. Do not use . or /. In an update, a value different from the current one changes the budget’s external_id.

string
external_source

Free-text name of the system that created the budget. Filter with the list parameter source.

string
account

Bank account ID.

integer | null
rate

Decimal rate with 4 decimal places. Default 0.

number | string
base

FS forecast and scenario (default), S scenario, F forecast.

string
Allowed values: FS S F
frequency

Recurrence period. Empty for a one-time budget.

string
Allowed values: daily weekly monthly quarterly yearly ""
frequency_multiplier

Repeat every N periods. Default 1.

integer
sequence_type

Series type of a recurring budget; AP arithmetic, GP geometric, HP harmonic, empty for none.

string
Allowed values: AP GP HP ""
sequence_term_size

Term size of the series. Default 1.

integer
d

Common difference of an arithmetic series. Default 0.

number
r

Common ratio of a geometric series. Default 1.

number
time_lags
Array<integer>
depending_categories

IDs of the categories the budget depends on.

Array<integer>
is_adjusted
boolean
is_indefinite

The recurring budget runs indefinitely.

boolean
inter_company

Company ID for an intercompany budget.

integer | null
inter_category

Category of the linked budget in the other company. Only valid together with inter_company.

integer | null
integration_tags

Tag list for integrations.

Array<string> | null
Example
{
"amount": 777000
}

Budget updated. The response contains id and the fields that were sent.

Media typeapplication/json

Budget as returned by the API.

object
id

Internal budget ID; used in the /budgets/{id}/ paths.

integer
category

Short form of a category, embedded in transactions and budgets.

object
id
integer
name
string
description
string
inter_category

Category of the linked budget in the other company.

integer | null
inter_category_name

Name of inter_category.

string | null
depending_categories

Categories the budget depends on.

Array
base_categories

Stored dependency categories (set via depending_categories).

Array
recurring_budget

Summary of the recurrence settings; null if the budget is not recurring.

object
frequency
string
frequency_multiplier
integer
sequence_type
string
sequence_term_size
integer
d
number
r
number
settlement_date
string format: date
start_date
string | null format: date
end_date
string | null format: date
account

Bank account ID.

integer | null
tags
Array<string>
integration_tags
Array<string> | null
is_adjusted
boolean
inter_budget

The linked budget in the other company of an intercompany budget, or null.

name
string
description
string
amount

Negative for outflows, positive for inflows.

number
rate
number
base

FS forecast and scenario, S scenario, F forecast.

string
Allowed values: FS S F
time_lags
Array<integer>
frequency
string
Allowed values: daily weekly monthly quarterly yearly ""
frequency_multiplier
integer
sequence_type
string
Allowed values: AP GP HP ""
sequence_term_size
integer
d
number
r
number
is_indefinite
boolean
external_id

Your own ID for the budget.

string | null
external_source

Free-text name of the system that created the budget.

string | null
inter_company

Company ID for an intercompany budget.

integer | null
source

ID of the budget this one was copied from, or null. Not related to external_source.

integer | null
Example
{
"id": 9002,
"amount": 777000
}

Invalid request body or parameters. The body lists the errors per field; errors not tied to a field are listed under non_field_errors. For request bodies that are arrays, the body is a list with one error object per item. Messages are localized (see Accept-Language).

Media typeapplication/json
One of:

Validation errors. Each key is a field of the request body; its value is the list of messages for that field. Errors not tied to a field are listed under non_field_errors.

object
non_field_errors
Array<string>
key
additional properties
Array<string>
Example
{
"settlement_date": [
"This field is required."
]
}

The access token is invalid or has expired. Request a new token. The message is localized (see Accept-Language).

Media typeapplication/json
object
detail
required

Error message.

string
code

Present only if the company’s edition does not include the function; value billing_plan_permission_denied.

string
Example
{
"detail": "Invalid token."
}
WWW-Authenticate
string

Authentication scheme, Bearer.

Example
Bearer

No access token was sent, or the credentials are not allowed to call this endpoint. If the company’s COMMITLY edition does not include the requested function, the body additionally contains "code": "billing_plan_permission_denied".

Media typeapplication/json
object
detail
required

Error message.

string
code

Present only if the company’s edition does not include the function; value billing_plan_permission_denied.

string
Example
{
"detail": "User must be authenticated to access this resource."
}

The resource does not exist or is not accessible with these credentials.

Media typeapplication/json
object
detail
required

Error message.

string
code

Present only if the company’s edition does not include the function; value billing_plan_permission_denied.

string
Examplegenerated
{
"detail": "example",
"code": "example"
}