Objectives API
Endpoints
Section titled “Endpoints”GET /api/objectives
Section titled “GET /api/objectives”List all objectives with nested priorities and KPI counts.
Permission: view:objectives
GET /api/objectives/:id
Section titled “GET /api/objectives/:id”Get a single objective with its priorities and KPI definitions.
Permission: view:objectives
GET /api/objectives/kpis/mine
Section titled “GET /api/objectives/kpis/mine”Get KPI definitions applicable to the current user (company-wide + user’s access level). Only includes KPIs under active priorities.
Permission: view:objectives
POST /api/objectives
Section titled “POST /api/objectives”Create a new business objective.
Permission: manage:objectives
Body:
{ "category": "financial", "title": "Financial Performance", "description": "Optional description", "sort_order": 0}Category must be one of: financial, customer, operational, people.
PUT /api/objectives/:id
Section titled “PUT /api/objectives/:id”Update an objective.
Permission: manage:objectives
DELETE /api/objectives/:id
Section titled “DELETE /api/objectives/:id”Delete an objective and all its priorities and KPIs (cascade).
Permission: manage:objectives
POST /api/objectives/:id/priorities
Section titled “POST /api/objectives/:id/priorities”Create a priority under an objective.
Permission: manage:objectives
Body:
{ "title": "Control Project Costs", "description": "Optional description", "is_active": true, "sort_order": 0}PUT /api/objectives/priorities/:id
Section titled “PUT /api/objectives/priorities/:id”Update a priority.
Permission: manage:objectives
DELETE /api/objectives/priorities/:id
Section titled “DELETE /api/objectives/priorities/:id”Delete a priority and all its KPIs (cascade).
Permission: manage:objectives
POST /api/objectives/priorities/:id/kpis
Section titled “POST /api/objectives/priorities/:id/kpis”Create a KPI definition under a priority.
Permission: manage:objectives
Body:
{ "name": "Budget Variance", "target": "≤10%", "unit": "%", "access_level": null, "sort_order": 0}access_level is optional — null means company-wide, or set to a specific level (executive, head, manager, lead, employee).
PUT /api/objectives/kpis/:id
Section titled “PUT /api/objectives/kpis/:id”Update a KPI definition.
Permission: manage:objectives
DELETE /api/objectives/kpis/:id
Section titled “DELETE /api/objectives/kpis/:id”Delete a KPI definition.
Permission: manage:objectives
Scorecard Integration
Section titled “Scorecard Integration”GET /api/scorecards/available-kpis
Section titled “GET /api/scorecards/available-kpis”Returns KPI definitions applicable to the current user, enriched with objective and priority breadcrumb info. Used by the scorecard UI to preview which KPIs will appear.
Permission: view:scorecards