API Documentation

Free Email API Documentation

Integrate disposable email into your application in minutes. No authentication required for public endpoints.

Quick Start

Get Started in 30 Seconds

  1. 1

    Choose an email address

    Use any address @catchmail.io or your own domain

  2. 2

    Send emails to that address

    From your app, test suite, or manually

  3. 3

    Fetch messages via API

    Use our REST API to read, list, or delete messages

curl "https://api.catchmail.io/api/v1/mailbox?address=test@catchmail.io"

Base URL

https://api.catchmail.io

Rate Limits

Anonymous Access

1 request per second per IP

With API Key

Higher limits available (contact us)

API Endpoints

All endpoints return JSON responses

GET

List Mailbox Messages

/api/v1/mailbox

Retrieve all messages for a specific email address. Returns message metadata including sender, subject, date, and size.

Parameters

NameTypeRequiredDescription
addressstringFull email address (e.g., test@catchmail.io)
pageinteger-Page number (default: 1)
page_sizeinteger-Messages per page (default: 50)
curl "https://api.catchmail.io/api/v1/mailbox?address=test@catchmail.io"

Response

{
  "address": "test@catchmail.io",
  "page": 1,
  "page_size": 50,
  "count": 2,
  "messages": [
    {
      "id": "abc123",
      "mailbox": "test@catchmail.io",
      "from": "sender@example.com",
      "subject": "Welcome!",
      "date": "2024-01-15T10:30:00Z",
      "size": 1234
    }
  ]
}
GET

Get Message Details

/api/v1/message/{id}

Retrieve the full content of a specific message, including headers, body (HTML and plain text), and attachment metadata.

Parameters

NameTypeRequiredDescription
idstringMessage ID (path parameter)
mailboxstringFull email address
curl "https://api.catchmail.io/api/v1/message/{message_id}?mailbox=test@catchmail.io"

Response

{
  "id": "abc123",
  "mailbox": "test@catchmail.io",
  "from": "sender@example.com",
  "to": ["test@catchmail.io"],
  "subject": "Welcome!",
  "date": "2024-01-15T10:30:00Z",
  "size": 1234,
  "headers": { ... },
  "body": {
    "text": "Plain text content",
    "html": "<html>HTML content</html>"
  },
  "attachments": [
    {
      "id": "att1",
      "filename": "document.pdf",
      "content_type": "application/pdf",
      "size": 5678,
      "download_url": "/api/v1/attachment/att1?mailbox=test@catchmail.io"
    }
  ]
}
DELETE

Delete Message

/api/v1/message/{id}

Permanently delete a message. Returns 204 No Content on success.

Parameters

NameTypeRequiredDescription
idstringMessage ID (path parameter)
mailboxstringFull email address
curl -X DELETE "https://api.catchmail.io/api/v1/message/{message_id}?mailbox=test@catchmail.io"

Custom Domain Setup

Use your own domain for private, unlimited email addresses

DNS Configuration

1

Add MX Record

Go to your DNS provider and add the following MX record:

Type:     MX
Host:     @ (or your subdomain)
Value:    smtp.catchmail.io
Priority: 10
TTL:      3600
2

Wait for Propagation

DNS changes can take up to 24-48 hours to propagate, but usually happen within minutes.

3

Start Using Your Domain

That's it! Any email sent to *@yourdomain.com will be catchable via the API.

Using Your Custom Domain with the API

# After setting up MX record for yourdomain.com -> smtp.catchmail.io

# List messages for your custom domain
curl "https://api.catchmail.io/api/v1/mailbox?address=any@yourdomain.com"

# Any address works: support@, test@, user123@, etc.

Privacy Guarantee

Custom domains are completely private. They are never listed publicly, and only requests with the exact email address can access the messages. Perfect for CI/CD pipelines, automated testing, and private workflows.

Error Handling

All errors are returned with a consistent JSON structure:

{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Too many requests. Please wait before trying again."
  }
}

HTTP Status Codes

CodeDescription
200Success
204Success (no content) - for DELETE operations
400Bad request - invalid parameters
404Not found - message or mailbox doesn't exist
429Rate limit exceeded - slow down requests
500Server error - try again later

Ready to Get Started?

No signup required. Start using the API right now.