Skip to main content
Defined in: typescript/src/client/PolicyApi.ts:39 Policy API.

Constructors

Constructor

new PolicyApi(transport): PolicyApi
Defined in: typescript/src/client/PolicyApi.ts:40

Parameters

transport
Transport

Returns

PolicyApi

Methods

validate()

validate(policyId, policyVersion): Promise<PolicyValidationResult>
Defined in: typescript/src/client/PolicyApi.ts:59 Confirms that a policy (name + version) is loadable by the Runtime. POST /policies/validate does not accept or check a policy document body — it only checks that policyRepository.load(policyId, policyVersion) succeeds (packages/api/src/routes/policies.ts). POST /policies/validate does not use the shared {error, code?} envelope for 400 or 404: both are {valid, errors}, its own shape, the caller’s answer, not an SDK-level failure — so those two statuses are exempted from the default throw-on-error behavior. 401 is not exempted: it is generated by caller-auth middleware before this route’s own handler ever runs, and does use the shared envelope, identically to every other route. See /api-reference/error-handling.

Parameters

policyId
string
policyVersion
string

Returns

Promise<PolicyValidationResult>