跳转到内容
EN

Define a job ladder

Code Mode: praxis.workforce.ladders.create

HTTP: POST /workforce/v1/ladders

Creates a job ladder: a named, ordered set of job levels such as junior to senior. Each level gets its own id (lvl_…), which jobs and positions refer to. Requires an organization owner or admin. Errors: 400 INVALID_PARAMS for an empty name, an empty levels array, two levels with the same order or an unknown body field; 403 PERMISSION_DENIED. Example body: {“name”:“Support”,“levels”:[{“name”:“Junior”,“order”:1},{“name”:“Senior”,“order”:2}]}.

签名

praxis.workforce.ladders.create(args:{body:{/** Ladder name, 1 to 100 characters. e.g. "Support" */ name:string;/** The levels of the ladder; at least one, with distinct order values. */ levels:Array<{/** Level name, 1 to 100 characters, such as Junior. */ name:string;/** Rank inside the ladder; distinct per level, and levels are returned in ascending order. */ order:number}>}}):Promise<{/** Ladder id (ldr_...). */ id:string;/** Id of the organization that owns the ladder. */ organization_id:string;/** Ladder name, 1 to 100 characters. */ name:string;/** Levels of the ladder in ascending order. */ levels:Array<{/** Job level id (lvl_...); use it as job_level_id and in a job's level_ids. */ id:string;/** Id of the ladder (ldr_...) the level belongs to. */ ladder_id:string;/** Level name, 1 to 100 characters, such as Senior. */ name:string;/** Rank inside the ladder; unique per ladder, and levels are returned in ascending order. */ order:number}>;/** UTC instant (RFC 3339) when the ladder was defined. */ create_time:string;/** UTC instant (RFC 3339) of the latest change to the ladder. */ update_time:string}>;

请求体

必填内容类型说明
是application/json

响应

状态码内容类型说明
201application/jsonThe new ladder with its levels.
400application/problem+jsonINVALID_PARAMS; send a name and a non-empty levels array whose order values are distinct integers.
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 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.