---
title: "Refine a generated narrative"
method: POST
path: "/api/cya/refine"
tags: ["CYA Agent"]
---

# Refine a generated narrative

`POST /api/cya/refine`

## Request

- Base URL: `https://api.cernion.de`
- URL: `https://api.cernion.de/api/cya/refine`
- Auth: none declared

Refines an existing CYA session with user feedback or clarification input (Option-B response structure).

## Query parameters

- `token` string

## Request body

- object
  - `session_id` string, required
  - `user_feedback` string, nullable
  - `agent_clarification_response` string, nullable
  - `clarification_response` object, nullable: Structured HITL data override. Supplies hard facts (capacity, redispatch, NOVA, etc.) to rebuild the deterministic Regulatory Graph. Bypasses failed MCP fetch-routines for the listed focus areas. Separate from agent_clarification_response (free-text LLM guidance).
    - `provided_data` object: Map of focusArea -> user-supplied text. Each entry replaces a failed or missing retrieval item with trusted:true, dataProvenance:"user_asserted".
  - `token` string: Optional Cernion MCP token for this request. Overrides CERNION_TOKEN when provided.

## Response `200`

Refinement result

- object
  - `success` boolean
  - `session_id` string
  - `status` 'completed' | 'needs_clarification'
  - `profile_id` string
  - `target_audience` string
  - `grounding` object
  - `regulatory_graph` object
  - `narrative` object, nullable
  - `clarification` object, nullable
  - `metadata` object

---

[API](https://skmtc.dev/cernion/apis/cernion-energy-tools-api.md) · [All operations](https://skmtc.dev/cernion/apis/cernion-energy-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cernion/apis/cernion-energy-tools-api/revisions/cdb94473b538?raw)
