API Documentation
Welcome to the NonMail API documentation! This API allows you to programmatically create and manage temporary email addresses.
API Endpoints
Our API is designed to be simple and easy to use. All endpoints are accessible via https://api.nonmail.com/v1/
/v1/email/createCreates a new temporary email address.
Request Body:
{
"duration": 300,
"prefix": "my-temp-mail"
}Response:
{
"status": "success",
"email": "my-temp-mail_12345@nonmail.com",
"token": "your_access_token",
"expires_at": 1678886400
}/v1/email/inboxRetrieves all emails received by a specific temporary email address.
Headers:
Authorization: Bearer your_access_tokenResponse:
{
"status": "success",
"emails": [
{
"id": "email_id_1",
"from": "sender@example.com",
"subject": "Hello from NonMail",
"body_preview": "This is a preview of the email content...",
"received_at": 1678885000
}
]
}/v1/email/message/email_id_1Retrieves the full content of a specific email.
Headers:
Authorization: Bearer your_access_tokenResponse:
{
"status": "success",
"id": "email_id_1",
"from": "sender@example.com",
"subject": "Hello from NonMail",
"body": "<html><body><p>Full email content goes here.</p></body></html>",
"received_at": 1678885000
}Authentication
All authenticated endpoints require an API token obtained when creating a new email. Pass this token in the Authorization header as a Bearer token.
Authorization: Bearer your_access_tokenError Handling
Our API uses standard HTTP status codes to indicate the success or failure of an API request.
Rate Limiting
To ensure fair usage, we implement rate limits. Currently, you are allowed 100 requests per minute per IP address. Exceeding this limit will result in a 429 Too Many Requests error.
Language Support
The API documentation is available in 8 languages. You can specify the desired language by setting the Accept-Language header in your API requests, or by selecting it on the documentation page.
Example: Accept-Language: ar for Arabic.
Accept-Language: arSupport
If you have any questions or encounter issues, please contact our support team at support@nonmail.com.
Example Usage
Here's a complete example of how to use the API with curl:
curl -X POST https://api.nonmail.com/v1/email/create \
-H "Content-Type: application/json" \
-d '{
"duration": 300,
"prefix": "my-temp-mail"
}'