Skip to content
中文

Hire into a position

Code Mode: praxis.workforce.positions.hire.create

HTTP: POST /workforce/v1/positions/{id}/hire

Seats an existing member or agent in a vacant position; use it to fill a position that nobody holds, and use replace_holder to swap the current holder in one step. An actor is a person (human:usr_…) or an agent (agent:agent_…), treated identically, and must exist in your organization and not be archived. An agent created moments ago may not be in the organization roster yet (agents enter it asynchronously): that answers 503 ACTOR_SYNCING with a Retry-After header and retryable true, and the same call succeeds after that wait. The position must be active and vacant, and a position has at most one active assignment. An actor may hold several positions, and exactly one of its active assignments is primary: omit primary to make the first assignment primary and later ones concurrent; primary true makes this one primary and turns the previous primary into a concurrent one; primary false for an actor that holds nothing is refused. request_id makes the call idempotent: repeating it returns the first assignment and seats nobody else. Requires an organization owner or admin, or the head of the position’s department or of a department above it. Errors: 400 INVALID_PARAMS for a missing request_id, a candidate.kind other than member, an empty candidate.actor, a non-boolean primary or an unknown body field; 403 PERMISSION_DENIED; 404 POSITION_NOT_FOUND; 404 ACTOR_NOT_FOUND when the actor is not an active member or agent of your organization; 409 POSITION_FROZEN, POSITION_CLOSED or POSITION_OCCUPIED; 409 PRIMARY_ASSIGNMENT_REQUIRED for primary false on an actor that holds nothing. Example body: {“candidate”:{“kind”:“member”,“actor”:“human:usr_123”},“request_id”:“hire-support-1”}.

Signature

praxis.workforce.positions.hire.create(args:{path:{id:string};body:{candidate:{/** How the candidate is identified; only member, an existing person or agent of your organization, is accepted. e.g. "member" */ kind:"member";/** Actor address of the member or agent to seat, such as human:usr_123 or agent:agent_123. */ actor:string};/** Whether this becomes the actor's primary assignment; omit to be primary only when the actor holds nothing, and false is refused for an actor that holds nothing. */ primary?:boolean;/** Your own unique key for this request; repeating it returns the first assignment instead of seating anyone again. e.g. "hire-support-1" */ request_id:string}}):Promise<{/** Assignment id (asg_...); use it with transfer, terminate and make_primary. */ id:string;/** Id of the organization that owns the assignment. */ organization_id:string;/** Id of the position (pos_...) the actor holds. */ position_id:string;/** Actor address of the holder, such as human:usr_123 for a person or agent:agent_123 for an agent. */ actor:string;/** The holder's display name from the organization's directory, archived agents included, so a past holder is still named; null when the directory does not know th */ actor_name:string|null;/** Whether this is the actor's primary assignment; an actor holding positions has exactly one primary, and the others are concurrent. */ primary:boolean;/** UTC instant (RFC 3339) when the actor took the position. */ start_time:string;/** UTC instant (RFC 3339) when the assignment ended; null while it is current. */ end_time:string|null;/** Why the assignment ended; null while it is current. */ end_reason:"resigned"|"dismissed"|"replaced"|"retired"|"transferred"|"position_closed"|"actor_archived"|null;/** Actor address that made the appointment, such as human:usr_123. */ appointed_by:string;/** Actor address that ended the assignment; null while it is current. */ ended_by:string|null;/** Id of the successor's assignment (asg_...) when the holder was replaced in one step; null otherwise. */ successor_assignment_id:string|null;/** UTC instant (RFC 3339) when the assignment was recorded. */ create_time:string;/** UTC instant (RFC 3339) of the latest change to the assignment. */ update_time:string}>;

Parameters

NameInTypeRequiredDescription
idpathstringyesPosition id (pos_…) to fill, from the positions list.

Request body

RequiredContent typesDescription
yesapplication/json

Responses

StatusContent typesDescription
201application/jsonThe new assignment of the actor to the position.
400application/problem+jsonINVALID_PARAMS; send a candidate with kind member and an actor address, a boolean primary if any, and a request_id.
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 position’s 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+jsonPOSITION_NOT_FOUND or ACTOR_NOT_FOUND; list positions for the id, and list members or agents for the actor address.
409application/problem+jsonPOSITION_FROZEN, POSITION_CLOSED, POSITION_OCCUPIED or PRIMARY_ASSIGNMENT_REQUIRED; pick an active vacant position, and leave primary out or true for an actor that holds nothing yet.
503application/problem+jsonACTOR_SYNCING; the agent exists but is still being synced into the organization roster. Wait retry_after seconds (also sent as Retry-After) and call again with the same request_id.