API Jo Mail pour les développeurs
Créez des boîtes temporaires et lisez les messages reçus depuis votre propre code, par exemple pour tester des parcours d’inscription.
Authentification
Créez une clé dans votre tableau de bord et envoyez-la avec chaque requête dans l’un de ces en-têtes.
X-Api-Key: jm_xxxxxxxxxxxxxxxx # or Authorization: Bearer jm_xxxxxxxxxxxxxxxx
Points d’accès
POST /api/inbox create an inbox {"guest":true,"name":"optional","domain":"jo-mail.org","ttl_minutes":60}
-> {"inbox":{"id":1,"address":"...","expires_at":...},"key":"1.abcdef..."}
GET /api/inbox list messages (header X-Inbox: <key>)
GET /api/inbox/wait?after=<lastId> long-poll: returns {"changed":true} as soon as a new message arrives
GET /api/inbox/messages/{id} read one message (subject, from, text, html, attachments)
GET /api/inbox/attachments/{id} download an attachment
DELETE /api/inbox/messages/{id} delete a message
POST /api/inbox/renew extend the lifetime
DELETE /api/inbox delete the inbox
Exemples
# 1) create an inbox
curl -s -X POST https://jo-mail.org/api/inbox \
-H "X-Api-Key: $JM_KEY" -H "Content-Type: application/json" \
-d '{"guest":true}'
# 2) wait for mail, then read it
curl -s "https://jo-mail.org/api/inbox/wait?after=0" -H "X-Inbox: $INBOX_KEY"
curl -s https://jo-mail.org/api/inbox -H "X-Inbox: $INBOX_KEY"
// JavaScript
const r = await fetch('https://jo-mail.org/api/inbox', {
method: 'POST',
headers: { 'X-Api-Key': KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ guest: true }),
});
const { inbox, key } = await r.json();
console.log(inbox.address); // use it to sign up, then poll /api/inbox/wait
Limite : 600 boîtes par heure et par clé. Les clés de boîte sont secrètes : quiconque la possède peut lire cette boîte.