跳转到内容
EN

Get a spec

Code Mode: praxis.workforce.specs.retrieve

HTTP: GET /workforce/v1/specs/{kind}/{id}

Reads one subject’s spec in the workforce/v1 envelope: metadata (id, name, revision, labels, annotations, change_note, update_time, updated_by), spec ({ document, provision }) and status (how many holders last reconciled on it, how many are ready and how many have a failed block). revision reads one historical revision instead, with status null. A subject never written answers revision 0 with an empty spec, so a first revise sends metadata.revision 0. Read-only. Errors: 400 INVALID_PARAMS for a non-integer revision; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent; 404 when the subject, or the named SPEC_REVISION_NOT_FOUND, does not exist. Example: GET /workforce/v1/specs/job/jpr_123?revision=2.

签名

praxis.workforce.specs.retrieve(args:{path:{kind:"organization"|"department"|"level"|"job"|"position"|"assignment";id:string};query?:{revision?:number}}):Promise<{/** 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}>;

参数

名称位置类型必填说明
kindpath“organization” | “department” | “level” | “job” | “position” | “assignment”是Kind of the subject whose spec to read.
idpathstring是The subject’s own id (org_…, dept_…, lvl_…, jpr_…, pos_… or asg_…).
revisionquerynumber否Read this historical revision instead of the live one; 0 answers the empty spec of a subject never written.

响应

状态码内容类型说明
200application/jsonThe spec of the subject at the live or named revision.
400application/problem+jsonINVALID_PARAMS; revision is not an integer, or a query parameter is unknown. Send revision as a whole number, or omit it for the live spec.
401Missing or invalid credential; provide a valid organization API key or sign in to the Console.
403application/problem+jsonPERMISSION_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.
404application/problem+jsonThe subject is not in your organization, or the named revision does not exist: DEPARTMENT_NOT_FOUND, JOB_LEVEL_NOT_FOUND, JOB_NOT_FOUND, POSITION_NOT_FOUND, ASSIGNMENT_NOT_FOUND or SPEC_REVISION_NOT_FOUND. Copy an id from the subject’s list, or read a revision the history returns.