Skip to main content
GET
/
v1
/
policies
/
{id}
/
versions
/
{versionId}
Get policy version by ID
curl --request GET \
  --url https://api.trycomp.ai/v1/policies/{id}/versions/{versionId} \
  --header 'X-API-Key: <api-key>'
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};

fetch('https://api.trycomp.ai/v1/policies/{id}/versions/{versionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
import requests

url = "https://api.trycomp.ai/v1/policies/{id}/versions/{versionId}"

headers = {"X-API-Key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
{
  "version": {},
  "currentVersionId": "<string>",
  "pendingVersionId": "<string>"
}
{
"message": "Unauthorized"
}
{
"message": "Resource not found"
}

Authorizations

X-API-Key
string
header
required

API key for authentication

Headers

X-Organization-Id
string

Organization ID (required for session auth, optional for API key auth)

Path Parameters

id
string
required

Policy ID

Example:

"pol_abc123def456"

versionId
string
required

Policy version ID

Example:

"pv_abc123def456"

Response

Policy version retrieved successfully

version
object
currentVersionId
string | null
pendingVersionId
string | null