Rujukan API
Lihat setiap operasi REST dan OAuth berserta hos, kaedah pengesahan, skop, parameter, medan permintaan dan kod respons yang tepat.
OpenAPI v2.1.0
Gambaran keseluruhan API
Operasi awam /v2 menerima sama ada kunci API berskop atau token akses OAuth 2.0. Operasi pengurusan OAuth menggunakan keperluan pelayar, sesi atau kelayakan klien masing-masing.
- URL Asas:
- https://api.s.id/v2
- Operasi
- 38
- Skop
- 10
Pengesahan
Kelayakan mempunyai skop. Skop wajib yang tiada mengembalikan 403 insufficient_scope. Minta hanya kebenaran yang diperlukan oleh integrasi anda.
Authorization: Bearer sk_live_...Titik Akhir
Katalog endpoint
Kembangkan operasi untuk memeriksa URL asas, pengesahan, input dan kod respons yang mungkin dengan tepat.
Links
GET/linksSenaraikan pautan
Returns a paginated list of the authenticated user's links.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
links:readParameter
pagequery · integerlimitquery · integersearchquery · stringFilter by short code or URL
Respons
200List of links401403429POST/linksCipta pautan
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
links:writeBadan permintaan
long_urlstringDiperlukanThe 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
Respons
200401403422429POST/links/availableSemak ketersediaan slug
Checks whether a custom slug is available before creating a link.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
links:readBadan permintaan
shortstringDiperlukandomain_aliasstringCustom domain, if any
Respons
200Slug is available401422Slug is taken or invalidGET/links/{short}Dapatkan pautan
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
links:readParameter
shortpath · stringDiperlukanThe short code of the link
Respons
200401404PUT/links/{short}Kemas kini pautan
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 Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
links:writeParameter
shortpath · stringDiperlukanThe short code of the link
Badan permintaan
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)
Respons
200401403404422429DELETE/links/{short}Arkibkan pautan
Archives (soft-deletes) a link. The short code stops resolving. Use `POST /links/{short}/unarchive` to restore.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
links:archiveParameter
shortpath · stringDiperlukanThe short code of the link
Respons
200Link archived401404429POST/links/{short}/unarchivePulihkan pautan yang diarkibkan
Restores a previously archived link, making its short code resolve again.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
links:writeParameter
shortpath · stringDiperlukanThe short code of the archived link
Respons
200Link restored401403404429GET/links/{short}/statsGaris masa klik pautan
Returns a date-bucketed click-count timeline for the link.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
links:analyticsParameter
shortpath · stringDiperlukanstartquery · stringendquery · string
Respons
200Click timeline401403404429GET/links/{short}/stats/lifetimeJumlah klik sepanjang masa
Returns the all-time total click count for a single link.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
links:analyticsParameter
shortpath · stringDiperlukan
Respons
200Lifetime click count401403404429POST/links/bulkCipta pautan secara pukal
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 Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
links:writeBadan permintaan
linksarray<object>Diperlukan
Respons
200Bulk result — individual items may have success=false401402Plan upgrade required (bulk shortening not in plan)403User
GET/userDapatkan pengguna yang disahkan
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
user:readRespons
200User profile401429GET/quotaDapatkan kuota akaun
Returns the authenticated user's current plan limits and usage counters.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
user:readRespons
200Account quota401429Microsites
GET/micrositesSenaraikan microsite
Returns a paginated list of microsites owned by the authenticated user.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
microsites:readParameter
limitquery · integerafterquery · stringCursor for the next page (opaque string from previous response)
Respons
200List of microsites401403POST/micrositesCipta microsite
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
microsites:writeBadan permintaan
slugstringDiperlukanURL-safe identifier (alphanumeric + hyphens/underscores)
titlestringDiperlukankindstringDiperlukanMicrosite category (e.g. `personal_branding`, `brand`, `other`)
themestringTheme slug (optional, defaults to the platform default)
Respons
200Microsite created400Validation error (slug already taken, quota exceeded, etc.)401403GET/microsites/{slug}Dapatkan microsite
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
microsites:readParameter
slugpath · stringDiperlukan
Respons
200Microsite detail401403404Microsite not foundPUT/microsites/{slug}Kemas kini microsite
Patches title, description, and/or visibility. All fields are optional.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
microsites:writeParameter
slugpath · stringDiperlukan
Badan permintaan
titlestringdescriptionstringhidebooleanSet `true` to hide the microsite from public (requires plan that supports visibility toggle)
Respons
200Updated microsite401403404Microsite not foundDELETE/microsites/{slug}Padam microsite
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
microsites:deleteParameter
slugpath · stringDiperlukan
Respons
200Microsite deleted401403404Microsite not foundPOST/microsites/availableSemak ketersediaan slug microsite
Checks whether a microsite slug is available before creating a microsite.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
microsites:readBadan permintaan
slugstringDiperlukan
Respons
200Slug availability result401403429GET/microsites/{slug}/componentsSenaraikan komponen microsite
Returns the components belonging to a microsite, in display order.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
microsites:readParameter
slugpath · stringDiperlukanThe slug of the microsite
Respons
200List of microsite components401403404429POST/microsites/{slug}/componentsTambah komponen 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 Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
microsites:writeParameter
slugpath · stringDiperlukanThe slug of the microsite
Badan permintaan
kindstringDiperlukanComponent kind. The shape of `data` depends on this value.
dataobjectDiperlukanKind-specific component data. Its shape depends on `kind`. See the operation description and examples below.
tagstringOptional grouping tag
Respons
200Component created401403404422429PUT/microsites/{slug}/components/{componentId}Kemas kini komponen microsite
Updates a single microsite component.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
microsites:writeParameter
slugpath · stringDiperlukanThe slug of the microsite
componentIdpath · stringDiperlukanThe component ID
Badan permintaan
activebooleanDiperlukanWhether the component is shown
kindstringDiperlukanComponent kind (e.g. `LINK`, `PROFILE`, `TEXT`)
dataobjectDiperlukanKind-specific component data
Respons
200Component updated401403404422429DELETE/microsites/{slug}/components/{componentId}Padam komponen microsite
Deletes a single microsite component.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
microsites:deleteParameter
slugpath · stringDiperlukanThe slug of the microsite
componentIdpath · stringDiperlukanThe component ID
Respons
200Component deleted401403404429POST/microsites/{slug}/components/orderSusun semula komponen microsite
Reorders a microsite's components according to the provided list of component IDs.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
microsites:writeParameter
slugpath · stringDiperlukanThe slug of the microsite
Badan permintaan
ordersarray<string>DiperlukanComponent IDs in the desired display order
Respons
200Components reordered401403404422429Analytics
GET/statsAnalitik klik peringkat akaun
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 Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
links:analyticsParameter
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
Respons
200Account analytics401403QR
GET/qrDapatkan tetapan QR global
Returns the account-level (global) QR code settings applied to QR codes by default.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
qr:readRespons
200Global QR settings401403429PUT/qrSesuaikan tetapan QR global
Updates the account-level (global) QR code settings. All fields are optional; omitted fields are left unchanged.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
qr:writeBadan permintaan
logostringURL of the logo image embedded in the QR code
colorstringForeground color as a hex value, e.g. #1a56db
Respons
200Updated global QR settings401403422429GET/links/{short}/qrDapatkan tetapan QR pautan
Returns the QR code settings for a single link.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
qr:readParameter
shortpath · stringDiperlukanThe short code of the link
Respons
200Link QR settings401403404429PUT/links/{short}/qrSesuaikan tetapan QR pautan
Updates the QR code settings for a single link. All fields are optional; omitted fields are left unchanged.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API atau OAuth 2.0
Skop
qr:writeParameter
shortpath · stringDiperlukanThe short code of the link
Badan permintaan
logostringURL of the logo image embedded in the QR code
colorstringForeground color as a hex value, e.g. #1a56db
Respons
200Updated link QR settings401403404422429OAuth 2.0
POST/oauth/tokenTukar kod atau token muat semula
- URL Asas
- https://api.s.id
- Pengesahan
- Kunci API
Badan permintaan
grant_typestringcodestringredirect_uristringclient_idstringclient_secretstringrefresh_tokenstring
Respons
200Token response400Invalid grant, unsupported_grant_type, or invalid_client401Invalid client credentialsPOST/oauth/revokeBatalkan token
Revokes an access or refresh token. Always returns 200 OK regardless of whether the token was valid (RFC 7009).
- URL Asas
- https://api.s.id
- Pengesahan
- Kunci API
Badan permintaan
tokenstringDiperlukan
Respons
200Token revokedPOST/oauth/introspectPeriksa 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 Asas
- https://api.s.id
- Pengesahan
- Kunci API
Badan permintaan
tokenstringDiperlukanclient_idstringDiperlukanclient_secretstringDiperlukan
Respons
200Introspection result400Missing token/client_id, or invalid client credentialsGET/oauth/userinfoDapatkan profil pengguna yang dibenarkan
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 Asas
- https://api.s.id
- Pengesahan
- OAuth 2.0
Skop
user:readRespons
200User profile401UnauthorizedGET/api/user/oauth/appsSenaraikan aplikasi yang dibenarkan oleh pengguna semasa
Returns all OAuth clients that have active tokens for the authenticated user. Auth: user session cookie (not API key).
- URL Asas
- https://api.s.id
- Pengesahan
- Kunci API
Respons
200List of connected apps401UnauthorizedDELETE/api/user/oauth/apps/{clientId}Batalkan semua token untuk aplikasi
Revokes all active tokens granted by the current user to the specified OAuth client.
- URL Asas
- https://api.s.id
- Pengesahan
- Kunci API
Parameter
clientIdpath · stringDiperlukan
Respons
200App access revoked401Unauthorized404App not foundIntegrations
POST/integrations/make/webhook/subscribeLanggan webhook Make.com
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 Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API
Respons
200Subscribed401UnauthorizedPOST/integrations/make/webhook/unsubscribeHentikan langganan webhook Make.com
Removes a previously registered Make.com scenario webhook subscription. Authenticated via DeveloperAPIAuth with no scope requirement.
- URL Asas
- https://api.s.id/v2
- Pengesahan
- Kunci API
Respons
200Unsubscribed401UnauthorizedRujukan Skop
links:readSenaraikan dan baca pautan
links:writeCipta dan kemas kini pautan (cipta, edit, pulihkan)
links:archiveArkibkan pautan
links:analyticsBaca statistik klik setiap pautan dan jumlah sepanjang masa
qr:readBaca tetapan kod QR (global dan setiap pautan)
qr:writeSesuaikan tetapan kod QR (global dan setiap pautan)
user:readBaca profil pengguna yang disahkan dan kuota akaun
microsites:readBaca microsite
microsites:writeCipta, kemas kini dan urus komponen microsite
microsites:deletePadam microsite dan komponennya
Had Kadar
Had lalai ialah 38 permintaan seminit bagi setiap kelayakan—setiap kunci API atau token akses OAuth. Aplikasi OAuth juga mempunyai had gabungan 500 permintaan seminit merentasi tokennya.
Respons ralat biasa
- 400
- Permintaan rosak atau tidak disokong
- 401
- Kelayakan hilang, tidak sah, dibatalkan atau tamat tempoh
- 403
- Kelayakan tidak mempunyai skop yang diperlukan
- 404
- Sumber yang diminta tidak ditemui
- 422
- Pengesahan permintaan gagal
- 429
- Had kadar telah dilebihi
Bersedia untuk mula membina?
Cipta kunci API dalam beberapa minit. Peringkat percuma disertakan, tiada kad kredit diperlukan.
