---
title: "Refine a CloudFlow from natural language intent"
method: POST
path: "/cloudflow/v1/flows/{flowId}/actions/refine"
tags: ["CloudFlow"]
---

# Refine a CloudFlow from natural language intent

`POST /cloudflow/v1/flows/{flowId}/actions/refine`

Refines the specified CloudFlow by generating and updating nodes and connections based on the provided natural language intent. The operation streams incremental build events as they are produced.

## Path parameters

- `flowId` string, required

## Request body

- CloudFlowRefineRequest
  - `question` string, required — Natural language description of what to refine or modify in the CloudFlow.
  - `conversationId` string — ID of an existing conversation to continue. When omitted, a new conversation is started.

## Response `200`

OK - Refine event stream.

## Other responses

- `400` — Bad Request - The server cannot process the request, often due to a malformed request.
- `401` — Unauthorized - Invalid API key.
- `403` — Forbidden - The client is not authorized to perform the request.
- `406` — Not Acceptable — the client did not include `text/event-stream` in the Accept header.
- `500` — Internal Server Error - Something went wrong with the DoiT API server.
- `502` — Bad Gateway — the upstream refine service returned an unexpected error.

---

[API](https://skmtc.dev/doit/apis/doit-cloud-intelligence.md) · [All operations](https://skmtc.dev/doit/apis/doit-cloud-intelligence/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/doit/doit-cloud-intelligence/revisions/9416402fc119/schema)
