HomeDocsAPIWebhooks & Events
API

Webhooks & Events

Real-time event system and webhook configuration.

bthavanishBy bthavanish

Webhooks and Real-time Events

WebSocket

Airlink includes a WebSocket server for real-time communication. The WebSocket connection is authenticated via the user’s session cookie.

Connection

ws://your-panel.com/socket.io/

The Socket.IO client library handles reconnection and heartbeat automatically.

Events

Server Console

Real-time console output from game server containers:

Event: server:console
Payload: { serverId: string, line: string }

Server Status

Status change notifications:

Event: server:status
Payload: { serverId: string, status: string, running: boolean }

Activity

Activity log notifications for admins:

Event: activity
Payload: { event: string, actor: string, server?: string, metadata?: object }

Activity Logging

All significant actions are logged to the ActivityLog database table. This is not a webhook system but provides an audit trail.

Logged Events

EventDescription
server.createdServer created
server.updatedServer settings changed
server.deletedServer deleted
server.power.startServer started
server.power.stopServer stopped
server.power.restartServer restarted
server.power.killServer killed
server.reinstallServer reinstalled
backup.createdBackup created
backup.deletedBackup deleted
backup.restoredBackup restored
database.createdDatabase created
database.deletedDatabase deleted
database.password.rotatedDatabase password rotated
schedule.createdSchedule created
schedule.deletedSchedule deleted
schedule.executedSchedule ran
subuser.createdSub-user added
subuser.updatedSub-user permissions changed
subuser.deletedSub-user removed
startup.command.updatedStartup command changed
startup.docker.updatedDocker image changed
startup.variables.updatedEnvironment variables changed
user.createdUser created (admin)
user.updatedUser updated (admin)
user.deletedUser deleted (admin)
user.ownership.transferredServer ownership transferred
node.createdNode created
node.updatedNode updated
node.deletedNode deleted
node.maintenance.enabledNode maintenance mode on
node.maintenance.disabledNode maintenance mode off
settings.*.updatedSettings changed
settings.ip.bannedIP banned
settings.ip.unbannedIP unbanned
account.username.updatedUsername changed
account.email.updatedEmail changed
account.password.updatedPassword changed
account.avatar.updatedAvatar changed
account.avatar.removedAvatar removed
account.2fa.enabled2FA enabled
account.2fa.disabled2FA disabled
account.images.createdUser image created
account.images.importedUser image imported
account.images.deletedUser image deleted
account.folders.createdFolder created
account.folders.deletedFolder deleted
account.folders.serverAddedServer added to folder
account.folders.serverRemovedServer removed from folder
account.onboarding.completedOnboarding completed
account.onboarding.skippedOnboarding skipped
location.createdLocation created
location.updatedLocation updated
location.deletedLocation deleted

Activity Log Fields

Each log entry contains:

  • actorId (user who performed the action, nullable for system events)
  • serverId (server the action relates to, nullable for non-server events)
  • event (event type string)
  • metadata (JSON string with additional context)
  • ip (IP address of the actor)
  • createdAt (timestamp)

Querying Activity

Activity logs are viewable in the admin panel under Activity. The V2 API does not currently expose a public activity endpoint (activity data is managed through the admin UI).

Future: Webhook Support

The panel architecture supports adding outbound webhooks. The ActivityLog table and event taxonomy make this possible. A webhook system would:

  1. Let admins register HTTP endpoints to receive event notifications
  2. POST event data as JSON to registered URLs
  3. Support event filtering (only certain event types)
  4. Include retry logic for failed deliveries

This is not yet implemented.