POST run_allocation
Create and execute an Allocation Run for a given fiscal period.
Endpoint
POST /api/method/konsol.api.run_allocation
Authentication: Required (Frappe session cookie)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fiscal_year | integer | Yes | Fiscal year (e.g., 2025) |
fiscal_period | integer | Yes | Fiscal period (1–12) |
What Happens
- Creates a new Allocation Run document
- Submits it (triggers
before_submit):allocation_run_idset to the document namerun_byset to the current userrun_atset to the current timestampstatusset directly to "Active"
- Syncs to ClickHouse (
epm_staging.allocation_runs)
The endpoint does not invoke dbt. The allocation gold models (gold_allocation_results, built from the multi-step allocation engine) read from epm_staging.allocation_runs on their next run; gold_allocation_results itself applies no status filter.
Response
{
"message": {
"name": "ARUN-2025-P6-0001",
"allocation_run_id": "ARUN-2025-P6-0001",
"status": "Active",
"run_by": "admin@example.com",
"run_at": "2025-06-09 14:30:00"
}
}
Example
curl -X POST http://localhost:8069/api/method/konsol.api.run_allocation \
-H "Content-Type: application/json" \
-b "cookies.txt" \
-d '{"fiscal_year": 2025, "fiscal_period": 6}'
Workflow Context
Draft ──[Run Allocation]──→ Active ──[Reverse]──→ Reversed
See also: reverse_allocation, allocation_history