Update version content
curl --request PATCH \
--url https://api.trycomp.ai/v1/policies/{id}/versions/{versionId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"content": [
{
"type": "heading",
"attrs": {
"level": 2,
"textAlign": null
},
"content": [
{
"type": "text",
"text": "Purpose"
}
]
}
]
}
'const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: [
{
type: 'heading',
attrs: {level: 2, textAlign: null},
content: [{type: 'text', text: 'Purpose'}]
}
]
})
};
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}"
payload = { "content": [
{
"type": "heading",
"attrs": {
"level": 2,
"textAlign": None
},
"content": [
{
"type": "text",
"text": "Purpose"
}
]
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"versionId": "<string>"
}{
"message": "Invalid request"
}{
"message": "Unauthorized"
}{
"message": "Resource not found"
}Policies
Update version content | Comp AI API
Update version content in Comp AI. Create, version, publish, export, map, and improve compliance policies with AI-assisted drafting and approval workflows.
PATCH
/
v1
/
policies
/
{id}
/
versions
/
{versionId}
Update version content
curl --request PATCH \
--url https://api.trycomp.ai/v1/policies/{id}/versions/{versionId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"content": [
{
"type": "heading",
"attrs": {
"level": 2,
"textAlign": null
},
"content": [
{
"type": "text",
"text": "Purpose"
}
]
}
]
}
'const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: [
{
type: 'heading',
attrs: {level: 2, textAlign: null},
content: [{type: 'text', text: 'Purpose'}]
}
]
})
};
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}"
payload = { "content": [
{
"type": "heading",
"attrs": {
"level": 2,
"textAlign": None
},
"content": [
{
"type": "text",
"text": "Purpose"
}
]
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"versionId": "<string>"
}{
"message": "Invalid request"
}{
"message": "Unauthorized"
}{
"message": "Resource not found"
}Authorizations
API key for authentication
Headers
Organization ID (required for session auth, optional for API key auth)
Path Parameters
Policy ID
Example:
"pol_abc123def456"
Policy version ID
Example:
"pv_abc123def456"
Body
application/json
Update content for a policy version
Content of the policy version as TipTap JSON (array of nodes)
Example:
[
{
"type": "heading",
"attrs": { "level": 2, "textAlign": null },
"content": [{ "type": "text", "text": "Purpose" }]
}
]
Response
Version content updated
Was this page helpful?

