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/accounts

Create 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/accounts

List all email accounts

Response

json
{
  "accounts": [
    {
      "id": "acc_123",
      "email": "info@yourdomain.com",
      "status": "active"
    }
  ],
  "total": 1
}
POST/api/v1/send

Send 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_id

Retrieve 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/:id

Delete an email account

Response

json
{
  "deleted": true
}
POST/api/v1/domains

Add 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/dns

Get 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/accounts

Error Codes

CodeStatusDescription
200OKRequest successful
201CreatedResource created successfully
400Bad RequestInvalid request parameters
401UnauthorizedInvalid or missing API key
429Rate LimitedToo many requests
500Server ErrorInternal server error