---
title: "Bulk Retrain Conditions"
method: POST
path: "/internal/conditions/bulk-retrain"
tags: ["internal"]
---

# Bulk Retrain Conditions

`POST /internal/conditions/bulk-retrain`

Run free_coding for each requested condition and return suggested code.

Results are **not** persisted — the caller reviews suggestions and calls
bulk-update to save them.

At most ``_BULK_RETRAIN_MAX_BLOCKS`` conditions are processed per request.
Concurrency is bounded by a semaphore to avoid overwhelming the LLM API.

## Request body

- ConditionBulkRetrainRequest
  - `block_ids` string[], required

## Response `200`

Successful Response

- ConditionBulkRetrainResponse
  - `items` ConditionBulkRetrainResultItem[], required
    - `block_id` string, uuid, required
    - `suggested_code` string, nullable, required
    - `explanation` string, nullable, required
    - `error` string, nullable, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/kobaltlabs/apis/fastapi.md) · [All operations](https://skmtc.dev/kobaltlabs/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kobaltlabs/fastapi/revisions/425d5b8a3c17/schema)
