Benachrichtigungen
Crew-Mitglieder über verschiedene Kanäle benachrichtigen — Push, E-Mail und SMS.
Notification-Typen
| Typ | Verwendung |
|---|---|
| briefing | Tagesbreifing mit Fluginformationen |
| check_in_reminder | Erinnerung an Check-in 2h vor Briefingzeit |
| schedule_change | Dienstplanänderung — neuer Flug, Streichung, Swap |
| standby_call | Standby-Aktivierung — bitte sofort melden |
| emergency | Kritische Betriebsmeldung — sofortige Aktion erforderlich |
POST /notifications/send
POSThttps://api.aeroselect.io/api/v1/crewops/notifications/send
| Feld | Typ | Pflicht | Beschreibung |
|---|---|---|---|
| crew_member_ids | array | Pflicht | Array von Crew-Member-IDs (Empfänger) |
| type | enum | Pflicht | briefing | check_in_reminder | schedule_change | standby_call | emergency |
| title | string | Pflicht | Benachrichtigungstitel (max. 100 Zeichen) |
| message | string | Pflicht | Benachrichtigungstext (max. 1.000 Zeichen) |
| channels | array | Optional | push | email | sms (Standard: [push, email]) |
| data | object | Optional | Optionale strukturierte Daten (z.B. flight_id, duty_id) |
cURLBash
curl -X POST "https://api.aeroselect.io/api/v1/crewops/notifications/send" \
-H "X-API-Key: ak_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"crew_member_ids": [201, 215, 220],
"type": "schedule_change",
"title": "Dienstplanänderung LH1234",
"message": "Ihr Flug LH1234 (FRA→JFK) wurde auf 08:30 UTC vorverlegt. Neues Briefing: 06:00 UTC Gate B42.",
"channels": ["push", "email", "sms"],
"data": {
"flight_id": 5001,
"duty_id": 1001
}
}'Response 200JSON
{
"status": "sent",
"recipients": 3,
"sent_via": {
"push": 3,
"email": 3,
"sms": 3
},
"notification_id": "ntf_abc123xyz",
"sent_at": "2026-05-22T03:30:00Z"
}Node.js — Emergency broadcastJavaScript
// Alle aktiven Crew-Mitglieder notfallbenachrichtigen
async function broadcastEmergency(message: string, crewIds: number[]) {
const response = await fetch(
"https://api.aeroselect.io/api/v1/crewops/notifications/send",
{
method: "POST",
headers: {
"X-API-Key": process.env.AEROSELECT_API_KEY!,
"Content-Type": "application/json",
},
body: JSON.stringify({
crew_member_ids: crewIds,
type: "emergency",
title: "NOTFALLMELDUNG",
message,
channels: ["push", "email", "sms"],
}),
}
);
return response.json();
}