<span id="工作区式嵌入模型设置端点状态"></span>

# Set embedding endpoint status through the workspace API

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

Set the specified embedding endpoint online or offline.


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

<span id="调用前准备"></span>

## Before you call this API

Set `BASE_URL` to the product API prefix `https://api.moi.matrixorigin.cn/v5`; use the corresponding product API URL for a dedicated deployment.

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

<span id="请求"></span>

## Request

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

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

:::::
:::::{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 a preceding read. |
| `endpoint_id` | Path | integer | Yes | Positive ID returned by a preceding read. |
| `status` | Body | integer | No | 0 online, 1 offline. Omission/null use 0; other integers rejected. |

Requires backend update permission. Path backend_id/endpoint_id selects the target; duplicate IDs in the body do not override the path. The Embedding DAO may treat zero matches as success; reread to confirm.

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

<span id="成功响应"></span>

## Successful response

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

```json
{
  "code": 0,
  "data": {
    "updated": true
  }
}
```

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

HTTP 200。

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

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

<span id="错误响应"></span>

## 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 with the corresponding reads.
