API reference

บัญชีและการเรียกเก็บเงิน

อ่านข้อมูลการใช้งานบัญชี analytics และเมทาดาทาของคีย์ด้วย API key การเปลี่ยนแปลงการเรียกเก็บเงินและการสร้างหรือเพิกถอนคีย์ต้องใช้เซสชันแดชบอร์ด

GET/account
API key

ดึงข้อมูลบัญชี การใช้งาน สถานะการเรียกเก็บเงิน และจำนวนเวิร์กสเปซด้วย API key

เทียบเท่าโปรไฟล์ในแดชบอร์ดสำหรับ API key ได้แก่ เจ้าของบัญชี การใช้งานผู้รับและไฟล์แนบในรอบปัจจุบันเทียบกับขีดจำกัดของแพ็กเกจ ระดับการเข้าถึง สรุปชื่อเสียงผู้ส่ง สถานะการสมัครใช้ แพ็กเกจที่เผยแพร่ และจำนวนเวิร์กสเปซ อ่านอย่างเดียว การเปลี่ยนแปลงการเรียกเก็บเงินยังทำได้เฉพาะผ่านเซสชัน

คำขอ
curl https://sendhq.cc/api/v1/account \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
การตอบกลับ 200
{
  "user": {},
  "usage": {},
  "access": {},
  "reputation": {},
  "infrastructure": {},
  "billing": {},
  "plans": [],
  "workspace": {
    "mailer": "ses",
    "stats": {}
  }
}
GET/account/diagnostics
API key

Diagnose sending and receiving problems in the workspace

Read-only troubleshooting snapshot from stored state: an `issues` list in plain language, plan and usage against limits, each domain's DKIM and inbound state, sending identities, 30-day deliverability and sender reputation, suppressions and unsubscribes, the last 30 days of messages that were not sent with their reasons, bounce, complaint and reject events, and webhook delivery health. Never returns message bodies, API keys or webhook secrets.

คำขอ
curl https://sendhq.cc/api/v1/account/diagnostics \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
การตอบกลับ 200
{
  "generatedAt": "2026-10-30T12:00:00.000Z",
  "windowDays": 30,
  "issues": [
    {
      "severity": "action",
      "code": "domain_unverified",
      "message": "example.com is not verified (pending); 2 of 3 DKIM records are not visible in DNS yet."
    }
  ],
  "plan": {},
  "domains": [],
  "sendingIdentities": {
    "domains": [],
    "addresses": []
  },
  "inbound": {},
  "deliverability": {},
  "suppressions": {},
  "failures": {
    "notSent": [],
    "recentNotSent": [],
    "recentProviderEvents": []
  },
  "webhooks": []
}
GET/analytics
API key

ดึง analytics การส่งของแดชบอร์ดสำหรับ 7, 30 หรือ 90 วัน

ยอดรวมของอีเมลที่ส่ง รับ ส่งถึง ตีกลับ บล็อก เปิด คลิก และการร้องเรียนในช่วงเวลานั้น ไทม์ไลน์ส่ง/รับรายวัน โดเมนผู้ส่งอันดับต้น ๆ และหัวเรื่องที่ทำผลงานดีที่สุด

พารามิเตอร์คิวรีdays
คำขอ
curl https://sendhq.cc/api/v1/analytics \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
การตอบกลับ 200
{
  "window": "30d",
  "days": 30,
  "metrics": {
    "sent": 0,
    "received": 0,
    "bounced": 0,
    "blocked": 0,
    "delivered": 0,
    "opened": 0,
    "clicks": 0,
    "complaints": 0
  },
  "timeline": [],
  "domains": [],
  "topContent": []
}
GET/profile
เซสชันเบราว์เซอร์

ดึงข้อมูลบัญชี การใช้งาน และสถานะการสมัครใช้แบบซ้อนกัน

ดึงข้อมูลบัญชี การใช้งาน และสถานะการสมัครใช้แบบซ้อนกัน

คำขอ
curl https://sendhq.cc/api/v1/profile \
  -X GET \
  -H "Cookie: sendhq_session_v2=…"
การตอบกลับ 200
{
  "user": {},
  "usage": {},
  "access": {},
  "reputation": {},
  "billing": {},
  "plans": []
}
POST/billing/checkout
เซสชันเบราว์เซอร์

เริ่มการชำระเงินแบบโฮสต์สำหรับแพ็กเกจที่ยังไม่มี (ระดับ คลาสข้อความ และรอบการเรียกเก็บเงิน)

เริ่มการชำระเงินแบบโฮสต์สำหรับแพ็กเกจที่ยังไม่มี (ระดับ คลาสข้อความ และรอบการเรียกเก็บเงิน)

คำขอ
curl https://sendhq.cc/api/v1/billing/checkout \
  -X POST \
  -H "Cookie: sendhq_session_v2=…" \
  -H "Content-Type: application/json" \
  -d '{"plan_key":"scaleup_marketing_annual"}'
การตอบกลับ 200
{
  "url": "https://checkout.example/…",
  "session_id": "…"
}
POST/billing/cancel
เซสชันเบราว์เซอร์

ยกเลิกการสมัครใช้ปัจจุบันภายในแอปโดยไม่แตะต้องผู้ให้บริการ

ยกเลิกการสมัครใช้ปัจจุบันภายในแอปโดยไม่แตะต้องผู้ให้บริการ

คำขอ
curl https://sendhq.cc/api/v1/billing/cancel \
  -X POST \
  -H "Cookie: sendhq_session_v2=…"
การตอบกลับ 200
{
  "ok": true
}
POST/keys
เซสชันเบราว์เซอร์

สร้าง API key

สร้าง API key

คำขอ
curl https://sendhq.cc/api/v1/keys \
  -X POST \
  -H "Cookie: sendhq_session_v2=…" \
  -H "Content-Type: application/json" \
  -d '{"name":"Production"}'
การตอบกลับ 201
{
  "id": "key_…",
  "name": "Production",
  "key": "re_…",
  "prefix": "re_…"
}
GET/keys
API key

แสดงรายการเมทาดาทาของ API key

แสดงชื่อคีย์ พรีฟิกซ์ที่ไม่เป็นความลับ และเวลาที่ใช้ล่าสุด ค่าคีย์เต็มจะไม่ถูกส่งกลับ การสร้างและเพิกถอนคีย์ต้องใช้เซสชันแดชบอร์ด

คำขอ
curl https://sendhq.cc/api/v1/keys \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
การตอบกลับ 200
{
  "data": [],
  "count": 0
}
DELETE/keys/:id
เซสชันเบราว์เซอร์

เพิกถอน API key

เพิกถอน API key

คำขอ
curl https://sendhq.cc/api/v1/keys/id_value \
  -X DELETE \
  -H "Cookie: sendhq_session_v2=…"
การตอบกลับ 200
{
  "ok": true
}