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
| Name | Type | Required | Description |
|---|---|---|---|
project_id | integer | yes | Parent project id. |
description | string | yes | Budget description (max 255). |
budget | integer (minutes) | yes | Budget value, ≥0. |
spendable | integer (minutes) | no | Spendable value, ≥0. Defaults to 0. |
start_date | string (Y-m-d) | null | no | Budget start date. |
end_date | string (Y-m-d) | null | no | Budget end date. Must be on or after start_date. |
status | string | no | One of active, inactive, blocked. Defaults to active. |
is_open | boolean | no | Defaults to true. |
is_billable | boolean | no | Defaults to true. |
budget_group_id | integer | null | no | Optional budget group id. |
Permissions
budgets::create.- The caller must also pass the project policy's
viewgate 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
statusvalue returns a validation error. - A non-existent
project_idreturns a validation error. - Missing
budgets::read(project view gate) orbudgets::createreturns an authorization error.