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

# PolicyTrain

> **Required scope:** models:manage

**Required scope:** `models:manage`

### Request body

`PolicyTrainRequest`

<ParamField body="examples" type="PolicyExample[]" required />

<ParamField body="org_id" type="string" />

### Response

`PolicyTrainResponse`

<ResponseField name="successful_abductions" type="integer" required />

<ResponseField name="total_examples" type="integer" required />

<ResponseField name="training_time_ms" type="integer (int64)" required />

### Status codes

| Code  | Meaning                                            |
| ----- | -------------------------------------------------- |
| `200` | Policy training result                             |
| `400` | Invalid request                                    |
| `401` | Unauthorized — missing or invalid credentials      |
| `403` | Forbidden — the key/token lacks the required scope |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |
| `500` | Internal server error                              |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.nsr.stateset.com/api/v1/policy/train' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "examples": [
      {
        "correct_decision": "string",
        "tool_input": null,
        "tool_name": "string"
      }
    ],
    "org_id": "string"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "successful_abductions": 1,
    "total_examples": 1,
    "training_time_ms": 1
  }
  ```
</ResponseExample>
