JunkMail

API Reference

Complete JunkMail API documentation for developers

The API is available exclusively with the Business plan.

Introduction

The JunkMail API allows you to integrate temporary email features into your applications. Create addresses, retrieve emails, configure webhooks, and manage forwarding programmatically.

Base URL

https://api.junkmail.dev/api/v1

Authentication

All API requests require an API key in the Authorization header:

Authorization: Bearer jm_live_xxxxxxxxxxxx

Response Format

The API returns JSON responses:

{
  "data": { ... }
}

In case of an error:

{
  "error": "Error description"
}

Rate Limiting

PlanRequests/minute
Business100

Rate limit headers are included in every response:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640000000

Endpoints

EndpointDescription
AuthenticationAPI key management and scopes
AddressesCreate/list/delete temporary addresses
EmailsRetrieve/delete received emails
Send EmailsSend emails from a temporary address
DomainsManage your custom domains
ForwardingManage email forwarding
AnalyticsStatistics and metrics
WebhooksConfigure webhooks
ErrorsError codes

Audit Logs

All actions performed via the API are recorded in the audit logs. You can access them via:

GET /api/v1/audit-logs
ParameterTypeDescription
limitnumberNumber of results (default: 20)
offsetnumberOffset for pagination

SDK

SDKs are available to simplify integration:

  • JavaScript/TypeScript - npm install @junkmail/sdk
  • Python - pip install junkmail

Quick Example

# Create a temporary address
curl -X POST https://api.junkmail.dev/api/v1/addresses \
  -H "Authorization: Bearer jm_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{"alias": "test-api"}'

Response:

{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "address": "test-api@junkmail.site",
    "alias": "test-api",
    "isActive": true,
    "createdAt": "2024-01-15T10:00:00Z",
    "expiresAt": "2024-01-22T10:00:00Z",
    "forwarding": null
  }
}