List objectives
Code Mode: praxis.workforce.objectives.list
HTTP: GET /workforce/v1/objectives
Lists objectives, oldest first, each with its scope, the parents it aligns to and, once graded, its result and score; use it to find an objective id or to read one period or one department’s objectives. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100 or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/objectives?period_id=prd_6d1f0c3a9b8e4a27a5c4e7d2f1b90a38&status=active.
签名
praxis.workforce.objectives.list(args?:{query?:{limit?:number;page?:string;period_id?:string;scope_kind?:"department"|"position";scope_id?:string;status?:"active"|"closed"}}):Promise<{/** Objectives on this page. */ data:Array<{/** 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}>;/** Whether another page is available after this one. */ has_more:boolean;/** Cursor to pass as page to read the next page; null when no more items remain. */ next_page:string|null}>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| limit | query | number | 否 | Maximum items per page, from 1 to 100; defaults to 20. |
| page | query | string | 否 | Opaque next_page cursor returned by the previous response; omit for the first page. |
| period_id | query | string | 否 | Only objectives set in this period (prd_…), from the periods list. |
| scope_kind | query | “department” | “position” | 否 | Only objectives hanging on this kind of node; combine with scope_id to read one node. |
| scope_id | query | string | 否 | Only objectives hanging on this department (dept_…) or position (pos_…); sub-departments are not included. |
| status | query | “active” | “closed” | 否 | Only objectives in this status; omit to list active and closed objectives together. |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | One page of objectives. |
| 400 | application/problem+json | INVALID_PARAMS; an unknown query parameter, a limit outside 1 to 100, a bad filter value or a stale page cursor. The message lists the accepted parameters. |
| 401 | Missing or invalid credential; provide a valid organization API key or sign in to the Console. | |
| 403 | application/problem+json | PERMISSION_DENIED; an agent’s session token reads its own organization, but a run or computer token, or a session token that names no agent, is refused; call with an organization API key, a Console session, or the agent’s own session token. |