Create policy version
POST
/v1/policies/{id}/versions
const url = 'https://api.varman.io/v1/policies/pol_abc123def456/versions';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"sourceVersionId":"pv_abc123def456","changelog":"Initial draft for quarterly updates"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.varman.io/v1/policies/pol_abc123def456/versions \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "sourceVersionId": "pv_abc123def456", "changelog": "Initial draft for quarterly updates" }'Creates a new draft version of a policy, cloned from the current published version (or a specified source version). Use this when you need to make any change to a published policy — content edits, PDF attachments, anything. Published.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Example
pol_abc123def456Policy ID
Header Parameters
Section titled “Header Parameters”X-Organization-Id
string
Organization ID (required for session auth, optional for API key auth)
Request Bodyrequired
Section titled “Request Bodyrequired”Create a new policy version draft
Media typeapplication/json
object
sourceVersionId
Optional version ID to base the new version on
string
Example
pv_abc123def456changelog
Optional changelog to associate with the new version
string
Example
Initial draft for quarterly updatesResponses
Section titled “Responses”Policy version created
Media typeapplication/json
object
versionId
string
version
number
Example generated
{ "versionId": "example", "version": 1}Invalid request
Media typeapplication/json
object
message
string
Example
{ "message": "Invalid request"}Unauthorized
Media typeapplication/json
object
message
string
Example
{ "message": "Unauthorized"}Resource not found
Media typeapplication/json
object
message
string
Example
{ "message": "Resource not found"}