> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# LegalService

**Published**: 2026-11-30
**Category**: Services

Reads legal documents (privacy policy, terms of service), which are pages tagged `'legal'`.
Available as `lynkow.legal`. With `cache: true`, responses are cached for 5 minutes.

Access via: `lynkow.legal`

## Methods

**3** methods

### `clearCache`

```typescript
clearCache(): void
```

Clears every cached legal document held by the client.

Returns: `void`

```typescript
lynkow.legal.clearCache() // Deprecated; prefer lynkow.pages.clearCache()
```

---

### `getBySlug`

```typescript
getBySlug(slug: string, options?: BaseRequestOptions): Promise<LegalDocument>
```

Fetches one published page by slug, with its resolved data and SEO settings. The slug is not checked
against the `'legal'` tag. With `cache: true`, cached for 5 minutes. Throws `LynkowError` `NOT_FOUND` for an unknown slug,
and for an empty, `'.'` or `'..'` slug, which is refused without a request.

| Parameter | Type | Description |
| --- | --- | --- |
| `slug` | `string` | The page slug, such as `'privacy-policy'`. |
| `options` | `BaseRequestOptions` | Request options. `locale` selects the translation. |


Returns: `Promise<LegalDocument>`

```typescript
const privacy = await lynkow.pages.getBySlug('privacy-policy')
```

---

### `list`

```typescript
list(options?: BaseRequestOptions): Promise<LegalDocument[]>
```

Fetches the published pages tagged `'legal'` as summaries. Resolves to an array of `LegalDocument`.
With `cache: true`, cached for 5 minutes.

| Parameter | Type | Description |
| --- | --- | --- |
| `options` | `BaseRequestOptions` | Request options. `locale` selects the language. |


Returns: `Promise<LegalDocument[]>`

```typescript
const docs = await lynkow.pages.list({ tag: 'legal' })
docs.data.forEach(doc => console.log(doc.slug, doc.name))
```