Publish policy version
curl --request POST \
--url https://api.trycomp.ai/v1/policies/{id}/versions/publish \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"versionId": "pv_abc123def456",
"setAsActive": true,
"changelog": "Updated access controls section",
"keepAcknowledgments": false
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
versionId: 'pv_abc123def456',
setAsActive: true,
changelog: 'Updated access controls section',
keepAcknowledgments: false
})
};
fetch('https://api.trycomp.ai/v1/policies/{id}/versions/publish', 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/publish"
payload = {
"versionId": "pv_abc123def456",
"setAsActive": True,
"changelog": "Updated access controls section",
"keepAcknowledgments": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"versionId": "<string>",
"version": 123
}{
"message": "Invalid request"
}{
"message": "Unauthorized"
}{
"message": "Resource not found"
}Policies
Publish policy version | Comp AI API
Publishes a draft policy version, making it the active/current version of the policy. Pass the versionId of the draft you want to publish — for example one.
POST
/
v1
/
policies
/
{id}
/
versions
/
publish
Publish policy version
curl --request POST \
--url https://api.trycomp.ai/v1/policies/{id}/versions/publish \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"versionId": "pv_abc123def456",
"setAsActive": true,
"changelog": "Updated access controls section",
"keepAcknowledgments": false
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
versionId: 'pv_abc123def456',
setAsActive: true,
changelog: 'Updated access controls section',
keepAcknowledgments: false
})
};
fetch('https://api.trycomp.ai/v1/policies/{id}/versions/publish', 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/publish"
payload = {
"versionId": "pv_abc123def456",
"setAsActive": True,
"changelog": "Updated access controls section",
"keepAcknowledgments": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"versionId": "<string>",
"version": 123
}{
"message": "Invalid request"
}{
"message": "Unauthorized"
}{
"message": "Resource not found"
}Headers
Body
application/json
Publish a new policy version
Publish as a minor change: keep existing employee acknowledgments only when reliable publication history exists. First publication and legacy policies without reliable history still require acknowledgment. Use only for corrections that do not change what the policy requires. Defaults to false.
Example:
false
Was this page helpful?

