Policies

Update compliance policy

Changed on

Update compliance policy details or content while keeping policy workflows connected to controls, tasks, and approvals.

patch/v1/policies/{id}

Request

  • Base URL
    https://api.trycomp.ai
  • Auth
    API key in header X-API-Key

Path parameters

idstring required
Example:pol_abc123def456

Policy ID

Headers

X-Organization-Idstring

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

Request body

namestring

Name of the policy

descriptionstring

Description of the policy

status'draft' | 'published' | 'needs_review'

Status of the policy

contentobject[]

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

frequency'monthly' | 'quarterly' | 'yearly'

Review frequency of the policy

departmentstring

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

isRequiredToSignboolean

Whether this policy requires a signature

reviewDatestring

Review date for the policy

assigneeIdstring

ID of the user assigned to this policy

approverIdstring

ID of the user who approved this policy

policyTemplateIdstring

ID of the policy template this policy is based on

signedBystring[]

List of user IDs who have signed this policy

isArchivedboolean

Whether to archive this policy

displayFormat'EDITOR' | 'PDF'

Display format for this policy

Example request

{
  "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": "yearly",
  "department": "it",
  "isRequiredToSign": true,
  "reviewDate": "2024-12-31T00:00:00.000Z",
  "assigneeId": "usr_abc123def456",
  "approverId": "usr_xyz789abc123",
  "policyTemplateId": "plt_template123",
  "signedBy": [
    "usr_123",
    "usr_456"
  ],
  "displayFormat": "EDITOR"
}

Response

Policy updated successfully

idstring required

The policy ID

namestring required

Name of the policy

descriptionstring nullable required

Description of the policy

status'draft' | 'published' | 'needs_review' required

Status of the policy

contentobject[] required

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

frequency'monthly' | 'quarterly' | 'yearly' nullable required

Review frequency of the policy

departmentstring nullable 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.

isRequiredToSignboolean required

Whether this policy requires a signature

signedBystring[] required

List of user IDs who have signed this policy

reviewDatestring date-time nullable required

Review date for the policy

isArchivedboolean required

Whether this policy is archived

archivedAtstring date-time nullable required

When the policy was archived by framework sync

createdAtstring date-time required

When the policy was created

updatedAtstring date-time required

When the policy was last updated

lastArchivedAtstring date-time nullable required

When the policy was last archived

lastPublishedAtstring date-time nullable required

When the policy was last published

organizationIdstring required

Organization ID this policy belongs to

assigneeIdstring nullable required

ID of the user assigned to this policy

approverIdstring nullable required

ID of the user who approved this policy

policyTemplateIdstring nullable required

ID of the policy template this policy is based on

Example response

{
  "id": "pol_abc123def456",
  "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": "yearly",
  "department": "it",
  "isRequiredToSign": true,
  "signedBy": [
    "usr_123",
    "usr_456"
  ],
  "reviewDate": "2024-12-31T00:00:00.000Z",
  "archivedAt": "2024-02-01T00:00:00.000Z",
  "createdAt": "2024-01-01T00:00:00.000Z",
  "updatedAt": "2024-01-15T00:00:00.000Z",
  "lastArchivedAt": "2024-02-01T00:00:00.000Z",
  "lastPublishedAt": "2024-01-10T00:00:00.000Z",
  "organizationId": "org_abc123def456",
  "assigneeId": "usr_abc123def456",
  "approverId": "usr_xyz789abc123",
  "policyTemplateId": "plt_template123"
}

Changes

    • breaking

      removed the enum value admin of the request property

    • breaking

      removed the enum value gov of the request property

    • breaking

      removed the enum value hr of the request property

    • breaking

      removed the enum value it of the request property

    • breaking

      removed the enum value itsm of the request property

    • breaking

      removed the enum value none of the request property

    • breaking

      removed the enum value qms of the request property

    • warning

      the request property's maxLength was set to 64

    • info

      removed the admin enum value from the response property for the response status

    • info

      removed the gov enum value from the response property for the response status

    • info

      removed the hr enum value from the response property for the response status

    • info

      removed the it enum value from the response property for the response status

    • info

      removed the itsm enum value from the response property for the response status

    • info

      removed the none enum value from the response property for the response status

    • info

      removed the qms enum value from the response property for the response status

    • breaking

      request property was restricted to a list of enum values

    • warning

      added the new admin enum value to the response property for the response status

    • warning

      added the new gov enum value to the response property for the response status

    • warning

      added the new hr enum value to the response property for the response status

    • warning

      added the new it enum value to the response property for the response status

    • warning

      added the new itsm enum value to the response property for the response status

    • warning

      added the new none enum value to the response property for the response status

    • warning

      added the new qms enum value to the response property for the response status

    • info

      added the new admin enum value to the request property

    • info

      added the new gov enum value to the request property

    • info

      added the new hr enum value to the request property

    • info

      added the new it enum value to the request property

    • info

      added the new itsm enum value to the request property

    • info

      added the new none enum value to the request property

    • info

      added the new qms enum value to the request property