---
title: "(Re)generate the rules of a framework"
method: POST
path: "/v1/compliance/frameworks/{documentId}/rules/generate"
tags: ["Compliance"]
---

# (Re)generate the rules of a framework

`POST /v1/compliance/frameworks/{documentId}/rules/generate`

## Request

- Base URL: `https://api.talonic.com`
- URL: `https://api.talonic.com/v1/compliance/frameworks/{documentId}/rules/generate`
- Auth: HTTP bearer

Starts rule generation and returns at once with the framework in `rules_status` `generating`; the model call runs in the background and replaces the framework's rules, edits included, when it succeeds. With the `external` decider, `rules_status` is `waiting` and the derivation is offered as a task. A generation already running for the framework is not started twice.

## Path parameters

- `documentId` string, uuid, required

## Response `201`

The framework view without its extracted items.

- ComplianceFramework
  - `document_id` string, uuid
  - `status` 'pending' | 'processing' | 'waiting' | 'completed' | 'error': The reading of the framework's requirements. `waiting`: the reading waits for the workspace's own agent (decider `external`). A `processing` row older than the staleness limit reads `error`.
  - `active` boolean: Whether the framework's rules are in force (ON). Off by default.
  - `framework_name` string, nullable
  - `rule_count` integer: Items extracted from the framework (its captured fields), not the stored rules.
  - `error` string, nullable
  - `extracted_at` string, date-time, nullable
  - `updated_at` string, date-time
  - `rules_status` 'none' | 'generating' | 'waiting' | 'ready' | 'error': Rule generation: `waiting` means it waits for the workspace's own agent.
  - `rules_error` string, nullable
  - `rules_decided_by` string, nullable: The external agent's label when it derived the rules.
  - `decided_by` string, nullable: The external agent's label when it read the requirements.
  - `generated_rule_count` integer: Rules currently stored (generated, then edited or deleted by people).
  - `summary` string, nullable: One or two sentences describing the document. Null when the view is returned after a change.

## Other responses

- `400`: The request is invalid.
- `403`: The API key does not have the required scope.
- `404`: The requested resource was not found.
- `422`: The request is well-formed but violates the declared task contract.

## Changes

- **2026-10-28** `0a485a46163e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/talonic/apis/talonic-api/changes/v1/compliance/frameworks/:documentId/rules/generate/post.md)

---

[API](https://skmtc.dev/talonic/apis/talonic-api.md) - [All operations](https://skmtc.dev/talonic/apis/talonic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/talonic/apis/talonic-api/revisions/9f6d53e2ab5e?raw)
