# Update an embedding backend through the Workspace API

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Modify an embedding model backend's name, declared models, and supported configuration fields.


```http
PUT https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/embeddings/backends/{backend_id}
```

## Before you call this API

Set `BASE_URL` to the product API prefix `https://api.moi.matrixorigin.cn/v5`. For private deployments, use the corresponding product API URL.

[Configure identity, Workspace, and object permissions in the same environment](objects.md#prepare).

## Request

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl --request PUT \
  "$BASE_URL/workspaces/$WORKSPACE_ID/embeddings/backends/$BACKEND_ID" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID" \
  --header "Content-Type: application/json" \
  --data-raw '{"name":"更新后"}'
```

:::::
:::::{tab-item} Parameters

| Parameter | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-ID` | Headers | string | Yes | Workspace ID in the same environment. |
| `workspace_id` | Path | string | Yes | Workspace ID in the same environment. |
| `backend_id` | Path | integer | Yes | Positive ID returned by an earlier read. |
| `name` | Body | string | No | Omission/null/empty/whitespace-only values preserve the previous name. |
| `api_key_encrypted` | Body | string | No | Nonempty values replace; omission/null/empty preserves. Empty values cannot clear credentials. |
| `timeout_seconds` | Body | integer | No | Positive values update; omission/null/nonpositive values preserve. |
| `models` | Body | array (strings) or null | No | Omission/null preserves; [] clears; nonempty arrays replace the complete collection. |
| `reasoning_control_protocol` | Body | integer or null | No | LLM only. Omission/null preserves; 0 explicitly resets NONE, and other valid values are 1–5. |
| `provider_origin` | Body | string or null | No | LLM only. Omission/null preserves; explicit values allow only external_provider. Empty strings are rejected. |
| `origin_ref` | Body | string or null | No | LLM only. Omission/null preserves; an empty string clears. |
| `origin_version` | Body | string or null | No | LLM only. Omission/null preserves; an empty string clears. |

Requires object model_backend.update. Type is absent from the update structure. No business request_id/CAS protection is supported; read back required fields afterward. Current dedicated Go/Python/CLI clients omit models=[], so clearing requires a call that preserves the complete HTTP array. An omitted models field in a response may also mean an empty collection.

:::::
::::::
:::::::

## Successful response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": 0,
  "data": {
    "id": 12,
    "name": "更新后",
    "timeout_seconds": 30,
    "models": [
      "bge-m3"
    ],
    "created_at": 1794445200,
    "updated_at": 1794445200,
    "provider_origin": "unknown",
    "api_key_encrypted": "provider-key-example"
  }
}
```

:::::
:::::{tab-item} Fields

HTTP 200。

| Field | Type | Description |
| --- | --- | --- |
| `code` | integer | 0 on success. |
| `data` | object | [Actual objects for this protocol](objects.md#responses). |

:::::
::::::
:::::::

## Error responses

[Errors and result confirmation](objects.md#errors) distinguishes the two protocols. Parse omitted fields, SDK zero values, and empty HTTP responses separately. Confirm writes using the corresponding read operation.
