Update compliance policy
const url = 'https://api.varman.io/v1/policies/pol_abc123def456';const options = { method: 'PATCH', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"kind":"policy","name":"Data Privacy Policy","description":"This policy outlines how we handle and protect personal data","status":"draft","content":[{"type":"heading","attrs":{"level":2,"textAlign":null},"content":[{"type":"text","text":"Purpose"}]},{"type":"paragraph","attrs":{"textAlign":null},"content":[{"type":"text","text":"Verify workforce integrity and grant the right access at start, revoke at end."}]}],"frequency":"monthly","department":"it","isRequiredToSign":true,"reviewDate":"2024-12-31T00:00:00.000Z","assigneeId":"usr_abc123def456","ownerId":"mem_abc123def456","reporterId":"mem_abc123def456","approverId":"usr_xyz789abc123","policyTemplateId":"plt_template123","signedBy":["usr_123","usr_456"],"visibility":"ALL","visibleToDepartments":["it","hr"],"groupIds":["grp_abc123"],"editorIds":["mem_abc123"],"approverIds":["mem_abc123","mem_def456"],"isArchived":false,"displayFormat":"EDITOR"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.varman.io/v1/policies/pol_abc123def456 \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "kind": "policy", "name": "Data Privacy Policy", "description": "This policy outlines how we handle and protect personal data", "status": "draft", "content": [ { "type": "heading", "attrs": { "level": 2, "textAlign": null }, "content": [ { "type": "text", "text": "Purpose" } ] }, { "type": "paragraph", "attrs": { "textAlign": null }, "content": [ { "type": "text", "text": "Verify workforce integrity and grant the right access at start, revoke at end." } ] } ], "frequency": "monthly", "department": "it", "isRequiredToSign": true, "reviewDate": "2024-12-31T00:00:00.000Z", "assigneeId": "usr_abc123def456", "ownerId": "mem_abc123def456", "reporterId": "mem_abc123def456", "approverId": "usr_xyz789abc123", "policyTemplateId": "plt_template123", "signedBy": [ "usr_123", "usr_456" ], "visibility": "ALL", "visibleToDepartments": [ "it", "hr" ], "groupIds": [ "grp_abc123" ], "editorIds": [ "mem_abc123" ], "approverIds": [ "mem_abc123", "mem_def456" ], "isArchived": false, "displayFormat": "EDITOR" }'Update compliance policy details or content while keeping policy workflows connected to controls, tasks, and approvals.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
pol_abc123def456Policy ID
Header Parameters
Section titled “Header Parameters”Organization ID (required for session auth, optional for API key auth)
Request Bodyrequired
Section titled “Request Bodyrequired”Policy update data
object
Policy (default) or procedure. Procedures are step by step documents listed apart from policies and do not need signing by default.
Example
procedureName of the policy
Example
Data Privacy PolicyDescription of the policy
Example
This policy outlines how we handle and protect personal dataStatus of the policy
Example
draftContent of the policy as TipTap JSON (array of nodes)
object
Example
[ { "type": "heading", "attrs": { "level": 2, "textAlign": null }, "content": [ { "type": "text", "text": "Purpose" } ] }, { "type": "paragraph", "attrs": { "textAlign": null }, "content": [ { "type": "text", "text": "Verify workforce integrity and grant the right access at start, revoke at end." } ] }]Review frequency of the policy
Example
yearlyDepartment this policy applies to. Built-in values: none, admin, gov, hr, it, itsm, qms. Custom department names are also accepted.
Example
itWhether this policy requires a signature
Example
trueReview date for the policy
Example
2024-12-31T00:00:00.000ZID of the user assigned to this policy
Example
usr_abc123def456Member ID of the person accountable for this policy
object
Example
mem_abc123def456Member ID of the person who raised this policy (defaults to the creator)
object
Example
mem_abc123def456ID of the user who approved this policy
Example
usr_xyz789abc123ID of the policy template this policy is based on
Example
plt_template123List of user IDs who have signed this policy
Example
[ "usr_123", "usr_456"]Who must see and sign the policy: ALL members, or only the departments in visibleToDepartments
Example
DEPARTMENTDepartments the policy is assigned to. Required (non empty) with visibility DEPARTMENT, cleared with ALL.
Example
[ "it", "hr"]Group IDs the policy is assigned to, with visibility DEPARTMENT. Members of these groups or of visibleToDepartments must sign.
Example
[ "grp_abc123"]Member IDs allowed to edit the draft content even if their role cannot update policies. Publishing still needs policy update permission.
Example
[ "mem_abc123"]Member IDs who must all approve a version before it publishes. Replaces the current list; any rejection rejects the version.
Example
[ "mem_abc123", "mem_def456"]Whether to archive this policy
Example
falseDisplay format for this policy
Example
EDITORResponses
Section titled “Responses”Policy updated successfully
object
The policy ID
Name of the policy
Description of the policy
Status of the policy
Content of the policy as TipTap JSON (array of nodes)
object
Review frequency of the policy
Department this policy applies to. May be one of the built-in values (none, admin, gov, hr, it, itsm, qms) or a custom department name.
Whether this policy requires a signature
List of user IDs who have signed this policy
Review date for the policy
Whether this policy is archived
When the policy was archived by framework sync
When the policy was created
When the policy was last updated
When the policy was last archived
When the policy was last published
Organization ID this policy belongs to
ID of the user assigned to this policy
ID of the user who approved this policy
ID of the policy template this policy is based on
Example
{ "id": "pol_abc123def456", "name": "Data Privacy Policy", "description": "This policy outlines how we handle and protect personal data", "status": "published", "content": [ { "type": "heading", "attrs": { "level": 2 }, "content": [ { "type": "text", "text": "Purpose" } ] } ], "frequency": "yearly", "department": "it", "isRequiredToSign": true, "signedBy": [ "usr_123" ], "reviewDate": "2024-12-31T00:00:00.000Z", "isArchived": false, "createdAt": "2024-01-01T00:00:00.000Z", "updatedAt": "2024-01-15T00:00:00.000Z", "organizationId": "org_abc123def456", "assigneeId": "usr_abc123def456", "approverId": "usr_xyz789abc123"}Bad Request - Invalid update data
object
Example
{ "message": "Validation failed"}Unauthorized - Invalid authentication or insufficient permissions
object
Example
{ "message": "Unauthorized"}Policy not found
object
Example
{ "message": "Policy with ID pol_abc123def456 not found"}