API Reference
ดูทุกการดำเนินการ REST และ OAuth พร้อมโฮสต์ วิธีการยืนยันตัวตน สโคป พารามิเตอร์ ฟิลด์คำขอ และรหัสตอบกลับที่ถูกต้อง
OpenAPI v2.1.0
ภาพรวม API
การดำเนินการสาธารณะของ /v2 รองรับคีย์ API ที่กำหนดสโคปหรือโทเค็นการเข้าถึง OAuth 2.0 ส่วนการจัดการ OAuth มีข้อกำหนดด้านเบราว์เซอร์ เซสชัน หรือข้อมูลรับรองไคลเอนต์ของตนเอง
- URL พื้นฐาน:
- https://api.s.id/v2
- การดำเนินการ
- 38
- สโคป
- 10
การรับรองความถูกต้อง
ข้อมูลรับรองมีการกำหนดสโคป หากขาดสโคปที่จำเป็น ระบบจะส่งคืน 403 insufficient_scope ขอเฉพาะสิทธิ์ที่การเชื่อมต่อของคุณต้องใช้
Authorization: Bearer sk_live_...Endpoints
แค็ตตาล็อก endpoint
ขยายการดำเนินการเพื่อดู URL ฐาน การยืนยันตัวตน อินพุต และรหัสตอบกลับที่เป็นไปได้อย่างถูกต้อง
Links
GET/linksแสดงรายการลิงก์
Returns a paginated list of the authenticated user's links.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
links:readพารามิเตอร์
pagequery · integerlimitquery · integersearchquery · stringFilter by short code or URL
การตอบกลับ
200List of links401403429POST/linksสร้างลิงก์
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
links:writeเนื้อหาคำขอ
long_urlstringจำเป็นThe destination (long) URL
titlestringcustom_slugstringCustom short code; auto-generated when omitted
passwordstringOptional password to protect the link
expired_atintegerOptional expiry as a Unix timestamp (seconds)
domain_aliasstringCustom domain to use instead of s.id
การตอบกลับ
200401403422429POST/links/availableตรวจสอบว่า slug ใช้งานได้หรือไม่
Checks whether a custom slug is available before creating a link.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
links:readเนื้อหาคำขอ
shortstringจำเป็นdomain_aliasstringCustom domain, if any
การตอบกลับ
200Slug is available401422Slug is taken or invalidGET/links/{short}รับลิงก์
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
links:readพารามิเตอร์
shortpath · stringจำเป็นThe short code of the link
การตอบกลับ
200401404PUT/links/{short}อัปเดตลิงก์
Updates a link. All fields are optional; omitted fields are left unchanged. - `password`: set a non-empty string to protect, empty string `""` to remove protection. - `custom_slug`: rename the short code (subject to quota). - `archive_at`: schedule auto-archive on a date (`YYYY-MM-DD`). - `domain_alias`: change the custom domain (must be owned by the user).
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
links:writeพารามิเตอร์
shortpath · stringจำเป็นThe short code of the link
เนื้อหาคำขอ
long_urlstringNew destination URL
titlestringcustom_slugstringRename the short code (subject to plan quota)
passwordstringSet a password (`""` removes existing protection)
disposablebooleanMark link as disposable (expires after first click)
adultbooleanFlag link as adult content
archive_atstringSchedule auto-archive on this date (YYYY-MM-DD)
domain_aliasstringChange the custom domain (must be owned by the user)
การตอบกลับ
200401403404422429DELETE/links/{short}เก็บลิงก์เข้าคลัง
Archives (soft-deletes) a link. The short code stops resolving. Use `POST /links/{short}/unarchive` to restore.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
links:archiveพารามิเตอร์
shortpath · stringจำเป็นThe short code of the link
การตอบกลับ
200Link archived401404429POST/links/{short}/unarchiveกู้คืนลิงก์จากคลัง
Restores a previously archived link, making its short code resolve again.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
links:writeพารามิเตอร์
shortpath · stringจำเป็นThe short code of the archived link
การตอบกลับ
200Link restored401403404429GET/links/{short}/statsไทม์ไลน์การคลิกลิงก์
Returns a date-bucketed click-count timeline for the link.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
links:analyticsพารามิเตอร์
shortpath · stringจำเป็นstartquery · stringendquery · string
การตอบกลับ
200Click timeline401403404429GET/links/{short}/stats/lifetimeจำนวนคลิกตลอดอายุการใช้งาน
Returns the all-time total click count for a single link.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
links:analyticsพารามิเตอร์
shortpath · stringจำเป็น
การตอบกลับ
200Lifetime click count401403404429POST/links/bulkสร้างลิงก์หลายรายการ
Create up to 100 short links in a single request. Requires a subscription plan with bulk shortening enabled. Each item reports individual success/failure — the overall request always returns 200 even if some items fail.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
links:writeเนื้อหาคำขอ
linksarray<object>จำเป็น
การตอบกลับ
200Bulk result — individual items may have success=false401402Plan upgrade required (bulk shortening not in plan)403User
GET/userรับผู้ใช้ที่ยืนยันตัวตนแล้ว
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
user:readการตอบกลับ
200User profile401429GET/quotaรับโควตาบัญชี
Returns the authenticated user's current plan limits and usage counters.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
user:readการตอบกลับ
200Account quota401429Microsites
GET/micrositesแสดงรายการ microsite
Returns a paginated list of microsites owned by the authenticated user.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
microsites:readพารามิเตอร์
limitquery · integerafterquery · stringCursor for the next page (opaque string from previous response)
การตอบกลับ
200List of microsites401403POST/micrositesสร้าง microsite
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
microsites:writeเนื้อหาคำขอ
slugstringจำเป็นURL-safe identifier (alphanumeric + hyphens/underscores)
titlestringจำเป็นkindstringจำเป็นMicrosite category (e.g. `personal_branding`, `brand`, `other`)
themestringTheme slug (optional, defaults to the platform default)
การตอบกลับ
200Microsite created400Validation error (slug already taken, quota exceeded, etc.)401403GET/microsites/{slug}รับ microsite
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
microsites:readพารามิเตอร์
slugpath · stringจำเป็น
การตอบกลับ
200Microsite detail401403404Microsite not foundPUT/microsites/{slug}อัปเดต microsite
Patches title, description, and/or visibility. All fields are optional.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
microsites:writeพารามิเตอร์
slugpath · stringจำเป็น
เนื้อหาคำขอ
titlestringdescriptionstringhidebooleanSet `true` to hide the microsite from public (requires plan that supports visibility toggle)
การตอบกลับ
200Updated microsite401403404Microsite not foundDELETE/microsites/{slug}ลบ microsite
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
microsites:deleteพารามิเตอร์
slugpath · stringจำเป็น
การตอบกลับ
200Microsite deleted401403404Microsite not foundPOST/microsites/availableตรวจสอบว่า slug ของ microsite ใช้งานได้หรือไม่
Checks whether a microsite slug is available before creating a microsite.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
microsites:readเนื้อหาคำขอ
slugstringจำเป็น
การตอบกลับ
200Slug availability result401403429GET/microsites/{slug}/componentsแสดงคอมโพเนนต์ microsite
Returns the components belonging to a microsite, in display order.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
microsites:readพารามิเตอร์
slugpath · stringจำเป็นThe slug of the microsite
การตอบกลับ
200List of microsite components401403404429POST/microsites/{slug}/componentsเพิ่มคอมโพเนนต์ microsite
Adds a new component to a microsite. The body is `{ kind, data, tag? }`. The shape of the `data` object depends on `kind`. Unknown fields are ignored, validation is per-kind, and invalid input returns `422`. All color fields are hex strings (e.g. `#1a56db`). **Kinds:** `PROFILE`, `LINK`, `HORIZONTAL_LINK`, `TEXT`, `IMAGE`, `MEDIA`, `DIVIDER`, `COUNTDOWN`, `MAPS`, `IMAGE_SLIDE`, `CV`, `AUTOPLAY_MUSIC`, `CONTACT`, `CALENDAR`, `SHOP_LISTING`, `SHOP_ITEM`, `SHOP_LEADERBOARD`. **Rules:** - `PROFILE`, `CV` and `AUTOPLAY_MUSIC` are unique — at most one per microsite. - `IMAGE_SLIDE` requires a plan with the Image Slide feature. - On create the password is always stored empty — set or change it via update (`PUT`). - Image fields (`image`, `imageBackground`, slide `image`) must be a local asset path, not a remote URL — they must match `[/.a-zA-Z0-9_-]+.(jpg|jpeg|png|svg|webp|gif|bmp)`; any value containing a scheme (`https://`), `//`, or `..` is rejected. **Shared field groups** (a kind that lists a group accepts all of its fields inside `data`): - **Button styling** (`LINK`, `CONTACT`, `CALENDAR`): `icon` (string, max 255), `textFont` (string, max 100), `textPosition` (string, max 100), `buttonEffect` (string, max 100), `buttonColor` (hex, max 20), `buttonBorderColor` (hex, max 20), `buttonIconBackground` (hex, max 20), `buttonShadowColor` (hex, max 20). - **Spoiler reveal** (`TEXT`, `IMAGE`, `MEDIA`, `MAPS`, `IMAGE_SLIDE`, `SHOP_LEADERBOARD`): `isSpoiler` (bool), `spoilerButtonText` (string, max 140), `spoilerButtonTextPosition` (string, max 100), `spoilerButtonIcon` (string), `spoilerButtonColor` (hex, max 20), `spoilerButtonFont` (string, max 100), `spoilerBackground` (string, max 100), `spoilerBackgroundOpacity` (string, max 100), `spoilerButtonBorderColor` (hex, max 20), `spoilerButtonIconBackground` (hex, max 20), `spoilerButtonShadowColor` (hex, max 20). - **Password protection** (`LINK`, `TEXT`, `IMAGE`, `MEDIA`, `MAPS`, `IMAGE_SLIDE`, `CONTACT`, `CV`, `SHOP_LEADERBOARD`): `passwordActive` (bool), `password` (string, max 255 — set via update only), `passwordMessage` (string, max 255).
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
microsites:writeพารามิเตอร์
slugpath · stringจำเป็นThe slug of the microsite
เนื้อหาคำขอ
kindstringจำเป็นComponent kind. The shape of `data` depends on this value.
dataobjectจำเป็นKind-specific component data. Its shape depends on `kind`. See the operation description and examples below.
tagstringOptional grouping tag
การตอบกลับ
200Component created401403404422429PUT/microsites/{slug}/components/{componentId}อัปเดตคอมโพเนนต์ microsite
Updates a single microsite component.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
microsites:writeพารามิเตอร์
slugpath · stringจำเป็นThe slug of the microsite
componentIdpath · stringจำเป็นThe component ID
เนื้อหาคำขอ
activebooleanจำเป็นWhether the component is shown
kindstringจำเป็นComponent kind (e.g. `LINK`, `PROFILE`, `TEXT`)
dataobjectจำเป็นKind-specific component data
การตอบกลับ
200Component updated401403404422429DELETE/microsites/{slug}/components/{componentId}ลบคอมโพเนนต์ microsite
Deletes a single microsite component.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
microsites:deleteพารามิเตอร์
slugpath · stringจำเป็นThe slug of the microsite
componentIdpath · stringจำเป็นThe component ID
การตอบกลับ
200Component deleted401403404429POST/microsites/{slug}/components/orderจัดลำดับคอมโพเนนต์ microsite ใหม่
Reorders a microsite's components according to the provided list of component IDs.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
microsites:writeพารามิเตอร์
slugpath · stringจำเป็นThe slug of the microsite
เนื้อหาคำขอ
ordersarray<string>จำเป็นComponent IDs in the desired display order
การตอบกลับ
200Components reordered401403404422429Analytics
GET/statsข้อมูลวิเคราะห์การคลิกระดับบัญชี
Returns a timeline of clicks plus breakdowns by top links, referers, locations, devices, and browsers for the authenticated account. Date range is gated by subscription plan.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
links:analyticsพารามิเตอร์
startquery · stringStart date (YYYY-MM-DD). Defaults to 30 days ago.
endquery · stringEnd date (YYYY-MM-DD). Defaults to today.
additionalquery · booleanInclude referer, location, device, browser breakdowns
การตอบกลับ
200Account analytics401403QR
GET/qrรับการตั้งค่า QR ส่วนกลาง
Returns the account-level (global) QR code settings applied to QR codes by default.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
qr:readการตอบกลับ
200Global QR settings401403429PUT/qrปรับแต่งการตั้งค่า QR ส่วนกลาง
Updates the account-level (global) QR code settings. All fields are optional; omitted fields are left unchanged.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
qr:writeเนื้อหาคำขอ
logostringURL of the logo image embedded in the QR code
colorstringForeground color as a hex value, e.g. #1a56db
การตอบกลับ
200Updated global QR settings401403422429GET/links/{short}/qrรับการตั้งค่า QR ของลิงก์
Returns the QR code settings for a single link.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
qr:readพารามิเตอร์
shortpath · stringจำเป็นThe short code of the link
การตอบกลับ
200Link QR settings401403404429PUT/links/{short}/qrปรับแต่งการตั้งค่า QR ของลิงก์
Updates the QR code settings for a single link. All fields are optional; omitted fields are left unchanged.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API หรือ OAuth 2.0
สิทธิ์
qr:writeพารามิเตอร์
shortpath · stringจำเป็นThe short code of the link
เนื้อหาคำขอ
logostringURL of the logo image embedded in the QR code
colorstringForeground color as a hex value, e.g. #1a56db
การตอบกลับ
200Updated link QR settings401403404422429OAuth 2.0
POST/oauth/tokenแลกรหัสหรือรีเฟรชโทเค็น
- URL พื้นฐาน
- https://api.s.id
- การรับรองความถูกต้อง
- คีย์ API
เนื้อหาคำขอ
grant_typestringcodestringredirect_uristringclient_idstringclient_secretstringrefresh_tokenstring
การตอบกลับ
200Token response400Invalid grant, unsupported_grant_type, or invalid_client401Invalid client credentialsPOST/oauth/revokeเพิกถอนโทเค็น
Revokes an access or refresh token. Always returns 200 OK regardless of whether the token was valid (RFC 7009).
- URL พื้นฐาน
- https://api.s.id
- การรับรองความถูกต้อง
- คีย์ API
เนื้อหาคำขอ
tokenstringจำเป็น
การตอบกลับ
200Token revokedPOST/oauth/introspectตรวจสอบโทเค็น
Reports whether a token is currently active and, if so, which scopes and client it belongs to (RFC 7662). Client-credential protected: `client_id`/`client_secret` identify the caller, not the token owner. Always returns `200` — including for an unknown, expired, or revoked token (`{"active": false}`) — to avoid leaking token validity to unauthenticated probing.
- URL พื้นฐาน
- https://api.s.id
- การรับรองความถูกต้อง
- คีย์ API
เนื้อหาคำขอ
tokenstringจำเป็นclient_idstringจำเป็นclient_secretstringจำเป็น
การตอบกลับ
200Introspection result400Missing token/client_id, or invalid client credentialsGET/oauth/userinfoรับโปรไฟล์ผู้ใช้ที่ได้รับอนุญาต
Returns the profile of the user who authorized the OAuth app. Requires `Authorization: Bearer <access_token>` (the OAuth access token, not an sk_live_ key).
- URL พื้นฐาน
- https://api.s.id
- การรับรองความถูกต้อง
- OAuth 2.0
สิทธิ์
user:readการตอบกลับ
200User profile401UnauthorizedGET/api/user/oauth/appsแสดงแอปที่ผู้ใช้ปัจจุบันอนุญาต
Returns all OAuth clients that have active tokens for the authenticated user. Auth: user session cookie (not API key).
- URL พื้นฐาน
- https://api.s.id
- การรับรองความถูกต้อง
- คีย์ API
การตอบกลับ
200List of connected apps401UnauthorizedDELETE/api/user/oauth/apps/{clientId}เพิกถอนโทเค็นทั้งหมดของแอป
Revokes all active tokens granted by the current user to the specified OAuth client.
- URL พื้นฐาน
- https://api.s.id
- การรับรองความถูกต้อง
- คีย์ API
พารามิเตอร์
clientIdpath · stringจำเป็น
การตอบกลับ
200App access revoked401Unauthorized404App not foundIntegrations
POST/integrations/make/webhook/subscribeสมัครรับ Make.com webhook
Registers a Make.com (Integromat) scenario webhook URL to receive s.id events. Authenticated via DeveloperAPIAuth (API key or OAuth Bearer) with no scope requirement — every authenticated developer credential can subscribe.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API
การตอบกลับ
200Subscribed401UnauthorizedPOST/integrations/make/webhook/unsubscribeยกเลิกการรับ Make.com webhook
Removes a previously registered Make.com scenario webhook subscription. Authenticated via DeveloperAPIAuth with no scope requirement.
- URL พื้นฐาน
- https://api.s.id/v2
- การรับรองความถูกต้อง
- คีย์ API
การตอบกลับ
200Unsubscribed401UnauthorizedScope Reference
links:readแสดงและอ่านลิงก์
links:writeสร้างและอัปเดตลิงก์ (สร้าง แก้ไข กู้คืน)
links:archiveเก็บลิงก์เข้าคลัง
links:analyticsอ่านสถิติการคลิกและจำนวนคลิกตลอดอายุการใช้งานของแต่ละลิงก์
qr:readอ่านการตั้งค่าคิวอาร์โค้ด (ส่วนกลางและรายลิงก์)
qr:writeปรับแต่งการตั้งค่าคิวอาร์โค้ด (ส่วนกลางและรายลิงก์)
user:readอ่านโปรไฟล์ผู้ใช้ที่ยืนยันตัวตนแล้วและโควตาบัญชี
microsites:readอ่าน microsite
microsites:writeสร้าง อัปเดต และจัดการคอมโพเนนต์ของ microsite
microsites:deleteลบ microsite และคอมโพเนนต์
Rate Limits
ขีดจำกัดเริ่มต้นคือ 38 คำขอต่อนาทีต่อข้อมูลรับรอง—ต่อคีย์ API หรือโทเค็นการเข้าถึง OAuth หนึ่งรายการ แอป OAuth ยังมีเพดานรวม 500 คำขอต่อนาทีสำหรับโทเค็นทั้งหมด
การตอบกลับข้อผิดพลาดทั่วไป
- 400
- คำขอมีรูปแบบไม่ถูกต้องหรือไม่รองรับ
- 401
- ไม่มีข้อมูลรับรอง ข้อมูลไม่ถูกต้อง ถูกเพิกถอน หรือหมดอายุ
- 403
- ข้อมูลรับรองไม่มีสโคปที่จำเป็น
- 404
- ไม่พบทรัพยากรที่ร้องขอ
- 422
- การตรวจสอบคำขอล้มเหลว
- 429
- เกินขีดจำกัดอัตราการเรียกใช้
พร้อมเริ่มสร้างแล้วหรือยัง?
สร้าง API key ในไม่กี่นาที มีแพ็กเกจฟรี, ไม่ต้องใช้บัตรเครดิต
