Get Policy
Retrieve policy information and associated IPFS CID for accessing content.Endpoint
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
policyId | string | ✅ | Policy identifier (path param) |
Response
Success (200)
Policy Expired (410)
Policy Not Found (404)
Unauthorized (401)
Max Attempts Reached (403)
Example Usage
JavaScript
cURL
Policy Status Checks
The endpoint performs multiple validations:| Check | HTTP Status | Response |
|---|---|---|
| Policy exists | 200 | Full policy data |
| Policy not found | 404 | { error: "Policy not found" } |
| Expired | 410 | { error: "Policy expired" } |
| Revoked | 403 | { error: "Policy revoked" } |
| Max attempts | 403 | { error: "Max attempts reached" } |
Access Flow Integration
Response Fields
| Field | Type | Description |
|---|---|---|
policyId | string | Policy identifier |
cid | string | IPFS Content Identifier |
sender | address | Creator’s wallet address |
recipient | address | Authorized recipient address |
expiry | number | Unix timestamp |
maxAttempts | number | Maximum allowed attempts |
attempts | number | Current attempt count |
contentType | string | "file" or "message" |
fileName | string | Original filename |
fileSize | number | Size in bytes |
valid | boolean | Whether policy is still valid |
createdAt | string | ISO timestamp of creation |
Rate Limits
| Limit | Value |
|---|---|
| Requests | 60 per minute |
| Per policy | No limit |
Caching
Policies are cached for 30 seconds to reduce database load. The cache is invalidated on:- Policy revocation
- Access attempt logged

