REST API v1

Entwickler-REST-API-Dokumentation

Erstelle programmatisch Wegwerf-Postfächer und extrahiere OTP-Codes oder Magic Links. Erfordert einen aktiven Premium-Plan — siehe Preise.

1. Authentifizierung

Authentifiziere jede Anfrage mit deinem geheimen API-Schlüssel im X-API-Key-Header. Erstelle einen Schlüssel in deinem Dashboard.

X-API-Key: khml_live_9f87a6b5c4d3e2f10987
Codebeispiel:
POST/api/developers/aliases/

Erstellt ein neues Wegwerf-Postfach für dein Konto.

curl -X POST "https://api.zephbox.com/api/developers/aliases/" \
  -H "X-API-Key: YOUR_API_KEY"
        
const res = await fetch('https://api.zephbox.com/api/developers/aliases/', {
  method: 'POST',
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const alias = await res.json();
console.log('Address:', alias.email);
        
import requests

headers = {'X-API-Key': 'YOUR_API_KEY'}
res = requests.post('https://api.zephbox.com/api/developers/aliases/', headers=headers)
print(res.json()['email'])
        

Antwort

{
  "id": 4821,
  "alias": "x7k2p9",
  "email": "[email protected]",
  "is_expired": false,
  "time_remaining": 86400,
  "message_count": 0
}
        
GET/api/developers/aliases/{alias}/otp/

Extrahiert einen Verifizierungscode oder Magic Link aus der neuesten Nachricht des Postfachs. Liefert die neueste Nachricht mit code/link auf null, wenn nichts übereinstimmt — nie ein bloßes 404, sobald Post angekommen ist.

curl -X GET "https://api.zephbox.com/api/developers/aliases/x7k2p9/otp/" \
  -H "X-API-Key: YOUR_API_KEY"
        
const res = await fetch('https://api.zephbox.com/api/developers/aliases/x7k2p9/otp/', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const { code, link } = await res.json();
console.log('Code:', code);
        
import requests

headers = {'X-API-Key': 'YOUR_API_KEY'}
res = requests.get('https://api.zephbox.com/api/developers/aliases/x7k2p9/otp/', headers=headers)
print(res.json()['code'])
        

Antwort

{
  "message_id": 91823,
  "subject": "Your verification code",
  "sender": "[email protected]",
  "received_at": "2026-08-29T10:15:00Z",
  "code": "482913",
  "link": null
}
        

Wartest du auf einen Code, der noch nicht angekommen ist?

Nutze stattdessen GET /api/developers/aliases/{alias}/wait-for-otp/ — das blockiert serverseitig (begrenzt, bis zu 20 Sekunden), bis eine neue Nachricht ankommt, statt dass du in einer Schleife abfragst. Siehe unseren Leitfaden Webhooks vs. Polling dazu, wann welche Option sinnvoll ist.

Die vollständige Endpunkt-Referenz (Webhooks, API-Schlüssel-Verwaltung, Nachrichtenliste) ist verfügbar, sobald du Premium hast — siehe dein Dashboard, oder automatisiere das mit Python über das zephbox SDK.