Skip to content
中文

Grade an objective

Code Mode: praxis.workforce.objectives.grade.create

HTTP: POST /workforce/v1/objectives/{id}/grade

Grades an objective and closes it in place: records its result, its score from 0 to 1, an optional note, and the scores of the key results you list. A key result you leave out keeps no score. Grading happens once; a closed objective cannot be graded again. When the objective has any committed key result and the result is not achieved, a note is required. 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 result outside the list, a non-numeric score or a note over 2000 characters; 400 SCORE_OUT_OF_RANGE when any score is outside 0 to 1; 400 GRADE_NOTE_REQUIRED when a committed objective is graded other than achieved without a note; 403 PERMISSION_DENIED; 404 OBJECTIVE_NOT_FOUND; 404 KEY_RESULT_NOT_FOUND when a listed key result does not belong to this objective; 409 PERIOD_CLOSED when the objective is already closed. Example body: {“result”:“partial”,“score”:0.6,“note”:“Hiring slipped a month.”}.

Signature

praxis.workforce.objectives.grade.create(args:{path:{id:string};body:{/** How the objective ended; anything but achieved needs a note when the objective has a committed key result. e.g. "partial" */ result:"achieved"|"partial"|"missed"|"dropped";/** Score of the objective, from 0 to 1. e.g. 0.6 */ score:number;/** Why the objective ended this way, up to 2000 characters; required when a committed objective is graded other than achieved. */ note?:string;/** Scores for the key results of this objective that you want recorded; key results you omit keep no score. */ key_result_scores?:Array<{/** Id of a key result (kr_...) that belongs to the objective being graded. e.g. "kr_9e4d17a2c05b4f3e8a6d2b1c7f30e5a8" */ id:string;/** Score of that key result, from 0 to 1. e.g. 0.7 */ score: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

NameInTypeRequiredDescription
idpathstringyesObjective id (obj_…) to grade, from the objectives list.

Request body

RequiredContent typesDescription
yesapplication/json

Responses

StatusContent typesDescription
200application/jsonThe objective with status closed, its result, score and note.
400application/problem+jsonINVALID_PARAMS, SCORE_OUT_OF_RANGE or GRADE_NOTE_REQUIRED; keep every score within 0 to 1 and add a note when a committed objective is not achieved.
401Missing or invalid credential; provide a valid organization API key or sign in to the Console.
403application/problem+jsonPERMISSION_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.
404application/problem+jsonOBJECTIVE_NOT_FOUND or KEY_RESULT_NOT_FOUND; list objectives for the objective and key results filtered by objective_id for the ids in key_result_scores.
409application/problem+jsonPERIOD_CLOSED; the objective is already closed and cannot be graded again.