> ## 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.

# Replace the current NSR-L program (creates a new version).

> **Required scope:** write

**Required scope:** `write`

### Request body

`NSRLProgramUpdateRequest`

<ParamField body="code" type="string" required />

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

### Response

`NSRLProgramUpdateResponse`

<ResponseField name="errors" type="string[]" required />

<ResponseField name="success" type="boolean" required />

<ResponseField name="updated_at" type="string" />

<ResponseField name="version_id" type="string" />

### Status codes

| Code  | Meaning                                            |
| ----- | -------------------------------------------------- |
| `200` | Program update result                              |
| `401` | Unauthorized — missing or invalid credentials      |
| `403` | Forbidden — the key/token lacks the required scope |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |

<RequestExample>
  ```bash cURL theme={null}
  curl --request PUT \
    --url 'https://api.nsr.stateset.com/api/v1/nsrl/program' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "code": "human(socrates). mortal(X) :- human(X).",
    "message": "Initial policy load"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "errors": [
      "string"
    ],
    "success": true,
    "updated_at": "2026-08-31T14:22:05Z",
    "version_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }
  ```
</ResponseExample>
