Skip to main content

Teams and webhooks

Slack reaches people one by one. Microsoft Teams and a generic webhook work differently: they receive everything Delegaris announces as a stream of posts, to a channel or to another system.

What is sent:

EventWhat it covers
keep_onKeep-on reminders and ends
approvalApproval requests and decisions
access_requestRequests for access, and their answers
alertAlerts: AWS credentials failing, timed stops not finishing, backups failing
summaryThe weekly summary, on Mondays. It is only produced when Slack is connected and a Weekly summary channel is set
testTest messages

Both are set under Settings > Notifications, in the Microsoft Teams and webhooks section. Either, both or neither can be used, alongside Slack or without it.

Microsoft Teams​

Teams receives posts through a Workflows webhook.

  1. In Teams, on the channel, open Workflows and choose Post to a channel when a webhook request is received.
  2. Follow the steps and copy the address it gives you.
  3. In Delegaris, paste it into Microsoft Teams under Settings > Notifications.
  4. Press Test beside it. A test message arrives in the channel, and Delegaris shows "Teams: Sent." or why not.
  5. Press Save changes.

Posts arrive as Adaptive Cards. Office 365 connector addresses still work for as long as Microsoft keeps them.

Teams posts carry a link to the right page in Delegaris instead of buttons. Buttons in Teams need a registered bot, which a channel webhook is not. Approvals are decided on the Approvals page.

Generic webhook​

Any HTTPS address can receive the events as JSON: a ticketing system, a chat bot, a log collector.

  1. Enter the address in Webhook.
  2. Optionally enter a Webhook secret, so the receiver can check posts really came from Delegaris.
  3. Press Test beside the address. Delegaris sends a test event and shows "Webhook: Sent." or why not.
  4. Press Save changes.

The secret is never shown again. To keep it, leave the box empty when saving; to replace it, type a new one.

What is sent​

Each event is an HTTP POST with a JSON body:

{
"source": "delegaris",
"event": "approval",
"text": "**Jane Smith** asks to stop `uat-web-1`. Approve or decline in Delegaris: https://delegaris.example.com/#/approvals",
"at": "2026-11-13T17:42:05.118342Z",
"data": {
"request_id": 42,
"status": "pending",
"requested_by": "jsmith",
"action": "stop",
"resources": [
{
"account_id": "111111111111",
"account_name": "Development",
"region": "eu-west-2",
"type": "ec2",
"id": "i-0abc123def4567890",
"name": "uat-web-1"
}
]
}
}
FieldMeaning
sourceAlways delegaris
eventOne of the events listed above
textThe message as a person would read it, in Markdown (**bold**, [label](link))
atWhen it was sent, UTC
dataExtra fields for some events (below). Empty for others

data by event:

Eventdata fields
approvalrequest_id, status (pending, approved, declined or expired), requested_by, decided_by (once decided), action, resources
access_requestrequest_id, status (pending, granted or declined)
keep_onperson: the name of the person the message is for
testby: the administrator who pressed Test
alert, summarynone

Headers​

HeaderValue
Content-Typeapplication/json
X-Delegaris-EventThe event, for example approval
X-Delegaris-SignatureOnly when a secret is set: sha256= followed by the HMAC-SHA256 of the raw body, keyed with the secret, as lowercase hex

Checking the signature​

Compute the HMAC-SHA256 of the request body exactly as received, using the secret, and compare it with the header. For example, in Python:

import hashlib
import hmac

def is_from_delegaris(body: bytes, header: str, secret: str) -> bool:
expected = "sha256=" + hmac.new(secret.encode("utf-8"), body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, header or "")

Check the raw bytes before parsing the JSON: re-encoding it may change the spacing and break the match.

Delivery​

  • Each post waits up to 10 seconds for an answer. Any answer below 300 counts as delivered.
  • A failed post is logged by Delegaris and not retried. A webhook that is down never stops the work that caused the message.
  • For a complete, durable record, use the activity log export to S3 instead; the webhook is a live feed.

Allowed addresses​

Addresses must start with https:// (or http://). Addresses that point at the Delegaris host itself (loopback) or at link-local addresses, such as the EC2 instance metadata service, are refused, so a webhook can never be aimed at the instance's credentials.

Setting them in .env​

Starting values can be given in .env:

TEAMS_WEBHOOK_URL=https://example.logic.azure.com/workflows/your-workflow-address
WEBHOOK_URL=https://hooks.example.com/delegaris
WEBHOOK_SECRET=choose-a-long-random-secret

Once saved under Settings > Notifications, the saved values apply on every copy of the service.

Next steps​