Skip to content
中文

Set an objective

Code Mode: praxis.workforce.objectives.create

HTTP: POST /workforce/v1/objectives

Sets an objective: what a department or a position is trying to reach in one open period. It hangs on a department or a position of your organization’s tree, and company objectives hang on the root department. It starts active with no parents; align it to higher objectives with the align operation, and add key results with the key results operations. Requires an organization owner or admin, or the head of the objective’s home department (the department itself, or the department of the position). Errors: 400 INVALID_PARAMS for an empty title, a title over 200 characters, a description over 2000 characters, a scope kind outside the list or an unknown body field; 403 PERMISSION_DENIED; 404 PERIOD_NOT_FOUND, DEPARTMENT_NOT_FOUND or POSITION_NOT_FOUND; 409 PERIOD_CLOSED, DEPARTMENT_DISSOLVED or POSITION_CLOSED. Example body: {“period_id”:“prd_6d1f0c3a9b8e4a27a5c4e7d2f1b90a38”,“scope”:{“kind”:“department”,“id”:“dept_4c2e9a17d0b34f58a6e1b3c7d9f20e84”},“title”:“Cut first-response time”}.

Signature

praxis.workforce.objectives.create(args:{body:{/** Id of the open period (prd_...) to set the objective in; list periods to find it. e.g. "prd_6d1f0c3a9b8e4a27a5c4e7d2f1b90a38" */ period_id:string;/** The department or position the objective hangs on; use the root department for a company objective. */ 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. e.g. "Cut first-response time" */ title:string;/** What reaching the objective means, up to 2000 characters; omit for an empty description. */ 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}>;

Request body

RequiredContent typesDescription
yesapplication/json

Responses

StatusContent typesDescription
201application/jsonThe new objective.
400application/problem+jsonINVALID_PARAMS; fix the title, description, scope or unknown body field named in the message.
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+jsonPERIOD_NOT_FOUND, DEPARTMENT_NOT_FOUND or POSITION_NOT_FOUND; list periods, departments or positions and copy ids of your organization.
409application/problem+jsonPERIOD_CLOSED, DEPARTMENT_DISSOLVED or POSITION_CLOSED; set the objective in an open period on an active department or an open position.