RXmail API
Simple REST API for creating disposable email addresses and managing inbox messages.
List Domains
GET
/api/domains/{apikey}
Get the current list of available domains.
Example Request
GET https://api.astaspot.xyz/api/domains/yourapikey
Response
[ "example.com", "test-domain.net", "demo.org" ]
Create or Validate Email
GET
/api/email/{email}/{apikey}
Create or validate an email address.
Example Request
GET https://api.astaspot.xyz/api/email/test@astaspot.xyz/yourapikey
Response
"test@astaspot.xyz"
Fetch Inbox Messages
GET
/api/messages/{email}/{apikey}
Fetch latest inbox messages.
Returns maximum 20 messages ordered by newest first.
Example Request
GET https://api.astaspot.xyz/api/messages/test@astaspot.xyz/yourapikey
Response (With Messages)
[
{
"textPlain": "Hello World",
"textHtml": "<div>Hello World</div>",
"id": 27,
"date": "2025-08-07 02:04:20",
"headers": {
"date": "2025-08-07 02:04:20",
"subject": "Wonderful Indonesia",
"toaddress": "test@astaspot.xyz",
"to": [{ "mailbox": "test", "host": "astaspot.xyz" }],
"fromaddress": "John Doe <johndoe@domain.com>",
"from": [{ "personal": "John Doe", "mailbox": "johndoe", "host": "domain.com" }]
},
"subject": "Wonderful Indonesia",
"fromName": "John Doe",
"fromAddress": "johndoe@domain.com",
"to": { "test@astaspot.xyz": null },
"toString": "test@astaspot.xyz",
"cc": [],
"bcc": [],
"replyTo": { "johndoe@domain.com": "John Doe" },
"messageId": "",
"tmail_attachments": [],
"tmail_delete_url": "https://api.astaspot.xyz/api/message/27/yourapikey",
"tmail_download_url": "https://api.astaspot.xyz/api/message/27/yourapikey"
}
]
Response (Empty Inbox)
[]
Fetch Single Message
GET
/api/message/{id}/{apikey}
Fetch a specific message by ID.
Example Request
GET https://api.astaspot.xyz/api/message/27/yourapikey
Response
{
"textPlain": "Hello World",
"textHtml": "<div dir=\"ltr\">Hello World</div>",
"id": 27,
"date": "2025-08-07 02:04:20",
"headers": {
"date": "2025-08-07 02:04:20",
"subject": "API Test Subject",
"toaddress": "test@astaspot.xyz",
"to": [{ "mailbox": "test", "host": "astaspot.xyz" }],
"fromaddress": "John Doe <johndoe@domain.com>",
"from": [{ "personal": "John Doe", "mailbox": "johndoe", "host": "domain.com" }]
},
"subject": "API Test Subject",
"fromName": "John Doe",
"fromAddress": "johndoe@domain.com",
"to": { "test@astaspot.xyz": null },
"toString": "test@astaspot.xyz",
"cc": [],
"bcc": [],
"replyTo": { "johndoe@domain.com": "John Doe" },
"messageId": "",
"tmail_attachments": [],
"tmail_delete_url": "https://api.astaspot.xyz/api/message/27/yourapikey",
"tmail_download_url": "https://api.astaspot.xyz/api/message/27/yourapikey"
}
Delete Message
DELETE
/api/message/{id}/{apikey}
Delete a message by ID.
Example Request
DELETE https://api.astaspot.xyz/api/message/27/yourapikey
Response
[]
Example JavaScript Client
Basic JavaScript wrapper for interacting with the API.
Example Code
const API_KEY = 'buyapikey000000000000000';
const DOMAIN = 'astaspot.xyz';
class rxMailApi {
constructor(apiKey) {
this.apiKey = apiKey;
this.baseUrl = `https://api.${DOMAIN}/api/`;
}
async createEmail(email) {
const response = await fetch(
`${this.baseUrl}email/${email}/${this.apiKey}`
);
return await response.json();
}
async fetchMessages(email) {
const response = await fetch(
`${this.baseUrl}messages/${email}/${this.apiKey}`
);
return await response.json();
}
async fetchSingleMessage(messageId) {
const response = await fetch(
`${this.baseUrl}message/${messageId}/${this.apiKey}`
);
return await response.json();
}
async deleteMessage(messageId) {
const response = await fetch(
`${this.baseUrl}message/${messageId}/${this.apiKey}`,
{
method: 'DELETE'
}
);
return await response.json();
}
}
// Usage
const api = new rxMailApi(API_KEY);
// Example usage
async function example() {
try {
// Create email
const email = await api.createEmail('test@astaspot.xyz');
console.log('Created Email:', email);
// Fetch inbox messages
const messages = await api.fetchMessages(email);
console.log('Messages:', messages);
// Fetch single message
if (messages.length > 0) {
const message = await api.fetchSingleMessage(messages[0].id);
console.log('Single Message:', message);
// Delete message
await api.deleteMessage(messages[0].id);
console.log('Message deleted');
}
} catch (error) {
console.error('API Error:', error);
}
}
example();