# Replace a routing preset's spec (/docs/reference/management/updateRoutingPreset)

> For AI agents, the [documentation index](https://bitrouter-docs-staging.up.railway.app/llms.txt) lists all pages. Append .md to a documentation URL to read its Markdown.

`PUT /v1/namespaces/{nsid}/routing-presets/{id}`

Full replace of the preset's spec body (not a per-field merge) — every request carries the complete spec it wants persisted. `name` is optional; an absent `name` leaves it unchanged.

*Requires the `routing_preset:write` scope.*

## Authentication

header parameter `x-api-key` or `Authorization: Bearer <token>`.

Base URL: `https://api.bitrouter.ai`

## Parameters

* `nsid` (path, required): Id of the target namespace. Must be owned by the caller (or equal a namespace-baked credential's own namespace), else 404.
* `id` (path, required): Surrogate id of the `routing_presets` row.

## Request body

Routing preset replacement.

Media types: `application/json`.

* `model`: string | null
* `name`: string | null
* `params`: object
* `routing`: object
* `system_prompt`: string | null

## Responses

* `200` Updated routing preset. (application/json)
* `401` Credential missing or did not verify. (application/json)
* `403` Credential is valid but lacks the required scope. (application/json)
* `404` Resource not found (or owned by a different account). (application/json)

[Full OpenAPI schema](https://bitrouter-docs-staging.up.railway.app/openapi.json)