> ## Documentation Index
> Fetch the complete documentation index at: https://docs.parmanasystems.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Class: PolicyApi

Defined in: [typescript/src/client/PolicyApi.ts:39](https://github.com/pavancharak/AgentLabsBuildathon/blob/main/typescript/src/client/PolicyApi.ts#L39)

Policy API.

## Constructors

### Constructor

> **new PolicyApi**(`transport`): `PolicyApi`

Defined in: [typescript/src/client/PolicyApi.ts:40](https://github.com/pavancharak/AgentLabsBuildathon/blob/main/typescript/src/client/PolicyApi.ts#L40)

#### Parameters

##### transport

[`Transport`](/sdks/reference/typescript/interfaces/Transport)

#### Returns

`PolicyApi`

## Methods

### validate()

> **validate**(`policyId`, `policyVersion`): `Promise`\<[`PolicyValidationResult`](/sdks/reference/typescript/interfaces/PolicyValidationResult)>

Defined in: [typescript/src/client/PolicyApi.ts:59](https://github.com/pavancharak/AgentLabsBuildathon/blob/main/typescript/src/client/PolicyApi.ts#L59)

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`](/sdks/reference/typescript/interfaces/PolicyValidationResult)>
