Skip to content

PoliciesResource

API reference for the Policies resource.

Methods

list

List all policies with optional filtering.

typescript
async list(options?: ListOptions): Promise<ListResponse<Policy>>

get

Get a single policy by ID.

typescript
async get(id: string): Promise<Policy>

create

Create a new policy.

typescript
async create(data: CreatePolicyInput): Promise<Policy>

Parameters:

typescript
interface CreatePolicyInput {
  title: string;
  content?: string;
  status?: 'draft' | 'published' | 'archived';
  category?: string;
  owner?: string;
  approver?: string;
  effectiveDate?: Date;
  reviewDate?: Date;
}

update

Update an existing policy.

typescript
async update(id: string, data: UpdatePolicyInput): Promise<Policy>

delete

Delete a policy.

typescript
async delete(id: string): Promise<void>

Search policies by text.

typescript
async search(query: string): Promise<Policy[]>

publish

Publish a draft policy.

typescript
async publish(id: string): Promise<Policy>

archive

Archive a policy.

typescript
async archive(id: string): Promise<Policy>

getVersions

Get version history for a policy.

typescript
async getVersions(id: string): Promise<Policy[]>

Types

Policy

typescript
interface Policy {
  id: string;
  type: 'policy';
  title: string;
  content?: string;
  status: 'draft' | 'published' | 'archived';
  version?: string;
  category?: string;
  owner?: string;
  approver?: string;
  effectiveDate?: Date;
  reviewDate?: Date;
  createdAt: Date;
  updatedAt: Date;
}

Released under the MIT License.