Non Mail Logo

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/

POST/v1/email/create
Create a new temporary email address

Creates a new temporary email address.

Request Body:

json
{
  "duration": 300,
  "prefix": "my-temp-mail"
}

Response:

json
{
  "status": "success",
  "email": "my-temp-mail_12345@nonmail.com",
  "token": "your_access_token",
  "expires_at": 1678886400
}
GET/v1/email/inbox
Get emails for an address

Retrieves all emails received by a specific temporary email address.

Headers:

bash
Authorization: Bearer your_access_token

Response:

json
{
  "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
    }
  ]
}
GET/v1/email/message/email_id_1
Get a specific email

Retrieves the full content of a specific email.

Headers:

bash
Authorization: Bearer your_access_token

Response:

json
{
  "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.

bash
Authorization: Bearer your_access_token

Error Handling

Our API uses standard HTTP status codes to indicate the success or failure of an API request.

200 OKRequest was successful.
400 Bad RequestThe request was malformed or invalid.
401 UnauthorizedMissing or invalid API token.
404 Not FoundThe requested resource could not be found.
500 Internal Server ErrorSomething went wrong on our end.

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.

bash
Accept-Language: ar

Support

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:

bash
curl -X POST https://api.nonmail.com/v1/email/create \
  -H "Content-Type: application/json" \
  -d '{
    "duration": 300,
    "prefix": "my-temp-mail"
  }'
API Documentation - Non Mail | Temporary Email API Integration