Delete channel instance¶
Delete a channel instance and its associated credentials. After deletion, the instance can no longer be used to send messages or receive callbacks.
DELETE $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/channels/{provider}/instances/{instance_id}
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First query the channel instance details and confirm the instance to be deleted.
Set the operation-specific values used in the request:
$WORKSPACE_ID: Target workspace ID, passed through theX-Workspace-IDheader and also asworkspace_idin the path.$PROVIDER: Channel Provider ID, asproviderin the path.$INSTANCE_ID: The channel instance ID to delete, asinstance_idin the path.
Request¶
curl -X DELETE "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/channels/$PROVIDER/instances/$INSTANCE_ID" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Workspace ID. |
|
string |
Yes |
Channel Provider ID. |
|
string |
Yes |
Channel instance ID. |
Successful response¶
Returns 200 and the deleted instance snapshot on success. This operation deletes the associated credentials and cannot be restored through the instance.
{
"code": 0,
"data": {
"id": "inst_01",
"workspace_id": "ws_01",
"provider": "wecom",
"channel_type": "wecom_mail",
"name": "告警通道",
"status": "active",
"credential_ref": "cred_01"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
The ID and workspace of the deleted instance. |
|
string |
The ID and workspace of the deleted instance. |
|
string |
Provider, channel type and status before deletion. |
|
string |
Provider, channel type and status before deletion. |
|
string |
Provider, channel type and status before deletion. |
|
string |
A reference to the instance name and deleted credentials. |
|
string |
A reference to the instance name and deleted credentials. |
Error response¶
{
"code": 3,
"message": "channel instance not found"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
Invalid provider or instance ID. |
Check path parameters. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have the permission to delete the instance. |
Check workspace authorization. |
|
|
The instance does not exist or does not belong to the Provider in the path. |
Check the Provider and Instance ID. |
|
|
Channel instance services or authorization dependencies are temporarily unavailable. |
Try again later. |
Follow-up operations¶
To continue using this Provider, please Create channel instance.