API7 Docs

Update Notification Channel

PATCH /notification_channels/{channel_id}

PATCH /notification_channels/{channel_id}

Interactive request editor loads with JavaScript.

Authorization

BearerAdminToken
AuthorizationBearer <token>

Organization-scoped admin token. Read operations require a valid token, and write operations require a token with write permission.

In: header

Path Parameters

channel_id*string

Notification channel ID.

Formatuuid

Request Body

application/json

Update-notification-channel body. Fields left out keep their current values.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "$AISIX_CP/notification_channels/$CHANNEL_ID" \  -H "Authorization: Bearer $AISIX_TOKEN" \  -H "Content-Type: application/json" \  -d '{}'

OK

{
  "notification_channel": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
    "name": "string",
    "type": "webhook",
    "url": "string",
    "enabled": true,
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
Complete operation details and schema variants

PATCH /notification_channels/{channel_id}

Update Notification Channel

Update a channel's name, type, URL, or enabled state. Fields left out keep their current values. Disabling a channel stops future deliveries; already-queued deliveries to it are marked failed rather than parked.

Reads mask url, so a read-modify-write sends the mask back under the field that writes it. That echo is accepted and keeps the stored URL rather than storing the redaction. A mask carries only the scheme and host, so the check is host-level: a masked value naming a different host is rejected with 400, while one naming the same host is accepted and changes nothing. Only a full URL replaces the credential.

Parameters

  • channel_id (path, string, required): Notification channel ID.

Request body

Content type: application/json

  • name (string, optional): New channel name.

  • type (string, optional): Delivery mechanism. webhook posts alert events as JSON; slack posts a rendered text message to a Slack incoming-webhook URL.

  • url (string, optional): New destination URL. Omit it to keep the stored one — the stored URL is never returned, so there is nothing to echo back except the mask.

Sending the mask reads return is accepted as an echo and keeps the stored URL; a masked value naming a different host is rejected with 400. Because a mask carries only the scheme and host, any same-host mask is treated as that echo. Only a full URL replaces the credential.

  • enabled (boolean, optional): New enabled state.

Responses

  • 200: OK

  • notification_channel (object, required): An outbound alert destination. Enabled channels receive every alert raised in the organization.

  • notification_channel.id (string, required): Notification channel ID.

  • notification_channel.org_id (string, required): Organization that owns this channel.

  • notification_channel.name (string, required): Human-readable channel name, unique per organization.

  • notification_channel.type (string, required): Delivery mechanism. webhook posts alert events as JSON; slack posts a rendered text message to a Slack incoming-webhook URL.

  • notification_channel.url (string, required): Masked destination URL (scheme://host/***). The full URL — which for Slack incoming webhooks IS the credential — is write-only.

This masked value may be sent straight back on update, so a read-modify-write round-trip works unchanged: it is accepted as an echo and keeps the stored URL. It never writes anything — a masked value naming a different host is rejected with 400 rather than stored, since storing it would replace the credential with the redaction. The mask carries only the scheme and host, so it does not identify one channel: a mask read from another channel on the same host is accepted here too, and likewise changes nothing.

  • notification_channel.enabled (boolean, required): Whether new alerts are delivered to this channel.

  • notification_channel.created_at (string, required): Time when the channel was created.

  • notification_channel.updated_at (string, required): Time when the channel was last updated.

  • 400: Request body or parameters failed validation.

  • error (object, required): Error details.

  • error.code (string, required): Machine-readable identifier. Examples: UNAUTHENTICATED, INVALID_REQUEST, MASTER_KEY_UNSET, INTERNAL.

  • error.message (string, required): Human-readable explanation; safe to surface to operators.

  • 401: Missing or invalid bearer. Response fields (application/json): identical to PATCH /notification_channels/{channel_id}, response 400 above.

  • 404: Resource not found. Response fields (application/json): identical to PATCH /notification_channels/{channel_id}, response 400 above.

  • 409: The organization already has a channel with this name. Response fields (application/json): identical to PATCH /notification_channels/{channel_id}, response 400 above.

cURL

curl -X PATCH '$AISIX_CP/notification_channels/{channel_id}' -H 'Authorization: Bearer $AISIX_TOKEN'