VPS.org API

Tài liệu API REST

API miền

Quản lý việc đăng ký, gia hạn và cấu hình tên miền một cách tự động.

Điểm cuối 6 endpoints
Đường cơ sở /api/v1/domains
LẤY /api/v1/domains/

Liệt kê tất cả các tên miền

Lấy danh sách tất cả các miền đăng ký dưới tài khoản của bạn.

Tham số truy vấn

Tham số Kiểu Yêu cầu Mô tả
status string Không Filter by status: active, pending, expired, locked
search string Không Tìm kiếm tên miền theo tên

Ví dụ về yêu cầu

cURL
Python
JavaScript
curl -X GET "https://admin.vps.org/api/v1/domains/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
import requests

url = "https://admin.vps.org/api/v1/domains/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/domains/', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  }
});

const domains = await response.json();
console.log(domains);

Ví dụ về câu trả lời

{
  "count": 3,
  "results": [
    {
      "id": 101,
      "domain_name": "example.com",
      "status": "active",
      "registration_date": "2023-01-15T10:30:00Z",
      "expiration_date": "2026-01-15T10:30:00Z",
      "auto_renew": true,
      "locked": true,
      "nameservers": [
        "ns1.vps.org",
        "ns2.vps.org"
      ],
      "privacy_protection": true,
      "dns_managed_by": "vps.org"
    },
    {
      "id": 102,
      "domain_name": "myapp.io",
      "status": "active",
      "registration_date": "2024-06-20T14:15:00Z",
      "expiration_date": "2025-06-20T14:15:00Z",
      "auto_renew": false,
      "locked": false,
      "nameservers": [
        "ns1.cloudflare.com",
        "ns2.cloudflare.com"
      ],
      "privacy_protection": false,
      "dns_managed_by": "external"
    }
  ]
}

Mã trạng thái phản hồi

200 Đã truy xuất thành công danh sách tên miền
401 Không được phép - Mã xác thực không hợp lệ hoặc bị thiếu.
POST /api/v1/domains/

Đăng ký tên miền mới

Đăng ký một tên miền mới. Cần kiểm tra sẵn sàng miền trước khi đăng ký.

Các tham số thân yêu cầu

Tham số Kiểu Yêu cầu Mô tả
domain_name string Đúng Domain name to register (e.g., "example.com")
years integer Không Registration period in years (1-10, default: 1)
auto_renew boolean Không Enable automatic renewal (default: true)
privacy_protection boolean Không Enable WHOIS privacy protection (default: true)
nameservers array Không Custom nameservers (default: VPS.org nameservers)

Ví dụ về yêu cầu

cURL
Python
JavaScript
PHP
curl -X POST "https://admin.vps.org/api/v1/domains/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domain_name": "mynewdomain.com",
    "years": 2,
    "auto_renew": true,
    "privacy_protection": true
  }'
import requests

url = "https://admin.vps.org/api/v1/domains/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}
data = {
    "domain_name": "mynewdomain.com",
    "years": 2,
    "auto_renew": True,
    "privacy_protection": True
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/domains/', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    domain_name: 'mynewdomain.com',
    years: 2,
    auto_renew: true,
    privacy_protection: true
  })
});

const domain = await response.json();
console.log(domain);
$data = [
    'domain_name' => 'mynewdomain.com',
    'years' => 2,
    'auto_renew' => true,
    'privacy_protection' => true
];

$ch = curl_init('https://admin.vps.org/api/v1/domains/');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_API_TOKEN',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$domain = json_decode($response, true);
curl_close($ch);

Ví dụ về câu trả lời

{
  "id": 103,
  "domain_name": "mynewdomain.com",
  "status": "pending",
  "registration_date": "2026-01-16T16:00:00Z",
  "expiration_date": "2028-01-16T16:00:00Z",
  "auto_renew": true,
  "locked": true,
  "nameservers": [
    "ns1.vps.org",
    "ns2.vps.org"
  ],
  "privacy_protection": true,
  "dns_managed_by": "vps.org",
  "total_cost": 24.98,
  "message": "Domain registration initiated. Processing may take 5-10 minutes."
}

Mã trạng thái phản hồi

201 Domain registration initiated successfully
400 Bad Request - Invalid domain name or domain already registered
401 Không được phép - Mã xác thực không hợp lệ hoặc bị thiếu.
402 Payment Required - Insufficient account balance
Ghi chú: Domain registration is not instant. Status will change from pending to active within 5-10 minutes. You'll receive an email confirmation when registration completes.
LẤY /api/v1/domains/{domain_id}/

Nhập chi tiết miền

Lấy thông tin chi tiết về một miền cụ thể.

Tham số đường dẫn

Tham số Kiểu Yêu cầu Mô tả
domain_id integer Đúng Unique domain ID

Ví dụ về yêu cầu

cURL
Python
JavaScript
curl -X GET "https://admin.vps.org/api/v1/domains/101/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
import requests

domain_id = 101
url = f"https://admin.vps.org/api/v1/domains/{domain_id}/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
print(response.json())
const domainId = 101;
const response = await fetch(`https://admin.vps.org/api/v1/domains/${domainId}/`, {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  }
});

const domain = await response.json();
console.log(domain);

Ví dụ về câu trả lời

{
  "id": 101,
  "domain_name": "example.com",
  "status": "active",
  "registration_date": "2023-01-15T10:30:00Z",
  "expiration_date": "2026-01-15T10:30:00Z",
  "auto_renew": true,
  "locked": true,
  "nameservers": [
    "ns1.vps.org",
    "ns2.vps.org"
  ],
  "privacy_protection": true,
  "dns_managed_by": "vps.org",
  "registrar": "VPS.org",
  "days_until_expiration": 730,
  "whois_info": {
    "registrant": "Privacy Protected",
    "admin_contact": "Privacy Protected",
    "tech_contact": "Privacy Protected",
    "created_date": "2023-01-15",
    "updated_date": "2025-12-20"
  },
  "dns_records_count": 12
}

Mã trạng thái phản hồi

200 Successfully retrieved domain details
401 Không được phép - Mã xác thực không hợp lệ hoặc bị thiếu.
404 Không tìm thấy - Tên miền không tồn tại
ĐẶT /api/v1/domains/{domain_id}/

Cập nhật thiết lập miền

Cập nhật cấu hình miền như tự động gia hạn, máy chủ tên, và cài đặt riêng tư.

Tham số đường dẫn

Tham số Kiểu Yêu cầu Mô tả
domain_id integer Đúng Unique domain ID

Các tham số thân yêu cầu

Tham số Kiểu Yêu cầu Mô tả
auto_renew boolean Không Enable or disable automatic renewal
privacy_protection boolean Không Enable or disable WHOIS privacy
nameservers array Không Update nameservers (2-4 nameservers required)
locked boolean Không Lock or unlock domain to prevent transfers

Ví dụ về yêu cầu

cURL
Python
JavaScript
curl -X PUT "https://admin.vps.org/api/v1/domains/101/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "auto_renew": false,
    "nameservers": [
      "ns1.cloudflare.com",
      "ns2.cloudflare.com"
    ]
  }'
import requests

domain_id = 101
url = f"https://admin.vps.org/api/v1/domains/{domain_id}/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}
data = {
    "auto_renew": False,
    "nameservers": [
        "ns1.cloudflare.com",
        "ns2.cloudflare.com"
    ]
}

response = requests.put(url, headers=headers, json=data)
print(response.json())
const domainId = 101;
const response = await fetch(`https://admin.vps.org/api/v1/domains/${domainId}/`, {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    auto_renew: false,
    nameservers: [
      'ns1.cloudflare.com',
      'ns2.cloudflare.com'
    ]
  })
});

const domain = await response.json();
console.log(domain);

Ví dụ về câu trả lời

{
  "id": 101,
  "domain_name": "example.com",
  "status": "active",
  "auto_renew": false,
  "nameservers": [
    "ns1.cloudflare.com",
    "ns2.cloudflare.com"
  ],
  "privacy_protection": true,
  "locked": true,
  "message": "Domain settings updated successfully. Nameserver changes may take up to 24 hours to propagate."
}

Mã trạng thái phản hồi

200 Domain updated successfully
400 Bad Request - Invalid parameters
401 Không được phép - Mã xác thực không hợp lệ hoặc bị thiếu.
404 Không tìm thấy - Tên miền không tồn tại
XÓA BỎ /api/v1/domains/{domain_id}/

Xoá miền

Xoá một miền khỏi tài khoản của bạn. Việc này không hủy đăng ký miền - nó chỉ gỡ nó khỏi quản lý tài khoản VPS.org của bạn.

Tham số đường dẫn

Tham số Kiểu Yêu cầu Mô tả
domain_id integer Đúng Unique domain ID

Ví dụ về yêu cầu

cURL
Python
JavaScript
curl -X DELETE "https://admin.vps.org/api/v1/domains/101/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
import requests

domain_id = 101
url = f"https://admin.vps.org/api/v1/domains/{domain_id}/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}

response = requests.delete(url, headers=headers)
print(response.status_code)
const domainId = 101;
const response = await fetch(`https://admin.vps.org/api/v1/domains/${domainId}/`, {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  }
});

console.log(response.status);

Mã trạng thái phản hồi

204 Domain removed from account successfully
401 Không được phép - Mã xác thực không hợp lệ hoặc bị thiếu.
404 Không tìm thấy - Tên miền không tồn tại
Important: Deleting a domain from your VPS.org account does NOT cancel the registration. The domain will continue to be registered and will auto-renew if enabled. To cancel a domain registration, disable auto-renewal and let it expire.
POST /api/v1/domains/{domain_id}/transfer/

Chuyển miền

Bắt đầu chuyển tên miền sang VPS.org từ một nhà đăng ký khác.

Tham số đường dẫn

Tham số Kiểu Yêu cầu Mô tả
domain_id integer Đúng Unique domain ID

Các tham số thân yêu cầu

Tham số Kiểu Yêu cầu Mô tả
auth_code string Đúng EPP/Authorization code from current registrar
auto_renew boolean Không Enable auto-renewal after transfer (default: true)

Ví dụ về yêu cầu

cURL
Python
JavaScript
curl -X POST "https://admin.vps.org/api/v1/domains/101/transfer/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "auth_code": "Xy9Kl2Mn#4pQ",
    "auto_renew": true
  }'
import requests

domain_id = 101
url = f"https://admin.vps.org/api/v1/domains/{domain_id}/transfer/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}
data = {
    "auth_code": "Xy9Kl2Mn#4pQ",
    "auto_renew": True
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
const domainId = 101;
const response = await fetch(`https://admin.vps.org/api/v1/domains/${domainId}/transfer/`, {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    auth_code: 'Xy9Kl2Mn#4pQ',
    auto_renew: true
  })
});

const transfer = await response.json();
console.log(transfer);

Ví dụ về câu trả lời

{
  "id": 101,
  "domain_name": "example.com",
  "transfer_status": "pending",
  "transfer_initiated_at": "2026-01-16T16:30:00Z",
  "estimated_completion": "2026-01-23T16:30:00Z",
  "message": "Domain transfer initiated. You should receive a confirmation email from your current registrar. Transfer typically completes within 5-7 days.",
  "next_steps": [
    "Check email for transfer authorization request",
    "Approve transfer with current registrar",
    "Wait for transfer to complete (5-7 days)",
    "Domain will be automatically renewed for 1 year upon completion"
  ]
}

Mã trạng thái phản hồi

200 Transfer initiated successfully
400 Bad Request - Invalid auth code or domain not eligible for transfer
401 Không được phép - Mã xác thực không hợp lệ hoặc bị thiếu.
404 Không tìm thấy - Tên miền không tồn tại
402 Payment Required - Insufficient account balance for transfer fee
Điều kiện chuyển:
  • Mặc định, tên miền phải được mở khóa tại cơ quan đăng ký hiện tại
  • Miền phải ít nhất 60 ngày tuổi
  • Cần mã EPP/Auth hợp lệ
  • Thư điện tử WHOIS phải có thể truy cập để được chấp thuận
  • Di chuyển bao gồm 1 năm gia hạn (tương ứng với phí)

Giá trị miền

TLD phổ biến

TLD Đăng ký (1 năm) Cập nhật Chuyển
.com $12.99 $12.99 $12.99
.net $14.99 $14.99 $14.99
.org $13.99 $13.99 $13.99
.io $39.99 $39.99 $39.99
.dev $14.99 $14.99 $14.99
.app $14.99 $14.99 $14.99
.co $24.99 $24.99 $24.99

Các tính năng bao gồm

  • ✓ Bảo vệ Trí tuệ Tự do WHOIS
  • ✓ Quản lý DNS miễn phí
  • ✓ Thông tin về thư
  • ✓ Chuyển tiếp miền miễn phí
  • ✓ Chốt miền miễn phí
  • ✓ Hỗ trợ 24/7
  • ✓ Quản lý miền dễ dàng
  • ✓ Tùy chọn tự động cập nhật

Quản lý miền

An ninh

Cấu hình

Chuyển