# Delete custom operator

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

Delete a custom operator. Deletion is irreversible; please confirm that no workflow needs to use this operator before calling it.

```text
DELETE https://moi.matrixorigin.cn/newmoi/workflow/v2/custom-operators/$OPERATOR_ID
```

## Preparation before calling

First [query custom operator details](get-custom-operator.md) to confirm the operator to be deleted. Prepare the personal access token, target workspace ID, and custom operator ID that have access to the target workspace.


## Request parameters

::::{div} mo-api-split
:::{div} mo-api-split-main

```{raw} html
<dl class="mo-api-fields">

</dl>
```

:::
:::{div} mo-api-split-aside

```{raw} html
<p class="mo-api-example-label">Request example</p>
```

```bash
curl -X DELETE "https://moi.matrixorigin.cn/newmoi/workflow/v2/custom-operators/$OPERATOR_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"
```

:::
::::

## Successful response

Response confirms that the operator has been deleted. After deletion, the operator can no longer be queried, modified or used.


The response fields are as follows.

::::{div} mo-api-split
:::{div} mo-api-split-main

```{raw} html
<dl class="mo-api-fields">
  <div class="mo-api-field"><dt><code>code</code><span class="mo-api-field__type">string</span></dt><dd>OK on success.</dd></div>
  <div class="mo-api-field"><dt><code>msg</code><span class="mo-api-field__type">string</span></dt><dd>OK on success.</dd></div>
  <div class="mo-api-field"><dt><code>data.deleted</code><span class="mo-api-field__type">boolean</span></dt><dd>true when deleted successfully.</dd></div>
</dl>
```

:::
:::{div} mo-api-split-aside

```{raw} html
<p class="mo-api-example-label">Successful response example</p>
```

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

:::
::::

## Error response

::::{div} mo-api-split
:::{div} mo-api-split-main

```{raw} html
<dl class="mo-api-fields">
  <div class="mo-api-field"><dt><code>code</code><span class="mo-api-field__type">string</span></dt><dd>Error code.</dd></div>
  <div class="mo-api-field"><dt><code>msg</code><span class="mo-api-field__type">string</span></dt><dd>Readable error message.</dd></div>
  <div class="mo-api-field"><dt><code>data</code><span class="mo-api-field__type">null</span></dt><dd>`null` in an error response.</dd></div>
</dl>
```

:::
:::{div} mo-api-split-aside

```{raw} html
<p class="mo-api-example-label">Error response example</p>
```

```json
{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}
```

:::
::::

## Follow-up operations

[Query custom operator list](list-custom-operators.md), confirm that the target no longer appears.
