Skip to content
中文

List assignments

Code Mode: praxis.workforce.assignments.list

HTTP: GET /workforce/v1/assignments

Lists assignments, newest start first, each tying one actor (person or agent) to one position; use it to see who holds what, or the history of a position or an actor. Ended assignments are included unless you filter active=true. Filters combine with AND. Pass next_page unchanged as page; null means the end. Read-only. Errors: 400 INVALID_PARAMS for an unknown query parameter, a limit outside 1 to 100, a non-boolean active or a stale cursor; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/assignments?position_id=pos_123&active=true.

Signature

praxis.workforce.assignments.list(args?:{query?:{limit?:number;page?:string;position_id?:string;actor?:string;active?:boolean}}):Promise<{/** Assignments on this page. */ data:Array<{/** 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}>;/** Whether another page is available after this one. */ has_more:boolean;/** Cursor to pass as page to read the next page; null when no more items remain. */ next_page:string|null}>;

Parameters

NameInTypeRequiredDescription
limitquerynumbernoMaximum items per page, from 1 to 100; defaults to 20.
pagequerystringnoOpaque next_page cursor returned by the previous response; omit for the first page.
position_idquerystringnoOnly assignments to this position (pos_…); use it with active=true to find the current holder.
actorquerystringnoOnly assignments of this actor address, such as human:usr_123 or agent:agent_123.
activequerybooleannotrue lists only current assignments; false lists only ended ones; omit for both.

Responses

StatusContent typesDescription
200application/jsonOne page of assignments.
400application/problem+jsonINVALID_PARAMS; an unknown query parameter, a limit outside 1 to 100, a bad filter value or a stale page cursor. The message lists the accepted parameters.
401Missing or invalid credential; provide a valid organization API key or sign in to the Console.
403application/problem+jsonPERMISSION_DENIED; an agent’s session token reads its own organization, but a run or computer token, or a session token that names no agent, is refused; call with an organization API key, a Console session, or the agent’s own session token.