Skip to content

Create compliance policy

POST
/v1/policies
curl --request POST \
--url https://api.varman.io/v1/policies \
--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" ] }'

Create a policy record that can be reviewed, versioned, published, linked to controls, and used as source evidence for questionnaires.

X-Organization-Id
string

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

Policy creation data

Media typeapplication/json
object
kind

Policy (default) or procedure. Procedures are step by step documents listed apart from policies and do not need signing by default.

string
Allowed values: policy procedure

Example

procedure
name
required

Name of the policy

string

Example

Data Privacy Policy
description

Description of the policy

string

Example

This policy outlines how we handle and protect personal data
status

Status of the policy

string
Allowed values: draft published needs_review

Example

draft
content
required

Content of the policy as TipTap JSON (array of nodes)

Array<object>
object
key
additional properties
any

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."
}
]
}
]
frequency

Review frequency of the policy

string
Allowed values: monthly quarterly yearly

Example

yearly
department

Department this policy applies to. Built-in values: none, admin, gov, hr, it, itsm, qms. Custom department names are also accepted.

string
<= 64 characters

Example

it
isRequiredToSign

Whether this policy requires a signature

boolean

Example

true
reviewDate

Review date for the policy

string

Example

2024-12-31T00:00:00.000Z
assigneeId

ID of the user assigned to this policy

string

Example

usr_abc123def456
ownerId

Member ID of the person accountable for this policy

object

Example

mem_abc123def456
reporterId

Member ID of the person who raised this policy (defaults to the creator)

object

Example

mem_abc123def456
approverId

ID of the user who approved this policy

string

Example

usr_xyz789abc123
policyTemplateId

ID of the policy template this policy is based on

string

Example

plt_template123
signedBy

List of user IDs who have signed this policy

Array<string>

Example

[
"usr_123",
"usr_456"
]
visibility

Who must see and sign the policy: ALL members, or only the departments in visibleToDepartments

string
Allowed values: ALL DEPARTMENT

Example

DEPARTMENT
visibleToDepartments

Departments the policy is assigned to. Required (non empty) with visibility DEPARTMENT, cleared with ALL.

Array<string>

Example

[
"it",
"hr"
]
groupIds

Group IDs the policy is assigned to, with visibility DEPARTMENT. Members of these groups or of visibleToDepartments must sign.

Array<string>

Example

[
"grp_abc123"
]
editorIds

Member IDs allowed to edit the draft content even if their role cannot update policies. Publishing still needs policy update permission.

Array<string>

Example

[
"mem_abc123"
]
approverIds

Member IDs who must all approve a version before it publishes. Replaces the current list; any rejection rejects the version.

Array<string>

Example

[
"mem_abc123",
"mem_def456"
]

Policy created successfully

Media typeapplication/json
object
id
required

The policy ID

string
name
required

Name of the policy

string
description
required

Description of the policy

string
nullable
status
required

Status of the policy

string
Allowed values: draft published needs_review
content
required

Content of the policy as TipTap JSON (array of nodes)

Array<object>
object
key
additional properties
any
frequency
required

Review frequency of the policy

string
nullable
Allowed values: monthly quarterly yearly
department
required

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.

string
nullable
isRequiredToSign
required

Whether this policy requires a signature

boolean
signedBy
required

List of user IDs who have signed this policy

Array<string>
reviewDate
required

Review date for the policy

string format: date-time
nullable
isArchived
required

Whether this policy is archived

boolean
archivedAt
required

When the policy was archived by framework sync

string format: date-time
nullable
createdAt
required

When the policy was created

string format: date-time
updatedAt
required

When the policy was last updated

string format: date-time
lastArchivedAt
required

When the policy was last archived

string format: date-time
nullable
lastPublishedAt
required

When the policy was last published

string format: date-time
nullable
organizationId
required

Organization ID this policy belongs to

string
assigneeId
required

ID of the user assigned to this policy

string
nullable
approverId
required

ID of the user who approved this policy

string
nullable
policyTemplateId
required

ID of the policy template this policy is based on

string
nullable

Example

{
"id": "pol_abc123def456",
"name": "Data Privacy Policy",
"description": "This policy outlines how we handle and protect personal data",
"status": "draft",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Policy content here"
}
]
}
],
"frequency": "yearly",
"department": "it",
"isRequiredToSign": true,
"signedBy": [],
"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 policy data

Media typeapplication/json
object
message
string

Example

{
"message": "Invalid policy content format"
}

Unauthorized - Invalid authentication or insufficient permissions

Media typeapplication/json
object
message
string

Example

{
"message": "Unauthorized"
}