API Documentation
Full programmatic control over your email infrastructure.
Overview
Base URL
https://api.pv81.vip/v1
Authentication
Bearer token (provided after purchase)
Response Format
JSON
Rate Limit
1,000 requests/minute
Quick Start
bash
# Create an email account
curl -X POST https://api.pv81.vip/v1/accounts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domain": "yourdomain.com", "username": "info", "password": "securePass123"}'javascript
// Send an email
const response = await fetch('https://api.pv81.vip/v1/send', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
from: 'info@yourdomain.com',
to: 'customer@example.com',
subject: 'Order Confirmation',
html: '<h1>Thank you for your order!</h1>'
})
});
const data = await response.json();
console.log(data.message_id);Endpoints
POST
/api/v1/accountsCreate a new email account
Request Body
json
{
"domain": "yourdomain.com",
"username": "info",
"password": "securePass123"
}Response
json
{
"id": "acc_123",
"email": "info@yourdomain.com",
"status": "active",
"created_at": "2025-01-15T10:30:00Z"
}GET
/api/v1/accountsList all email accounts
Response
json
{
"accounts": [
{
"id": "acc_123",
"email": "info@yourdomain.com",
"status": "active"
}
],
"total": 1
}POST
/api/v1/sendSend an email
Request Body
json
{
"from": "info@yourdomain.com",
"to": "customer@example.com",
"subject": "Order Confirmation",
"html": "<h1>Thank you for your order!</h1>"
}Response
json
{
"message_id": "msg_456",
"status": "sent"
}GET
/api/v1/inbox/:account_idRetrieve inbox messages
Response
json
{
"messages": [
{
"id": "msg_789",
"from": "customer@example.com",
"subject": "Re: Order Confirmation",
"date": "2025-01-15T11:00:00Z"
}
]
}DELETE
/api/v1/accounts/:idDelete an email account
Response
json
{
"deleted": true
}POST
/api/v1/domainsAdd a custom domain
Request Body
json
{
"domain": "yourdomain.com"
}Response
json
{
"id": "dom_001",
"domain": "yourdomain.com",
"status": "pending_verification",
"dns_records": [
{
"type": "MX",
"host": "@",
"value": "mx.pv81.vip",
"priority": 10
},
{
"type": "TXT",
"host": "@",
"value": "v=spf1 include:pv81.vip ~all"
}
]
}GET
/api/v1/domains/:id/dnsGet DNS configuration records
Response
json
{
"domain": "yourdomain.com",
"records": [
{ "type": "MX", "host": "@", "value": "mx.pv81.vip", "priority": 10 },
{ "type": "TXT", "host": "@", "value": "v=spf1 include:pv81.vip ~all" },
{ "type": "CNAME", "host": "mail", "value": "mail.pv81.vip" }
]
}Authentication
All API requests require a Bearer token in the Authorization header. Your API key will be provided after purchase.
bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.pv81.vip/v1/accountsError Codes
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request successful |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Invalid or missing API key |
| 429 | Rate Limited | Too many requests |
| 500 | Server Error | Internal server error |