Skip to content

Create policy version

POST
/v1/policies/{id}/versions
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.

id
required
string

Example

pol_abc123def456

Policy ID

X-Organization-Id
string

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

Create a new policy version draft

Media typeapplication/json
object
sourceVersionId

Optional version ID to base the new version on

string

Example

pv_abc123def456
changelog

Optional changelog to associate with the new version

string

Example

Initial draft for quarterly updates

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"
}