Get a policy
Reads a policy as its newest revision, the one that applies the next time its operation runs.
The lookup is scoped to the project in project_id: a policy of another
project answers not found exactly as an unknown id does.
AuthorizationBearer <token>Scope: policy.read
policy_id*stringThe identifier of the policy, shared by all of its revisions.
^pol_[a-zA-Z0-9_-]+$project_id*stringThe unique identifier of the project
^[a-zA-Z0-9_-]+$The policy was retrieved.
application/json- response
One revision of a project's auth.factor.password.set policy (ADR 066).
id is shared by every revision of the operation's policy; revision_id
names this revision.
id*policy-idThe identifier of a policy, shared by all of its revisions.
^pol_[a-zA-Z0-9_-]+$revision_id*policy-revision-idThe identifier of one immutable revision of a policy.
^polrev_[a-zA-Z0-9_-]+$project_id*project-idThe project the policy belongs to.
^[a-zA-Z0-9_-]+$operation*"auth.factor.password.set"The operation the policy guards.
"auth.factor.password.set"config*The settings of an auth.factor.password.set policy. Every setting is
optional; a setting left out switches its rule off, and {} switches every
rule off. There are no defaults. The bounds are technical limits, not
recommendations; the server's template checks the same bounds.
created_at*stringWhen the operation's policy was first published.
date-timeupdated_at*stringWhen this revision was published.
date-timeimport { 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 policy = await client.getPolicy("string", { project_id: "proj_01KWH1P4MYS7F0N9WD3P2E4YM5" });{ "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"}Was this helpful?