Open positions
Code Mode: praxis.workforce.positions.create
HTTP: POST /workforce/v1/positions
Opens one or more vacant positions in a department, optionally from a job: the job’s name becomes the title and its duties and methods are copied onto each position. Without job_id a title is required. Positions get consecutive numbers in the department that are never reused. Open a position and then hire into it; the root department’s head position already exists and is held by the organization’s owner, seated automatically when the organization is first used. request_id makes the call idempotent: repeating it returns the first result and opens nothing more. Requires an organization owner or admin, or the head of the department or of a department above it. Errors: 400 INVALID_PARAMS for a count outside 1 to 100, a missing request_id or an unknown body field; 400 POSITION_NAME_REQUIRED without job_id and title; 400 JOB_LEVEL_OUT_OF_RANGE when the job does not allow the level; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND, JOB_NOT_FOUND, JOB_LEVEL_NOT_FOUND or POSITION_NOT_FOUND; 409 DEPARTMENT_DISSOLVED, JOB_RETIRED or POSITION_CLOSED (the reports_to target). Example body: {“department_id”:“dept_123”,“job_id”:“jpr_123”,“count”:2,“request_id”:“open-support-2026-11”}.
签名
praxis.workforce.positions.create(args:{body:{/** Id of the active department (dept_...) to open the positions in. */ department_id:string;/** Id of the active job (jpr_...) to open from; omit for a one-off position, which then needs a title. */ job_id?:string;/** Title for the positions, 1 to 100 characters; required without job_id, otherwise defaults to the job name. */ title?:string;/** Job level (lvl_...) for the positions; must be allowed by the job when the job lists levels. */ job_level_id?:string;/** Position (pos_...) the new positions report to; omit to follow the default line to the department head. */ reports_to_position_id?:string;/** How many identical positions to open, from 1 to 100; defaults to 1. */ count?:number;/** Your own unique key for this request; repeating it returns the first result instead of opening more positions. e.g. "open-support-2026-11" */ request_id:string}}):Promise<{/** The positions opened by the call, in number order. */ data:Array<{/** Position id (pos_...). */ id:string;/** Id of the organization that owns the position. */ organization_id:string;/** Id of the department (dept_...) the position sits in. */ department_id:string;/** Number inside the department, from 1; never reused after a position is closed. */ number:number;/** Id of the job (jpr_...) the position was opened from; null for a one-off position opened without a job. */ job_id:string|null;/** Title of the position; defaults to the job name when it was opened. */ title:string;/** The position's own copy of its duties; later revisions of the job do not change it. */ duties:string;/** The position's own copy of its methods; later revisions of the job do not change it. */ methods:string;/** Id of the job level (lvl_...) of the position; null when no level is set. */ job_level_id:string|null;/** Id of the position this one explicitly reports to; null means it follows the default line to its department head. */ reports_to_position_id:string|null;/** Whether this position is the head of its department. */ is_head:boolean;/** Where the position stands in its life. */ status:"active"|"frozen"|"closed";/** Current holder of the position, or null while it is vacant; otherwise the actor holding it and whether this is their primary position. */ holder:({/** Actor address of the holder, such as human:usr_123 or agent:agt_123. */ actor:string;/** Display name of the holder. */ name:string;/** Kind of actor holding the position. */ kind:"human"|"general"|"service"|"assume";/** URL of the holder's avatar; null when none is set. */ avatar:string|null;/** Whether the holder's account is archived. */ archived:boolean})&({/** True when this is the holder's primary position; false for a concurrent one, which make_primary can promote. */ primary:boolean})|null;/** The manager position after applying the default line; null at the top of the tree. */ effective_reports_to:{/** Id of the position that is the manager. */ position_id:string;/** Title of the manager position. */ title:string;/** Holder of the direct manager position; null while that position is vacant. */ holder:{/** Actor address of the holder, such as human:usr_123 or agent:agt_123. */ actor:string;/** Display name of the holder. */ name:string;/** Kind of actor holding the position. */ kind:"human"|"general"|"service"|"assume";/** URL of the holder's avatar; null when none is set. */ avatar:string|null;/** Whether the holder's account is archived. */ archived:boolean}|null;/** Holder of the first filled position further up the reporting line when the direct manager position is vacant; otherwise null. */ acting:{/** Actor address of the holder, such as human:usr_123 or agent:agt_123. */ actor:string;/** Display name of the holder. */ name:string;/** Kind of actor holding the position. */ kind:"human"|"general"|"service"|"assume";/** URL of the holder's avatar; null when none is set. */ avatar:string|null;/** Whether the holder's account is archived. */ archived:boolean}|null}|null;/** Actor address that opened the position, such as human:usr_123. */ created_by:string;/** UTC instant (RFC 3339) when the position was opened. */ create_time:string;/** UTC instant (RFC 3339) of the latest change to the position. */ update_time:string}>}>;请求体
| 必填 | 内容类型 | 说明 |
|---|---|---|
| 是 | application/json |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 201 | application/json | The positions that were opened, in number order. |
| 400 | application/problem+json | INVALID_PARAMS, POSITION_NAME_REQUIRED or JOB_LEVEL_OUT_OF_RANGE; fix the field named in the message, give a title when there is no job, and pick a level the job allows. |
| 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 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 | DEPARTMENT_NOT_FOUND, JOB_NOT_FOUND, JOB_LEVEL_NOT_FOUND or POSITION_NOT_FOUND; list the resource named by the code and copy a valid id. |
| 409 | application/problem+json | DEPARTMENT_DISSOLVED, JOB_RETIRED or POSITION_CLOSED; open in an active department, from an active job, reporting to a position that is not closed. |