<span id="设置解析端点状态"></span>

# Set parser endpoint state

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

Set a parser endpoint online or offline.


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

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

## Before you call this API

`BASE_URL` uses the product API prefix `https://api.moi.matrixorigin.cn/v5`. For a dedicated deployment, use its corresponding product API address.

[Configure identity, workspace, and privileges 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/parser/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":"OFFLINE"}'
```

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

| Parameter | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-ID` | Header | string | Yes | Workspace ID from the same environment. |
| `backend_id` | Path | integer | Yes | Canonical positive integer ID returned by creation/read for the same Parser kind. |
| `endpoint_id` | Path | integer | Yes | Canonical positive integer ID returned by creation/read for the same Parser kind. |
| `status` | Body | string | No | Trimmed and uppercased, then matched as ONLINE/OFFLINE. Omitted/null/other values become ONLINE. |

Requires backend update. HTTP 200/data:null; SDK/CLI adapt to success:true. Offline endpoints disappear from current endpoint/backend projections. Retain IDs to restore online state.

[Endpoint lists](list-endpoints.md) read online items only. Absence after taking offline does not prove deletion. Restore using the retained `ENDPOINT_ID`.

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

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

## Successful response

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

```json
{
  "code": "OK",
  "msg": "OK",
  "data": null
}
```

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

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | HTTP 200; OK on success. |
| `msg` | string | OK on success. |
| `data` | null | [Actual object or null](objects.md#responses); do not infer from LLM wrappers. |

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

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

## Error response

[Errors and result confirmation](objects.md#errors) distinguishes actual inputs, object admission, and business results.
