List specs
Code Mode: praxis.workforce.specs.list
HTTP: GET /workforce/v1/specs
Lists the specs (规定) of the organization in the workforce/v1 envelope (api_version, kind, metadata, spec; status is null in a list); use it to find which subject already has a spec before reading or revising one. Narrow it with kind. 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, an unknown kind, a limit outside 1 to 100 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/specs?kind=job.
签名
praxis.workforce.specs.list(args?:{query?:{limit?:number;page?:string;kind?:"organization"|"department"|"level"|"job"|"position"|"assignment"}}):Promise<{/** Specs on this page. */ data:Array<{/** The language of this envelope, always workforce/v1. */ api_version:"workforce/v1";kind:"organization"|"department"|"level"|"job"|"position"|"assignment";metadata:{/** The subject's own id (org_..., dept_..., lvl_..., jpr_..., pos_... */ id:string;/** The subject's own name (the organization's, department's, job's, level's or position's title); null for an assignment or when it cannot be read. */ name:string|null;/** Revision, 0 until the first write and raised by one on every revise; send it as metadata.revision. */ revision:number;/** Short tags for grouping, at most 20 keys; a key is lowercase letters, digits, dot, underscore, slash or hyphen up to 63 characters and a value is a string up to */ labels:{[key:string]:string};/** Free notes for people and tools, at most 20 keys with string values up to 1000 characters. */ annotations:{[key:string]:string};/** Why this revision was written, up to 500 characters; each revision has its own, null when none was given. */ change_note:string|null;/** UTC instant (RFC 3339) this revision was written; null when the subject never had a spec written. */ update_time:string|null;/** Actor address that wrote this revision (human:usr_... */ updated_by:string|null};spec:{/** Markdown text of this unit, injected into each holder's memory as its own entry and never merged with other layers. */ document?:string;/** What the unit provisions its holders with: a map from block name to block value, merged along the chain of a seat and sent through verbatim. */ provision?:{[key:string]:unknown}};/** Reconcile summary; given when one spec is read, null in a list and for a past revision. */ status:{/** Holders whose last reconcile had this spec in one of their seats' chains. */ holders:number;/** Of those, holders with no failed block. */ ready:number;/** Of those, holders with at least one failed block. */ failing:number}|null}>;/** 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}>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| limit | query | number | 否 | Maximum items per page, from 1 to 100; defaults to 20. |
| page | query | string | 否 | Opaque next_page cursor returned by the previous response; omit for the first page. |
| kind | query | “organization” | “department” | “level” | “job” | “position” | “assignment” | 否 | Only specs of this subject kind; omit to list every kind together. |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | One page of specs. |
| 400 | application/problem+json | INVALID_PARAMS; an unknown query parameter, an unknown kind, a limit outside 1 to 100 or a stale page cursor. The message lists the accepted values. |
| 401 | Missing or invalid credential; provide a valid organization API key or sign in to the Console. | |
| 403 | application/problem+json | PERMISSION_DENIED; 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. |