API reference

อีเมลขาเข้า

สร้างที่อยู่และทำงานกับบทสนทนาที่ได้รับ

POST/domains/:id/inbound/setup
API key

จัดเตรียมการรับอีเมลขาเข้าของ SES

จัดเตรียมการรับอีเมลขาเข้าของ SES

คำขอ
curl https://sendhq.cc/api/v1/domains/id_value/inbound/setup \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
การตอบกลับ 200
{
  "domain": "inbound.example.com",
  "status": "dns_pending",
  "record": {
    "type": "MX",
    "name": "inbound.example.com",
    "value": "10 inbound-smtp.us-east-1.amazonaws.com"
  }
}
POST/domains/:id/inbound/verify
API key

ยืนยันการกำหนดเส้นทาง MX ขาเข้า

ยืนยันการกำหนดเส้นทาง MX ขาเข้า

คำขอ
curl https://sendhq.cc/api/v1/domains/id_value/inbound/verify \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
การตอบกลับ 200
{
  "domain": "inbound.example.com",
  "status": "ready",
  "record": {
    "type": "MX"
  }
}
POST/inboxes
API key

สร้างที่อยู่ขาเข้า

สร้างที่อยู่ขาเข้า

คำขอ
curl https://sendhq.cc/api/v1/inboxes \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain_id":"dom_…","local_part":"support","name":"Support"}'
การตอบกลับ 201
{
  "id": "inb_…",
  "address": "support@inbound.example.com",
  "status": "active"
}
GET/inboxes
API key

แสดงรายการที่อยู่ขาเข้า

แสดงรายการที่อยู่ขาเข้า

พารามิเตอร์คิวรีdomain_id
คำขอ
curl https://sendhq.cc/api/v1/inboxes \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
การตอบกลับ 200
{
  "data": [],
  "count": 0
}
GET/inboxes/:id
API key

ดึงข้อมูลที่อยู่ขาเข้า

ดึงข้อมูลที่อยู่ขาเข้า

คำขอ
curl https://sendhq.cc/api/v1/inboxes/id_value \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
การตอบกลับ 200
{
  "id": "inb_…",
  "address": "support@example.com",
  "status": "active"
}
PATCH/inboxes/:id
API key

เปลี่ยนชื่อ เปิด หรือปิดกล่องจดหมาย

เปลี่ยนชื่อ เปิด หรือปิดกล่องจดหมาย

คำขอ
curl https://sendhq.cc/api/v1/inboxes/id_value \
  -X PATCH \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Customer support","status":"active"}'
การตอบกลับ 200
{
  "id": "inb_…",
  "status": "active"
}
PUT/inboxes/:id/forwarding
API key

ส่งต่ออีเมลที่กล่องจดหมายได้รับไปยังที่อยู่อื่น

ตั้งค่า `forward_to` เป็นที่อยู่อีเมล หรือ null เพื่อปิดการส่งต่อ ที่อยู่ของเจ้าของบัญชีเองจะเปิดใช้ทันที ที่อยู่อื่นจะได้รับอีเมลยืนยัน (ส่งจากโดเมนที่ยืนยันแล้วของกล่องจดหมายและนับเป็นผู้รับหนึ่งราย) และการส่งต่อจะรอดำเนินการจนกว่าจะยืนยันลิงก์ สำเนาที่ส่งต่อจะส่งจากที่อยู่ของกล่องจดหมายโดยมีผู้ส่งเดิมเป็น Reply-To เคารพการระงับการส่งและขีดจำกัดของแพ็กเกจ และจะไม่ถูกส่งต่อซ้ำ

คำขอ
curl https://sendhq.cc/api/v1/inboxes/id_value/forwarding \
  -X PUT \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"forward_to":"team@example.net"}'
การตอบกลับ 200
{
  "id": "inb_…",
  "address": "support@example.com",
  "forwardTo": "team@example.net",
  "forwardStatus": "pending"
}
DELETE/inboxes/:id
API key

ลบกล่องจดหมายโดยเก็บข้อความไว้

ลบกล่องจดหมายโดยเก็บข้อความไว้

คำขอ
curl https://sendhq.cc/api/v1/inboxes/id_value \
  -X DELETE \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
การตอบกลับ 200
{
  "ok": true
}