Connect a Teams or Discord channel
Connects a channel through its incoming webhook. The address must be https and on the host the service documents for its webhooks (Teams: a Workflows address on logic.azure.com or environment.api.powerplatform.com; Discord: discord.com/api/webhooks); anything else is refused. The address goes to the
better-auth.session_token<token>Better Auth session cookie. Production uses the __Secure- prefixed name.
kind*stringWhich chat the channels are in.
"teams""discord"Idempotency-Key?stringMakes retries safe. A repeated key with the same request returns the first result and sets
Idempotent-Replayed: true. The same key with a different request answers 409
idempotency.key_reused, and while the first request is still running 409
idempotency.in_progress. Results are kept for 24 hours. Server errors and refusals for lack
of sign-in or permission are not kept, so a retry runs again.
^[A-Za-z0-9_.:-]+$1 <= length <= 255application/json- body
name*string1 <= length <= 100webhookUrl*stringThe incoming webhook address. It is a secret and is never returned.
length <= 1024rules?Which events a channel takes. An empty list matches everything, so a channel with no rules takes every event.
The channel.
application/json- response
id*stringuuidkind*string"teams""discord"name*stringhost*stringThe host of the webhook address.
tail*stringThe last characters of the webhook address, which is all that is shown of it.
paused*booleanfailing*booleanTrue while the newest post to the channel failed.
lastError?stringlastOkAt?stringdate-timelastFailureAt?stringdate-timerules*Which events a channel takes. An empty list matches everything, so a channel with no rules takes every event.
createdAt*stringdate-timeupdatedAt*stringdate-timecurl -X POST 'https://wardn.example.com/api/v1/integrations/chat-webhooks/teams/channels' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "webhookUrl": "string"}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "kind": "teams", "name": "string", "host": "string", "tail": "string", "paused": true, "failing": true, "lastError": "string", "lastOkAt": "2019-08-24T14:15:22Z", "lastFailureAt": "2019-08-24T14:15:22Z", "rules": { "events": [ "string" ], "environments": [ "string" ], "teams": [ "string" ], "minSeverity": "info" }, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}List the Teams or Discord channels GET
The channels connected for this chat, by name, with the host of each webhook address and its last four characters. The address itself is never returned.
Change a Teams or Discord channel PATCH
Changes the name, the rules, whether the channel is paused, or its webhook address. Fields left out stay as they are. A paused channel takes no events; nothing is disconnected.