API Documentation

Email Management

Create Random Email

POST /api/create-email

Request Body:

{
    "domain": "string" // Optional, defaults to iredmail.my.id
}

Response:

{
    "success": true,
    "email": "random123@domain.com"
}

Create Named Email

POST /api/create-named-email

Request Body:

{
    "firstName": "string",
    "lastName": "string",
    "domain": "string" // Optional, defaults to iredmail.my.id
}

Response:

{
    "success": true,
    "email": "firstname.lastname123@domain.com"
}

Get Messages

GET /api/messages/:emailId

Parameters:

emailId: The part before @ in the email address

Response:

{
    "success": true,
    "messages": [
        {
            "id": "string",
            "from": "string",
            "subject": "string",
            "date": "string",
            "content": "string"
        }
    ]
}

Error Responses

Common Error Response Format:

{
    "success": false,
    "message": "Error description"
}

Common Status Codes:

  • 400 - Bad Request (Invalid parameters)
  • 401 - Unauthorized (Invalid or missing token)
  • 403 - Forbidden (Insufficient permissions)
  • 404 - Not Found
  • 500 - Internal Server Error