# Delete an incoming message association

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

Delete an incoming message association.

```text
DELETE https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/ingress-connections/{connection_id}
```

## Before you call this API

Prepare a personal access token with access to the target Workspace and permission for the operation. The path Workspace must match X-Workspace-ID. Examples use jq. See [Shared information](objects.md) for variables, objects, and states.

## Query parameters

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

```bash
curl -X DELETE "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/ingress-connections/$CONNECTION_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  --get \
  --data-urlencode "expected_association_version=$ASSOCIATION_VERSION" \
  --data-urlencode "expected_config_version=$CONFIG_VERSION"
```

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

The two versions are query parameters, not a JSON request body. The response is the deleted association's configuration snapshot, not evidence that it still exists. Check the target list afterward. Managed credentials are cleaned up with their owning resource; independently referenced callback/mail channel instances are retained.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `expected_association_version` | integer | Yes | association_version from the latest connection details; must be greater than 0. |
| `expected_config_version` | integer | Yes | config_version from the latest connection details; must be greater than 0. |

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

## Successful response

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

```json
{
  "code": 0,
  "data": {
    "id": "ingress_example",
    "workspace_id": "workspace_example",
    "target": {
      "kind": "agent",
      "workspace_id": "workspace_example",
      "id": "agent_example"
    },
    "provider": "slack",
    "channel_type": "slack_app",
    "receive_mode": "managed_stream",
    "agent_model": "model_example",
    "association_version": 1,
    "connected_by_user_id": "user_example",
    "enabled": true,
    "account_identity": "slack:app:app_example",
    "config_version": 1,
    "desired_state": "enabled",
    "observed_state": "starting",
    "created_at": "2026-11-11T00:00:00Z",
    "updated_at": "2026-11-11T00:00:00Z"
  }
}
```

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

| Field | Type | Description |
| --- | --- | --- |
| `code` | integer | 0 on success. |
| `data` | object | Result object; see the shared object descriptions for fields. |

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

## Error responses

Handle HTTP status, business results, and error fields separately. See [Errors and environments](objects.md#错误与环境). On source or version conflicts, read the current state; do not automatically retry with a different identity, resource, or request ID.
