Projects

create-budget-tool

Create a budget under a project.

Creates a new budget on the given project. budget and spendable are stored as minutes.

Inputs

NameTypeRequiredDescription
project_idintegeryesParent project id.
descriptionstringyesBudget description (max 255).
budgetinteger (minutes)yesBudget value, ≥0.
spendableinteger (minutes)noSpendable value, ≥0. Defaults to 0.
start_datestring (Y-m-d) | nullnoBudget start date.
end_datestring (Y-m-d) | nullnoBudget end date. Must be on or after start_date.
statusstringnoOne of active, inactive, blocked. Defaults to active.
is_openbooleannoDefaults to true.
is_billablebooleannoDefaults to true.
budget_group_idinteger | nullnoOptional budget group id.

Permissions

  • budgets::create.
  • The caller must also pass the project policy's view gate for the parent project.

Example

{
  "project_id": 7,
  "description": "Implementation budget",
  "budget": 4800
}

Response

The created budget, in the same shape as a row from list-budgets-tool.

Errors

  • A missing required field returns a validation error.
  • An invalid status value returns a validation error.
  • A non-existent project_id returns a validation error.
  • Missing budgets::read (project view gate) or budgets::create returns an authorization error.

On this page