Revise an objective
Code Mode: praxis.workforce.objectives.update
HTTP: PATCH /workforce/v1/objectives/{id}
Rewords an active objective: change its title, its description or both; send at least one. Its period, scope and alignment do not change here; use align for parents, and grade to close it. 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 when no field is given, a title is empty or over 200 characters, or a description is over 2000 characters; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND; 409 PERIOD_CLOSED when the objective was already graded or its period is closed. Example body: {“title”:“Cut first-response time to under 2 hours”}.
签名
praxis.workforce.objectives.update(args:{path:{id:string};body:{/** New objective title, 1 to 200 characters; omit to keep it. */ title?:string;/** New description, up to 2000 characters, replacing the old one; omit to keep it. */ description?:string}}):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}>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| id | path | string | 是 | Objective id (obj_…) to revise, from the objectives list. |
请求体
| 必填 | 内容类型 | 说明 |
|---|---|---|
| 是 | application/json |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | The objective after the change. |
| 400 | application/problem+json | INVALID_PARAMS; send at least one of title and description, within their length limits. |
| 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; list objectives and copy an id of your organization. |
| 409 | application/problem+json | PERIOD_CLOSED; the objective was graded or its period is closed, so it can no longer be revised. |