Docs

List the revisions of a policy

GET
/policies/{policy_id}/revisions

Returns every revision of one policy, newest first, paginated with a cursor. The order is fixed, so there is no sorting.

The lookup is scoped to the project in project_id: a policy of another project answers not found exactly as an unknown id does.

Authorization

headerAuthorizationBearer <token>

Scope: policy.read

Path Parameters

policy_id*string

The identifier of the policy, shared by all of its revisions.

Match^pol_[a-zA-Z0-9_-]+$

Query Parameters

project_id*string

The unique identifier of the project

Match^[a-zA-Z0-9_-]+$
limit?integer

Maximum number of items to return.

Range1 <= value <= 100
Default20
page_token?string

Token for fetching the next page of results. Obtain this value from next_page_token in the previous response. Omit to start from the beginning. Its format is opaque and may change between releases.

Response Body

The revisions were returned.

application/json
  1. response

Paginated list of the revisions of one policy, newest first.

revisions*array<>
next_page_token?|

Token to pass as page_token in the next request to fetch the following page. Absent when there are no more results.

Example Request
import { configureZitadel, getApi } from "@zitadel/api/config";// In the browser, through the SDK proxy: the session cookie authenticates the call.const client = getApi(configureZitadel({ projectId: "proj_01KWH1P4MYS7F0N9WD3P2E4YM5" }));const policyRevisions = await client.listPolicyRevisions("string", { project_id: "proj_01KWH1P4MYS7F0N9WD3P2E4YM5" });
Example Response
{  "revisions": [    {      "id": "string",      "revision_id": "string",      "project_id": "string",      "operation": "auth.factor.password.set",      "config": {        "min_length": 1,        "max_length": 1,        "history_depth": 1      },      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "next_page_token": "string"}

Was this helpful?