ส่ง URL พร้อมชื่อและเวลาหมดอายุถ้าต้องการ API จะคืน shortcode กับเวลาหมดอายุ ส่วน endpoint อื่นใช้สำหรับอ่านข้อมูลหรือลบลิงก์ที่สร้างไว้
curl -X POST https://shor10.co/api/links \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"originalUrl":"https://example.com/very/long/path","alias":"spring-sale","ttl":"7d"}'{
"shortcode": "spring-sale",
"url": "https://shor10.co/spring-sale",
"expiresAt": "2026-08-03T09:00:00Z",
"state": "live"
}การลบผ่าน API ให้ผลเหมือนลบจาก Dashboard โดย shortcode จะหยุดทำงานทันที ประวัติจะถูกเก็บใน Archive และมีเพียงเจ้าของบัญชีเท่านั้นที่ลบได้ผ่าน session หรือ Bearer key
curl -X DELETE https://shor10.co/api/links/<id> \ -H "Authorization: Bearer sk_live_xxxxxxxxxxxx"
สร้าง key ใน Settings > API keys จากนั้นส่ง Authorization: Bearer sk_live_… ไปกับ GET/POST /api/links และ DELETE /api/links/:id