# PATCH /api/v1/admin/settings/{key}

Update one setting (Admin+recentMFA); typed reason + expected-version CAS; a root-of-trust key is refused 403; a stale version is 409 VERSION_CONFLICT with the current value attached and writes nothing

Operation: `adminUpdateSetting`.

Update one setting (Admin+recentMFA); typed reason + expected-version CAS; a root-of-trust key is refused 403; a stale version is 409 VERSION_CONFLICT with the current value attached and writes nothing



## Endpoint

`PATCH https://amplerun-api.spiry.org/api/v1/admin/settings/{key}`

## Authentication

Admin interactive session. API keys do not authorize administrative operations. Sensitive writes also require the stated fresh step-up proof; account MFA is configurable.

## Parameters

| Name | Location | Presence | Type | Description |
| --- | --- | --- | --- | --- |
| `key` | path | Required | string |  |
| `Idempotency-Key` | header | Required | UUID | UUID scoped to authenticated principal, route and canonical request hash. |

## Request body

Required body. 

### `application/json`

| Field | Type | Presence | Description |
| --- | --- | --- | --- |
| `value` | schema | Required |  |
| `reason` | string | Required |  |
| `expected_version` | integer | Required |  |

```json
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "value",
    "reason",
    "expected_version"
  ],
  "properties": {
    "value": {},
    "reason": {
      "type": "string",
      "minLength": 1
    },
    "expected_version": {
      "type": "integer",
      "minimum": 0
    }
  }
}
```

## Responses

### `200`

Written. The new version.

`application/json`
| Field | Type | Presence | Description |
| --- | --- | --- | --- |
| `key` | string | Required |  |
| `version` | integer | Required |  |

```json
{
  "type": "object",
  "required": [
    "key",
    "version"
  ],
  "properties": {
    "key": {
      "type": "string"
    },
    "version": {
      "type": "integer"
    }
  }
}
```

### `409`

Version conflict — nothing was overwritten.

`application/json`
| Field | Type | Presence | Description |
| --- | --- | --- | --- |
| `error` | object | Required |  |
| `current` | SettingView | Required |  |

```json
{
  "type": "object",
  "required": [
    "error",
    "current"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message",
        "retryable",
        "request_id"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "VERSION_CONFLICT"
          ]
        },
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "request_id": {
          "type": "string"
        }
      }
    },
    "current": {
      "$ref": "#/components/schemas/SettingView"
    }
  }
}
```

### `default`

Error envelope. 401 unauthenticated, 403/404 forbidden, 409 conflict, 422 invalid input, 429 rate limited (code UNAVAILABLE, retryable:true, no Retry-After header), 503 unavailable money/provider state with retryable:true.

`application/json`
| Field | Type | Presence | Description |
| --- | --- | --- | --- |
| `error` | object | Required |  |

```json
{
  "$ref": "#/components/schemas/ErrorEnvelope"
}
```

## Static request outline

Replace path/query placeholders and provide the required JSON body, headers and credential from the sections above. This is a request outline, not a command that chooses an amount or starts a rental for you.

```sh
curl --request PATCH 'https://amplerun-api.spiry.org/api/v1/admin/settings/{key}'
```

[Schema definitions](https://docs.amplerun.com/reference/schemas.md) · [Download OpenAPI](/openapi.json) · [Authentication](https://docs.amplerun.com/agents/authentication.md) · [Errors and recovery](https://docs.amplerun.com/reference/errors.md)

---
Generated from the AmpleRun API contract.
Canonical: https://docs.amplerun.com/reference/api/admin-update-setting/
