Emails
Endpoints pour gérer les emails reçus
Liste des emails
Récupère la liste des emails pour une adresse.
GET /api/v1/emails
Scope requis : emails:read
Paramètres de requête
| Paramètre | Type | Description |
|---|---|---|
address_id | string | Filtrer par adresse (optionnel) |
limit | number | Nombre de résultats (défaut: 20, max: 100) |
offset | number | Décalage pour la pagination |
Exemple
curl -X GET "https://api.junkmail.dev/api/v1/emails?address_id=addr_123abc&limit=10" \
-H "Authorization: Bearer jm_live_xxxx"
Réponse
{
"success": true,
"data": {
"emails": [
{
"id": "email_789ghi",
"addressId": "addr_123abc",
"type": "received",
"from": "noreply@example.com",
"fromName": "Service Client",
"to": "test@junkmail.dev",
"subject": "Confirmation de votre inscription",
"bodyText": "Merci de confirmer...",
"bodyHtml": "<p>Merci de confirmer...</p>",
"isRead": true,
"isStarred": false,
"receivedAt": "2024-01-16T14:30:00Z",
"hasAttachments": false
}
],
"total": 1,
"limit": 10,
"offset": 0
}
}
Récupérer un email
Récupère le contenu complet d'un email.
GET /api/v1/emails/:id
Scope requis : emails:read
Exemple
curl -X GET https://api.junkmail.dev/api/v1/emails/email_789ghi \
-H "Authorization: Bearer jm_live_xxxx"
Réponse
{
"success": true,
"data": {
"id": "email_789ghi",
"addressId": "addr_123abc",
"type": "received",
"from": "noreply@example.com",
"fromName": "Service Client",
"to": "test@junkmail.dev",
"subject": "Confirmation de votre inscription",
"bodyText": "Merci de confirmer votre adresse email en cliquant sur le lien suivant...",
"bodyHtml": "<html><body><p>Merci de confirmer votre adresse email...</p></body></html>",
"isRead": true,
"isStarred": false,
"receivedAt": "2024-01-16T14:30:00Z",
"attachments": []
}
}
Supprimer un email
Supprime un email spécifique.
DELETE /api/v1/emails/:id
Scope requis : emails:write
Exemple
curl -X DELETE https://api.junkmail.dev/api/v1/emails/email_789ghi \
-H "Authorization: Bearer jm_live_xxxx"
Réponse
{
"success": true,
"data": {
"deleted": true,
"id": "email_789ghi"
}
}