API Documentation

REST API for bots, scripts, and automations. Authenticate with your personal token via x-api-token header.

Setup
# Bash variables
export TOKEN="your-api-token"
export BASE="https://mail.bibnk.cloud"
H="-H \"x-api-token: $TOKEN\""
J="-H \"content-type: application/json\""
GET/api/whoami

Check authenticated user info

curl $H "$BASE/api/whoami" | jq
GET/api/status

Server status — domain, SMTP, message count, domains list

curl $H "$BASE/api/status" | jq
GET/api/messages

List inbox. Filter: ?user=alias&limit=20

curl $H "$BASE/api/messages?user=hello&limit=10" | jq
GET/api/messages/:id

Full email detail — body, headers, attachments

curl $H "$BASE/api/messages/123" | jq
GET/api/latest

Long-poll for new mail (OTP catcher). Waits up to N seconds for a new message.

curl $H "$BASE/api/latest?user=hello&wait=30" | jq

# With since_id (only newer than ID)
curl $H "$BASE/api/latest?user=hello&since_id=5&wait=30" | jq
GET/api/aliases

List your claimed aliases

curl $H "$BASE/api/aliases" | jq
POST/api/aliases

Create alias — random or custom, specify domain

# Random
curl -X POST $H $J "$BASE/api/aliases" \
  -d '{"kind":"random","domain":"bibnk.cloud"}' | jq

# Custom
curl -X POST $H $J "$BASE/api/aliases" \
  -d '{"kind":"custom","local":"hello","domain":"bibnk.cloud"}' | jq
DEL/api/messages/:id

Delete a message by ID

curl -X DELETE $H "$BASE/api/messages/123" | jq
GET/api/domains

List all domains super_admin

curl $H "$BASE/api/domains" | jq
POST/api/domains

Add domain super_admin

curl -X POST $H $J "$BASE/api/domains" \
  -d '{"domain":"alt.example","mode":"public"}' | jq
POST/api/users

Create user admin+

curl -X POST $H $J "$BASE/api/users" \
  -d '{"username":"alice","role":"user"}' | jq
POST/api/regen-token

Regenerate API token (old one dies immediately)

curl -X POST $H "$BASE/api/regen-token" | jq
📬 SMTP Receiver — Server accepts mail to *@bibnk.cloud on port 25.
Test: swaks --to test@bibnk.cloud --server 43.134.130.236 --port 25