Skip to content

Publish policy version

POST
/v1/policies/{id}/versions/publish
curl --request POST \
--url https://api.varman.io/v1/policies/pol_abc123def456/versions/publish \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "versionId": "pv_abc123def456", "setAsActive": true, "changelog": "Updated access controls section" }'

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 created via create-policy-version and then edited.

id
required
string

Example

pol_abc123def456

Policy ID

X-Organization-Id
string

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

Publish a new policy version

Media typeapplication/json
object
versionId

Version ID to publish. PASS THIS after update-version to publish your edits — omitting it publishes stale draftContent (loses your changes).

string

Example

pv_abc123def456
setAsActive

Whether to set this version as the active version

boolean

Example

true
changelog

Optional changelog to associate with the published version

string

Example

Updated access controls section

Version published

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