跳转到内容
EN

List periods

Code Mode: praxis.workforce.periods.list

HTTP: GET /workforce/v1/periods

Lists the periods of your organization’s OKR calendar, newest start first; use it to find the period_id to set objectives in, or to see which periods are still open for grading. Closed periods are included. Filter cadence to read one level of the calendar. 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 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/periods?cadence=quarter.

签名

praxis.workforce.periods.list(args?:{query?:{limit?:number;page?:string;cadence?:"year"|"half"|"quarter"}}):Promise<{/** Periods on this page. */ data:Array<{/** Period id (prd_...); use it as period_id and parent_id. */ id:string;/** Id of the organization that owns the period. */ organization_id:string;/** Period name, 1 to 100 characters, such as 2026 Q4. */ name:string;/** Level of the calendar this period sits on; periods of one cadence never overlap. e.g. "quarter" */ cadence:"year"|"half"|"quarter";/** Id of the coarser period (prd_...) that contains this one; null for a period with no parent. */ parent_id:string|null;/** First day of the period as a calendar date (YYYY-MM-DD). e.g. "2026-10-01" */ start_on:string;/** Last day of the period as a calendar date (YYYY-MM-DD), inclusive. e.g. "2026-12-31" */ end_on:string;/** Derived from the dates and today's UTC date, except closed, which only close sets. */ status:"planning"|"active"|"grading"|"closed";/** UTC instant (RFC 3339) when the period was opened. */ create_time:string;/** UTC instant (RFC 3339) of the latest change to the period. */ 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}>;

参数

名称位置类型必填说明
limitquerynumber否Maximum items per page, from 1 to 100; defaults to 20.
pagequerystring否Opaque next_page cursor returned by the previous response; omit for the first page.
cadencequery“year” | “half” | “quarter”否Only periods of this cadence; omit to list every level of the calendar.

响应

状态码内容类型说明
200application/jsonOne page of periods.
400application/problem+jsonINVALID_PARAMS; an unknown query parameter, a limit outside 1 to 100 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.