API Documentation
Version 1.0 | Last Updated: March 2024
Overview
The TempMail Cloud API allows developers to integrate temporary email functionality into their applications. Our RESTful API provides endpoints for generating email addresses, receiving emails, and managing inbox content.
Authentication
All API requests require an API key. Include your key in the request header:
Authorization: Bearer YOUR_API_KEY
Base URL
All API endpoints are relative to:
https://api.tempmailcloud.com/v1
Endpoints
Generate Temporary Email
POST /emails
Creates a new temporary email address.
Response: Returns the email address and unique ID.
Get Inbox
GET /emails/{email_id}/inbox
Retrieves all emails in the inbox.
Response: Array of email objects with metadata.
Get Email Content
GET /emails/{email_id}/messages/{message_id}
Retrieves the full content of a specific email.
Response: Email body, attachments, and headers.
Delete Email
DELETE /emails/{email_id}/messages/{message_id}
Deletes a specific email from the inbox.
Response: Success message.
Rate Limits
API requests are rate-limited to prevent abuse:
- Free tier: 100 requests per hour
- Premium tier: 10,000 requests per hour
- Enterprise: Custom limits
Webhooks
Configure webhooks to receive real-time notifications when new emails arrive. Set your webhook URL in your API dashboard.
Code Examples
We provide SDKs for popular programming languages:
- JavaScript/Node.js: npm install @tempmail/sdk
- Python: pip install tempmail-cloud
- PHP: composer require tempmail/cloud
Get an API Key
To get started with the TempMail Cloud API:
- Create a free account at tempmailcloud.com
- Navigate to your account settings
- Generate your API key
- Start integrating!