Integrations
Preview

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

POST
/integrations/chat-webhooks/{kind}/channels
cookiebetter-auth.session_token<token>

Better Auth session cookie. Production uses the __Secure- prefixed name.

kind*string

Which chat the channels are in.

Value in"teams""discord"
Idempotency-Key?string

Makes 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.

Match^[A-Za-z0-9_.:-]+$
Length1 <= length <= 255
application/json
  1. body
name*string
Length1 <= length <= 100
webhookUrl*string

The incoming webhook address. It is a secret and is never returned.

Lengthlength <= 1024
rules?

Which events a channel takes. An empty list matches everything, so a channel with no rules takes every event.

Response Body

The channel.

application/json
  1. response
id*string
Formatuuid
kind*string
Value in"teams""discord"
name*string
host*string

The host of the webhook address.

tail*string

The last characters of the webhook address, which is all that is shown of it.

paused*boolean
failing*boolean

True while the newest post to the channel failed.

lastError?string
lastOkAt?string
Formatdate-time
lastFailureAt?string
Formatdate-time
rules*

Which events a channel takes. An empty list matches everything, so a channel with no rules takes every event.

createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
curl -X POST 'https://wardn.example.com/api/v1/integrations/chat-webhooks/teams/channels' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "webhookUrl": "string"}'
Example Response
{  "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"}