> ## Documentation Index
> Fetch the complete documentation index at: https://docs.linquid.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Rule Attachments and Snapshots

> Attach/detach rules to links, list linked links, and backfill rule snapshots

# Rule Attachments and Snapshots

## Endpoints

* `POST /api/rules/:id/attach`
* `DELETE /api/rules/:id/attach/:linkId`
* `GET /api/rules/:id/links`
* `POST /api/rules/backfill-snapshots`

## Access

* `rules:update` for attach/detach
* `rules:read` for linked links
* `rules:create` for snapshot backfill operation

## Attach rule

`POST /api/rules/:id/attach`

Attaches an existing workspace rule to a target link.

Expected payload includes `linkId` (and optional priority metadata if supported by route validation).

## Detach rule

`DELETE /api/rules/:id/attach/:linkId`

Detaches the rule from one link without deleting the rule.

## Linked links list

`GET /api/rules/:id/links`

Returns link objects currently associated with the rule.

## Snapshot backfill

`POST /api/rules/backfill-snapshots`

Administrative/maintenance endpoint for generating missing historical rule snapshots.

Useful after rule-system migrations or audit remediations.

## Common errors

* `404`: rule or link not found in workspace scope
* `400`: invalid attachment payload
* `403`: missing permission
* `500`: snapshot backfill failure
