API v2 Shortener
Tạo và quản lý link ngắn từ ứng dụng của bạn. Base URL: https://api.s.id/v2. Phiên bản hiện tại 2.0.0, và đặc tả đầy đủ có ở định dạng OpenAPI.
Tài liệu tham chiếu tương tácXác thực
Gửi API key sk_live_... hoặc OAuth 2.0 access token qua header Authorization: Bearer. Tạo API key trong Dashboard > Developer; mỗi key chỉ dùng được các scope bạn chọn.
| Phạm vi | Quyền truy cập |
|---|---|
links:read | Liệt kê và đọc liên kết |
links:write | Tạo và cập nhật liên kết (tạo, sửa, khôi phục) |
links:archive | Lưu trữ liên kết |
links:analytics | Đọc thống kê lượt nhấp và tổng lượt nhấp trọn đời của từng liên kết |
Authorization: Bearer sk_live_...Tạo link
Gửi POST /links với URL đích. Slug sẽ được tạo tự động nếu bỏ trống custom_slug.
curl -X POST https://api.s.id/v2/links \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"long_url": "https://example.com/long-url", "custom_slug": "[your-alias]"}'| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
long_url | string | Có | URL đích |
title | string | Không | Tiêu đề liên kết |
custom_slug | string | Không | Slug tùy chỉnh; tự động tạo khi để trống |
password | string | Không | Mật khẩu bảo vệ liên kết |
expired_at | integer | Không | Thời gian hết hạn dưới dạng Unix timestamp (giây) |
domain_alias | string | Không | Tên miền tùy chỉnh dùng thay cho s.id |
Ví dụ phản hồi:
{
"data": {
"id": 123,
"short": "[your-alias]",
"short_url": "https://s.id/[your-alias]",
"long_url": "https://example.com/long-url",
"microsite": false,
"protected": false,
"disposable": false,
"adult": false
},
"message": "link_created"
}Danh sách endpoint
Links
GET/linksLiệt kê liên kết
Returns a paginated list of the authenticated user's links.
URL gốc: https://api.s.id/v2 · Phạm vi: links:read
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
page | query | integer | Không | |
limit | query | integer | Không | |
search | query | string | Không | Filter by short code or URL |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | List of links |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
POST/linksTạo liên kết
URL gốc: https://api.s.id/v2 · Phạm vi: links:write
Nội dung yêu cầu
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
long_url | string | Có | The destination (long) URL |
title | string | Không | |
custom_slug | string | Không | Custom short code; auto-generated when omitted |
password | string | Không | Optional password to protect the link |
expired_at | integer | Không | Optional expiry as a Unix timestamp (seconds) |
domain_alias | string | Không | Custom domain to use instead of s.id |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | A single link |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
422 | Request validation failed |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
POST/links/availableKiểm tra slug còn trống
Checks whether a custom slug is available before creating a link.
URL gốc: https://api.s.id/v2 · Phạm vi: links:read
Nội dung yêu cầu
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
short | string | Có | |
domain_alias | string | Không | Custom domain, if any |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Slug is available |
401 | Missing or invalid API key |
422 | Slug is taken or invalid |
GET/links/{short}Lấy liên kết
URL gốc: https://api.s.id/v2 · Phạm vi: links:read
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
short | path | string | Có | The short code of the link |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | A single link |
401 | Missing or invalid API key |
404 | Resource not found |
PUT/links/{short}Cập nhật liên kết
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 gốc: https://api.s.id/v2 · Phạm vi: links:write
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
short | path | string | Có | The short code of the link |
Nội dung yêu cầu
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
long_url | string | Không | New destination URL |
title | string | Không | |
custom_slug | string | Không | Rename the short code (subject to plan quota) |
password | string | Không | Set a password ("" removes existing protection) |
disposable | boolean | Không | Mark link as disposable (expires after first click) |
adult | boolean | Không | Flag link as adult content |
archive_at | string | Không | Schedule auto-archive on this date (YYYY-MM-DD) |
domain_alias | string | Không | Change the custom domain (must be owned by the user) |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | A single link |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
404 | Resource not found |
422 | Request validation failed |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
DELETE/links/{short}Lưu trữ liên kết
Archives (soft-deletes) a link. The short code stops resolving. Use POST /links/{short}/unarchive to restore.
URL gốc: https://api.s.id/v2 · Phạm vi: links:archive
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
short | path | string | Có | The short code of the link |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Link archived |
401 | Missing or invalid API key |
404 | Resource not found |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
POST/links/{short}/unarchiveKhôi phục liên kết đã lưu trữ
Restores a previously archived link, making its short code resolve again.
URL gốc: https://api.s.id/v2 · Phạm vi: links:write
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
short | path | string | Có | The short code of the archived link |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Link restored |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
404 | Resource not found |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
GET/links/{short}/statsDòng thời gian lượt nhấp liên kết
Returns a date-bucketed click-count timeline for the link.
URL gốc: https://api.s.id/v2 · Phạm vi: links:analytics
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
short | path | string | Có | |
start | query | string | Không | |
end | query | string | Không |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Click timeline |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
404 | Resource not found |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
GET/links/{short}/stats/lifetimeTổng lượt nhấp trọn đời
Returns the all-time total click count for a single link.
URL gốc: https://api.s.id/v2 · Phạm vi: links:analytics
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
short | path | string | Có |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Lifetime click count |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
404 | Resource not found |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
POST/links/bulkTạo hàng loạt liên kết
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 gốc: https://api.s.id/v2 · Phạm vi: links:write
Nội dung yêu cầu
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
links | object[] | Có |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Bulk result — individual items may have success=false |
401 | Missing or invalid API key |
402 | Plan upgrade required (bulk shortening not in plan) |
403 | API key lacks the required scope |
User
GET/userLấy người dùng đã xác thực
URL gốc: https://api.s.id/v2 · Phạm vi: user:read
Phản hồi
| Mã | Mô tả |
|---|---|
200 | User profile |
401 | Missing or invalid API key |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
GET/quotaLấy hạn mức tài khoản
Returns the authenticated user's current plan limits and usage counters.
URL gốc: https://api.s.id/v2 · Phạm vi: user:read
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Account quota |
401 | Missing or invalid API key |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
QR
GET/qrLấy cài đặt QR toàn cục
Returns the account-level (global) QR code settings applied to QR codes by default.
URL gốc: https://api.s.id/v2 · Phạm vi: qr:read
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Global QR settings |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
PUT/qrTùy chỉnh cài đặt QR toàn cục
Updates the account-level (global) QR code settings. All fields are optional; omitted fields are left unchanged.
URL gốc: https://api.s.id/v2 · Phạm vi: qr:write
Nội dung yêu cầu
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
logo | string | Không | URL of the logo image embedded in the QR code |
color | string | Không | Foreground color as a hex value, e.g. #1a56db |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Updated global QR settings |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
422 | Request validation failed |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
GET/links/{short}/qrLấy cài đặt QR của liên kết
Returns the QR code settings for a single link.
URL gốc: https://api.s.id/v2 · Phạm vi: qr:read
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
short | path | string | Có | The short code of the link |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Link QR settings |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
404 | Resource not found |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
PUT/links/{short}/qrTùy chỉnh cài đặt QR của liên kết
Updates the QR code settings for a single link. All fields are optional; omitted fields are left unchanged.
URL gốc: https://api.s.id/v2 · Phạm vi: qr:write
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
short | path | string | Có | The short code of the link |
Nội dung yêu cầu
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
logo | string | Không | URL of the logo image embedded in the QR code |
color | string | Không | Foreground color as a hex value, e.g. #1a56db |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Updated link QR settings |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
404 | Resource not found |
422 | Request validation failed |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
Microsites
GET/micrositesLiệt kê microsite
Returns a paginated list of microsites owned by the authenticated user.
URL gốc: https://api.s.id/v2 · Phạm vi: microsites:read
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
limit | query | integer | Không | |
after | query | string | Không | Cursor for the next page (opaque string from previous response) |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | List of microsites |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
POST/micrositesTạo microsite
URL gốc: https://api.s.id/v2 · Phạm vi: microsites:write
Nội dung yêu cầu
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
slug | string | Có | URL-safe identifier (alphanumeric + hyphens/underscores) |
title | string | Có | |
kind | string | Có | Microsite category (e.g. personal_branding, brand, other) |
theme | string | Không | Theme slug (optional, defaults to the platform default) |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Microsite created |
400 | Validation error (slug already taken, quota exceeded, etc.) |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
GET/microsites/{slug}Lấy microsite
URL gốc: https://api.s.id/v2 · Phạm vi: microsites:read
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
slug | path | string | Có |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Microsite detail |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
404 | Microsite not found |
PUT/microsites/{slug}Cập nhật microsite
Patches title, description, and/or visibility. All fields are optional.
URL gốc: https://api.s.id/v2 · Phạm vi: microsites:write
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
slug | path | string | Có |
Nội dung yêu cầu
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
title | string | Không | |
description | string | Không | |
hide | boolean | Không | Set true to hide the microsite from public (requires plan that supports visibility toggle) |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Updated microsite |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
404 | Microsite not found |
DELETE/microsites/{slug}Xóa microsite
URL gốc: https://api.s.id/v2 · Phạm vi: microsites:delete
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
slug | path | string | Có |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Microsite deleted |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
404 | Microsite not found |
POST/microsites/availableKiểm tra slug microsite còn trống
Checks whether a microsite slug is available before creating a microsite.
URL gốc: https://api.s.id/v2 · Phạm vi: microsites:read
Nội dung yêu cầu
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
slug | string | Có |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Slug availability result |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
GET/microsites/{slug}/componentsLiệt kê thành phần microsite
Returns the components belonging to a microsite, in display order.
URL gốc: https://api.s.id/v2 · Phạm vi: microsites:read
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
slug | path | string | Có | The slug of the microsite |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | List of microsite components |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
404 | Resource not found |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
POST/microsites/{slug}/componentsThêm thành phần 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 gốc: https://api.s.id/v2 · Phạm vi: microsites:write
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
slug | path | string | Có | The slug of the microsite |
Nội dung yêu cầu
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
kind | PROFILE | LINK | HORIZONTAL_LINK | TEXT | IMAGE | MEDIA | DIVIDER | COUNTDOWN | MAPS | IMAGE_SLIDE | CV | AUTOPLAY_MUSIC | CONTACT | CALENDAR | SHOP_LISTING | SHOP_ITEM | SHOP_LEADERBOARD | Có | Component kind. The shape of data depends on this value. |
data | object | Có | Kind-specific component data. Its shape depends on kind. See the operation description and examples below. |
tag | string | Không | Optional grouping tag |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Component created |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
404 | Resource not found |
422 | Request validation failed |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
PUT/microsites/{slug}/components/{componentId}Cập nhật thành phần microsite
Updates a single microsite component.
URL gốc: https://api.s.id/v2 · Phạm vi: microsites:write
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
slug | path | string | Có | The slug of the microsite |
componentId | path | string | Có | The component ID |
Nội dung yêu cầu
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
active | boolean | Có | Whether the component is shown |
kind | string | Có | Component kind (e.g. LINK, PROFILE, TEXT) |
data | object | Có | Kind-specific component data |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Component updated |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
404 | Resource not found |
422 | Request validation failed |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
DELETE/microsites/{slug}/components/{componentId}Xóa thành phần microsite
Deletes a single microsite component.
URL gốc: https://api.s.id/v2 · Phạm vi: microsites:delete
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
slug | path | string | Có | The slug of the microsite |
componentId | path | string | Có | The component ID |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Component deleted |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
404 | Resource not found |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
POST/microsites/{slug}/components/orderSắp xếp lại thành phần microsite
Reorders a microsite's components according to the provided list of component IDs.
URL gốc: https://api.s.id/v2 · Phạm vi: microsites:write
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
slug | path | string | Có | The slug of the microsite |
Nội dung yêu cầu
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
orders | string[] | Có | Component IDs in the desired display order |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Components reordered |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
404 | Resource not found |
422 | Request validation failed |
429 | Too many requests. Per-tier limits apply, resolved from your s.id plan: a per-credential per-minute rate limit (rate_limit_exceeded) and a daily call quota (api_quota_exceeded), both shared across every integration using your credential (sk_live_* key or OAuth token). OAuth apps also have a secondary per-client_id ceiling (client_rate_limit_exceeded) across all their users' tokens. See GET /v2/quota for your current standing, and the X-RateLimit-* / X-Quota-* response headers. |
OAuth 2.0
GET/oauth/authorizeGet consent screen data
A plain browser navigation here (no Accept: application/json) 302-redirects to the dash.s.id consent UI, preserving the query string. With Accept: application/json, returns application name, logo, and requested scopes for the consent UI to render.
URL gốc: https://api.s.id
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
client_id | query | string | Có | |
redirect_uri | query | string | Có | |
response_type | query | code | Có | |
scope | query | string | Không | |
state | query | string | Không | Recommended. Opaque value for CSRF protection. Returned unchanged in the redirect. |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Consent screen data |
400 | Bad request |
POST/oauth/tokenExchange code or refresh token
URL gốc: https://api.s.id
Nội dung yêu cầu
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
grant_type | authorization_code | refresh_token | Không | |
code | string | Không | |
redirect_uri | string | Không | |
client_id | string | Không | |
client_secret | string | Không | |
refresh_token | string | Không |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Token response |
400 | Invalid grant, unsupported_grant_type, or invalid_client |
401 | Invalid client credentials |
POST/oauth/revokeRevoke a token
Revokes an access or refresh token. Always returns 200 OK regardless of whether the token was valid (RFC 7009).
URL gốc: https://api.s.id
Nội dung yêu cầu
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
token | string | Có |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Token revoked |
POST/oauth/introspectIntrospect a token
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 gốc: https://api.s.id
Nội dung yêu cầu
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
token | string | Có | |
client_id | string | Có | |
client_secret | string | Có |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Introspection result |
400 | Missing token/client_id, or invalid client credentials |
GET/oauth/userinfoGet authorized user profile
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 gốc: https://api.s.id · Phạm vi: user:read
Phản hồi
| Mã | Mô tả |
|---|---|
200 | User profile |
401 | Unauthorized |
GET/.well-known/oauth-authorization-serverOAuth 2.0 Authorization Server Metadata
RFC 8414 discovery document advertising every OAuth endpoint URL, supported scopes, and PKCE methods, so standards-compliant client libraries can configure themselves instead of hard-coding s.id's URLs.
URL gốc: https://api.s.id
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Authorization server metadata |
GET/api/user/oauth/appsList apps authorized by the current user
Returns all OAuth clients that have active tokens for the authenticated user. Auth: user session cookie (not API key).
URL gốc: https://api.s.id
Phản hồi
| Mã | Mô tả |
|---|---|
200 | List of connected apps |
401 | Unauthorized |
DELETE/api/user/oauth/apps/{clientId}Revoke all tokens for an app
Revokes all active tokens granted by the current user to the specified OAuth client.
URL gốc: https://api.s.id
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
clientId | path | string | Có |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | App access revoked |
401 | Unauthorized |
404 | App not found |
Analytics
GET/statsPhân tích lượt nhấp cấp tài khoản
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 gốc: https://api.s.id/v2 · Phạm vi: links:analytics
Tham số
| Trường | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
start | query | string | Không | Start date (YYYY-MM-DD). Defaults to 30 days ago. |
end | query | string | Không | End date (YYYY-MM-DD). Defaults to today. |
additional | query | boolean | Không | Include referer, location, device, browser breakdowns |
Phản hồi
| Mã | Mô tả |
|---|---|
200 | Account analytics |
401 | Missing or invalid API key |
403 | API key lacks the required scope |
Giới hạn và lỗi
Mỗi thông tin xác thực bị giới hạn theo phút. Kiểm tra hạn mức bằng GET /quota.
| Thông tin xác thực | Giới hạn |
|---|---|
| API key hoặc OAuth access token | 38 yêu cầu mỗi phút |
| Ứng dụng OAuth (tổng tất cả token) | 500 yêu cầu mỗi phút |
| Mã | Ý nghĩa |
|---|---|
400 | Yêu cầu sai định dạng hoặc không được hỗ trợ |
401 | Thiếu, không hợp lệ, đã thu hồi hoặc hết hạn thông tin xác thực |
403 | Thông tin xác thực không có phạm vi bắt buộc |
404 | Không tìm thấy tài nguyên được yêu cầu |
422 | Xác thực yêu cầu không thành công |
429 | Vượt quá giới hạn tần suất |