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

# Train Policy Adapter

> Start a Training Studio adapter run from an activated policy import

Start asynchronous training for an activated policy import. Training Studio
re-reads the import's original document, generates and judges examples, and
trains a policy-specific LoRA adapter.

Call this after [Import Policy](/api-reference/custom-policies/import-policy)
and [Activate Rules](/api-reference/custom-policies/activate-rules). Import
extracts candidate rules; training is only accepted once those rules are
activated (`409` if the import is still pending review). Then poll
[Get Training Status](/api-reference/training-studio/get-training-status)
until training succeeds or fails.

<Note>
  Training uses the original imported document, not only the extracted rule
  definitions. If that document has expired under your retention policy,
  re-import and activate the policy before training.
</Note>

## Path Parameters

<ParamField path="import_id" type="string" required>
  The activated policy import to train.
</ParamField>

## Request Body

The body is optional. Omit it to use Training Studio defaults.

<ParamField body="cost_cap_usd" type="number">
  Optional maximum generation spend in US dollars for this run.
</ParamField>

<ParamField body="examples_per_rule" type="integer">
  Optional number of generated training examples per extracted rule.
</ParamField>

## Response

Returns `202 Accepted` after the training run has been created.

<ResponseField name="import_id" type="string">
  Policy import being trained.
</ResponseField>

<ResponseField name="training_run_id" type="string">
  Training Studio run identifier.
</ResponseField>

<ResponseField name="status" type="string">
  Initial status reported for the training run.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable next step, when present.
</ResponseField>

<ResponseField name="poll" type="object">
  Endpoint used to monitor this run.

  <Expandable title="poll properties">
    <ResponseField name="method" type="string">
      Always `GET`.
    </ResponseField>

    <ResponseField name="url" type="string">
      `/api/policies/import/{import_id}/train`
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 202 Training Accepted theme={null}
  {
    "import_id": "550e8400-e29b-41d4-a716-446655440000",
    "training_run_id": "run-808961af",
    "status": "queued",
    "message": "Training started. Poll the training status endpoint for progress.",
    "poll": {
      "method": "GET",
      "url": "/api/policies/import/550e8400-e29b-41d4-a716-446655440000/train"
    }
  }
  ```
</ResponseExample>

## Error Responses

| Status | Description                                                                  |
| ------ | ---------------------------------------------------------------------------- |
| 400    | Invalid training options                                                     |
| 403    | A full-access API key is required, or the import belongs to another customer |
| 404    | Import not found                                                             |
| 409    | Import is not activated, or another training run is already in progress      |
| 410    | Original document expired; re-import the policy                              |
| 422    | Document is too short to train, or Training Studio rejected it               |
| 500    | Import state could not be read or updated                                    |
| 502    | Training Studio request failed                                               |
| 503    | Training is not configured in this environment                               |

## Example

```bash cURL theme={null}
curl -X POST \
  "https://api.zerodrift.ai/api/policies/import/550e8400-e29b-41d4-a716-446655440000/train" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
