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

# GET Policy Schema

> Retrieve the required signal schema for a policy version

## Endpoint

```http theme={null}
GET /policies/{policyId}/versions/{version}/schema
Authorization: Bearer <api-key>
```

A policy schema defines the verified signals required to evaluate a policy.

Policy schemas are the source of truth for signal requirements.

External systems should retrieve the schema before collecting and verifying signals.

***

## Why Policy Schemas Exist

Parmana does not determine required signals at runtime.

Each policy explicitly defines:

* Required signals
* Signal types
* Validation rules

```text theme={null}
Task
    ↓
Policy
    ↓
Schema
    ↓
Required Signals
```

Once the policy is known, the required signals are deterministic.

***

## Core Principle

Policies define required signals.

External systems verify those signals.

Parmana evaluates verified signals against policy.

```text theme={null}
Policy
    ↓
Schema
    ↓
Required Signals
    ↓
Verified Signals
    ↓
Parmana Evaluation
```

<Note>
  Parmana does not verify signals.

  Parmana evaluates verified facts supplied by external systems.
</Note>

***

## Path Parameters

| Parameter | Description       |
| --------- | ----------------- |
| policyId  | Policy identifier |
| version   | Policy version    |

***

## Example Request

```http theme={null}
GET /policies/claims-approval/versions/1.0.0/schema
```

***

## Example Response

```json theme={null}
{
  "policyId": "claims-approval",
  "policyVersion": "1.0.0",
  "schemaVersion": "1.0.0",
  "requiredSignals": {
    "insurance_active": {
      "type": "boolean"
    },
    "risk_score": {
      "type": "number"
    },
    "vip_customer": {
      "type": "boolean"
    },
    "claim_amount": {
      "type": "number"
    }
  }
}
```

***

## Response Fields

### policyId

Policy identifier.

### policyVersion

Policy version.

### schemaVersion

Schema version.

### requiredSignals

Signals required for evaluation.

Each signal includes validation metadata used by the calling system.

***

## Typical Workflow

### Step 1

Customer chooses a task.

```text theme={null}
Approve Claim
```

### Step 2

Organization maps task to policy.

```text theme={null}
Approve Claim
        ↓
claims-approval
```

### Step 3

Retrieve policy schema.

```http theme={null}
GET /policies/claims-approval/versions/1.0.0/schema
```

### Step 4

Collect required signals.

```json theme={null}
{
  "insurance_active": true,
  "risk_score": 10,
  "vip_customer": false,
  "claim_amount": 100
}
```

### Step 5

Verify signals.

```text theme={null}
Bank
Insurance Platform
Fraud System
CRM
```

### Step 6

Submit verified signals to Parmana.

```http theme={null}
POST /evaluate
```

***

## Policy Schema Lifecycle

```text theme={null}
Policy
    ↓
Schema
    ↓
Required Signals
    ↓
Verified Signals
    ↓
Evaluation
```

Policies can evolve over time.

Each policy version has its own schema.

```text theme={null}
claims-approval v1.0.0
claims-approval v1.1.0
claims-approval v2.0.0
```

Schemas remain versioned and immutable.

***

## Error Responses

### 401 Unauthorized

```json theme={null}
{
  "error": "Unauthorized"
}
```

***

### 404 Policy Not Found

```json theme={null}
{
  "error": "Policy not found"
}
```

***

### 404 Version Not Found

```json theme={null}
{
  "error": "Policy version not found"
}
```

***

### 500 Internal Error

```json theme={null}
{
  "error": "Failed to load policy schema"
}
```

***

## Example — curl

```bash theme={null}
curl \
  -H "Authorization: Bearer $PARMANA_API_KEY" \
  https://your-runtime/policies/claims-approval/versions/1.0.0/schema
```

***

## How Policy Schemas Fit Into Parmana

```text theme={null}
Customer Chooses Task
        ↓
Task → Policy Mapping
        ↓
Policy Schema
        ↓
Required Signals
        ↓
Verified Signals
        ↓
Parmana Evaluation
        ↓
Decision
```

Policy schemas make signal requirements deterministic.

Once the policy is known, the required signals are known.
