Skip to content

Using Server Webhooks

This document provides a detailed guide on using Crafty's server webhooks to dispatch notifications. Webhooks are user-defined HTTP callbacks that you can use to notify you when certain server events happen, making them crucial for real-time updates.

With Crafty, you can set up webhooks to send notifications to various platforms like Slack, Mattermost, Discord, and Teams, with more integrations planned for the future.

This document will walk you through the basics of configuring webhooks, setting up notification providers, and customizing messages for different services.

Setting Up Server Webhooks 4.2.0

Server Webhook Overview

Notification Provider

Choose the provider you want to integrate with from the available list. Expect more of these to be added in the future!

API Limitations

Be mindful of the rate limits imposed by the services you are integrating with. Exceeding these limits could result in delayed or lost notifications.

Webhook Name

This will be used in the dispatched webhook as the title of the notification

Webhook URL

The call-back URL of the provider you have selected, make sure to match this up with the correct provider, or you may recieve some un expected error messages.

Bot Name

The user name you'd like the message to appear from in your provider, this only works on certain providers and may need manually set in your providers webhook settings.

Event Triggers

Select the events that will trigger notifications. Whether it's server start-ups, shut-downs, or user-defined events, you can control what gets announced and when.

Customise Messages

Tailor the notification messages to suit your audience. For most providers you can use markdown formatting and soon you'll be able to include dynamic variables from Crafty's server environment.

Colour Accent

Some providers support a colour accent, such as a strip of colour on the notification message, customise this with the provied colour picker, or leave as pretty blue 😊

Test Notification

Be sure to send a test notification to verify that your webhook is configured correctly and the message appears as intended on your chosen provider.


Webhook Actions

Webhook Actions

New Webhook

Select and configure a new service to integrate with your server.

Test Webhook πŸ§ͺ

Click this to send a test notification with your current configuration.

Edit Message Template ✏️

Customise the notification message for each service.

Delete Service πŸ—‘οΈ

Remove an integration if it's no longer needed.

Jinja2 Dynamic Variables 4.6.1

Crafty’s webhook system supports full Jinja2 variable rendering, allowing you to dynamically inject live server data, timestamps and event-specific information directly into your webhook payloads. This gives you far more flexibility when dispatching to external services.

Base URL

For variables that provide links such as backup_link you can adjust the base URL for these links and Crafty's main configuration

Jinja2 Template Examples

{% if event_type == "start_server" %}
Server `{{ server_name }}` has started!
{% elif event_type == "stop_server" %}
Server `{{ server_name }}` has stopped.
{% else %}
Event: `{{ event_type }}` on server `{{ server_name }}`
{% endif %}
Iso: `{{ time_iso }}`
**{{ server_name }}** backup completed.
{% if backup_name.endswith('.zip') %}
**Backup Type** - Archive
{% else %}
**Backup Type** - Snapshot
{% endif %}
{% if backup_status == "βœ…" %}
Backup succeeded!
**File Name** - {{ backup_name }}
**Backup Size** - {{ backup_size }}
**Download Link** - {{ backup_link }}
{% else %}
Backup Failed! D:
**Reason** - {{ backup_error }}
{% endif %}
Iso: `{{ time_iso }}`

Given discord allows you to do some fancy time stamping, which shows a time in the viewer's local time, you have the ability inject these on the fly with Unix time, Check here for alternative syntax!

Event: `{{ event_type }}` on server `{{ server_name }}`
Disco_unix 1: <t:{{ time_unix }}:T>
Disco_unix 2: <t:{{ time_unix }}:F>
Disco_unix 3: <t:{{ time_unix }}:R>

Dynamic Variables Currently Supported in Webhook Templates

Description
Variable
Example
General Variables
Server Name {{ server_name }} My First Server
Server ID {{ server_id }} ef3fb2d1-a94c-4d9b-8c65-c4274be706cb
Event Type {{ event_type }} start_server
ISO 8601 {{ time_iso }} 2025-11-16T19:54:27.915915Z
UNIX timestamp (useful for Discord) {{ time_unix }} 1763322867
Day/Month/Year in UTC {{ time_[day\|month\|year] }} 22 / 11 / 2025
Event Specific Variables
Command sent (From Panel) {{ command }} say hello world
Backup file name {{ backup_name }} 2025-11-19_17-30-57.zip
Backup file download link {{ backup_link }} https://127.0.0.1:8443/api/v2/servers/50fb7273-9ee3-4407-aaed-f523c27daedb/backups/backup/0683f7fb-09a2-432f-9dd6-775019f75fae/download/2025-11-19_17-30-57.zip
Backup file size {{ backup_size }} 248.6MB
Backup Status {{ backup_status }} βœ… / ❌
Backup Error {{ backup_error }} [Errno 2] No such file or directory: F:\Users\bill-gates\crafty-4\backups\50fb7273-9ee3-4407-aaed-f523c27daedb\0683f7fb-09a2-432f-9dd6-775019f75fae\2025-11-19_17-30-57.zip'