Get a key result
Code Mode: praxis.workforce.keyResults.retrieve
HTTP: GET /workforce/v1/key_results/{id}
Reads one key result with its metric, its health, its done flag, its owner position and its score. Progress of a metric key result is (current - initial) / (target - initial), clamped between 0 and 1; a key result without a metric counts as 1 when done is true and 0 otherwise. Read-only. Errors: 404 KEY_RESULT_NOT_FOUND when the id is not a key result of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
签名
praxis.workforce.keyResults.retrieve(args:{path:{id:string}}):Promise<{/** Key result id (kr_...); use it in key_result_scores. */ id:string;/** Id of the organization that owns the key result. */ organization_id:string;/** Id of the objective (obj_...) the key result belongs to. */ objective_id:string;/** Key result title, 1 to 200 characters. */ title:string;/** Id of the position (pos_...) that owns the key result; whoever holds it moves its progress. */ owner_position_id:string;/** Whether the key result is a firm commitment or a stretch. */ commitment:"committed"|"aspirational";/** The numbers the key result is measured by, or null for a binary key result whose progress is done. */ metric:{/** Value when the key result started; progress counts from here. e.g. 6 */ initial:number;/** Latest value; update it to move progress. e.g. 6 */ current:number;/** Value that means the key result is reached; it differs from initial and may be lower than it when the number should fall. e.g. 2 */ target:number;/** Unit of the three values. e.g. "none" */ unit:"none"|"percent"|"currency_micro_usd"|"count"|"seconds"}|null;/** Whether a binary key result is complete; it only counts when metric is null. */ done:boolean;/** The owner's latest read on whether the key result will land. */ health:"on_track"|"at_risk"|"off_track";/** Score from 0 to 1 recorded when the objective was graded; null until then or when grading left it out. */ score:number|null;/** UTC instant (RFC 3339) when the key result was set. */ create_time:string;/** UTC instant (RFC 3339) of the latest change to the key result. */ update_time:string}>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| id | path | string | 是 | Key result id (kr_…), from the key results list or the response of set. |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | The key result. |
| 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. |
| 404 | application/problem+json | KEY_RESULT_NOT_FOUND; list key results and copy an id of your organization. |