# Delete a UI protocol session record

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

Maintain the current user's session records.


```http
DELETE https://api.moi.matrixorigin.cn/v5/sessions/{session_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 numeric record IDs in the same environment](objects.md#prepare). This entry point uses ordinary product authentication and rejects additional task runtime authorization headers.

## Request

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

```bash
curl --request DELETE \
  "$BASE_URL/sessions/$SESSION_ID" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID"
```

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

| Parameter | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-ID` | Headers | string | Yes | Target Workspace ID. |
| `session_id` | Path | integer | Yes | Positive integer ID of the current user's record. |

Returns HTTP 200 and an operation-result object, not 204. After deleting a session record, verify message, tag, and file cleanup separately; success does not establish complete cascading cleanup.

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

## Successful response

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

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "message": "deleted"
  }
}
```

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

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | OK on success; HTTP status is 200. |
| `msg` | string | OK on success. |
| `data.message` | string | Operation result: pinned, unpinned, or deleted. |

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

## Error responses

[Error formats and result confirmation](objects.md#error-contract) distinguishes session-detail not-found from generic service errors at other entry points.
