Align an objective to parent objectives
Code Mode: praxis.workforce.objectives.parents.update
HTTP: PUT /workforce/v1/objectives/{id}/parents
Replaces the whole set of parent objectives this objective contributes to; send an empty parents array to remove its alignment. An objective aligns only upward: each parent must hang on the objective’s own department or on a department above it, the objective cannot be its own parent, and the alignment graph must stay free of cycles. Each weight is greater than 0 and at most 1, and a parent may appear once. A closed parent is refused. Requires an organization owner or admin, or the head of the objective’s home department or of a department above it. Errors: 400 INVALID_PARAMS for a weight outside the range, a repeated parent or an unknown body field; 400 ALIGNMENT_CYCLE when a parent is the objective itself or the alignment would loop; 400 SCOPE_MISMATCH when a parent hangs outside the objective’s department and its ancestors; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND for the objective or a parent; 409 PERIOD_CLOSED when a parent is closed. Example body: {“parents”:[{“objective_id”:“obj_3b7a52c1e9d84f06b2a1c8e4d7f50a96”,“weight”:1}]}.
Signature
praxis.workforce.objectives.parents.update(args:{path:{id:string};body:{/** The complete set of parents the objective aligns to, replacing the current one; an empty array removes its alignment. */ parents:Array<{/** Id of a parent objective (obj_...) on the objective's own department or a department above it; each parent once. e.g. "obj_3b7a52c1e9d84f06b2a1c8e4d7f50a96" */ objective_id:string;/** Share of the parent this objective carries, greater than 0 and at most 1. e.g. 1 */ weight:number}>}}):Promise<{/** Objective id (obj_...); use it as objective_id and in parents. */ id:string;/** Id of the organization that owns the objective. */ organization_id:string;/** Id of the period (prd_...) the objective was set in. */ period_id:string;scope:{/** Whether the objective hangs on a department or on a position. e.g. "department" */ kind:"department"|"position";/** Id of the department (dept_...) or position (pos_...) that kind names. e.g. "dept_4c2e9a17d0b34f58a6e1b3c7d9f20e84" */ id:string};/** Objective title, 1 to 200 characters. */ title:string;/** Objective description, up to 2000 characters; empty when none was given. */ description:string;/** Objectives this one aligns to, with weights; empty when it aligns to none. */ parents:Array<{/** Id of the parent objective (obj_...) that sits on the objective's own department or above it. */ objective_id:string;/** Share of the parent this objective carries, greater than 0 and at most 1. e.g. 1 */ weight:number}>;/** Whether the objective is still being worked on or was graded. */ status:"active"|"closed";/** How the objective ended, set by grade; null while active. */ result:"achieved"|"partial"|"missed"|"dropped"|null;/** Score from 0 to 1 set by grade; null while active. */ score:number|null;/** Note written at grading, such as why a committed objective was not achieved; null when none was written. */ grade_note:string|null;/** UTC instant (RFC 3339) when the objective was set. */ create_time:string;/** UTC instant (RFC 3339) of the latest change to the objective. */ update_time:string}>;Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | yes | Objective id (obj_…) whose parents are replaced, from the objectives list. |
Request body
| Required | Content types | Description |
|---|---|---|
| yes | application/json |
Responses
| Status | Content types | Description |
|---|---|---|
| 200 | application/json | The objective with its new parents. |
| 400 | application/problem+json | INVALID_PARAMS, ALIGNMENT_CYCLE or SCOPE_MISMATCH; keep weights in (0, 1], pick parents on the objective’s own department or above, and never a cycle. |
| 401 | Missing or invalid credential; provide a valid organization API key or sign in to the Console. | |
| 403 | application/problem+json | PERMISSION_DENIED; an organization owner or admin, or the head of the objective’s home department or of a department above it may call this, and machine tokens are always refused (an agent’s session token may read the organization, never change it). Use an API key or Console session of an allowed role. |
| 404 | application/problem+json | OBJECTIVE_NOT_FOUND; the objective or a parent does not exist. List objectives and copy ids. |
| 409 | application/problem+json | PERIOD_CLOSED; a parent objective is closed and takes no aligned child. Choose an active parent. |