Bangun di atas s.id: REST API, Webhook & OAuth
Buat short link, lacak klik, dan otomatiskan alur kerjamu dengan platform developer s.id. Autentikasi API key yang gampang, webhook real-time, dan OAuth 2.0 untuk aplikasi pihak ketiga.
REST API
Kelola link, kode QR, dan data pengguna dengan API JSON yang bersih. Autentikasi Bearer token, 38 req/menit.
Pelajari Lebih LanjutWebhook
Langganan link.created, link.clicked, qr.scanned, dan lainnya. Payload bertanda tangan HMAC.
Pelajari Lebih LanjutOAuth 2.0
Alur authorization-code dengan PKCE dan rotasi refresh token bikin aplikasi kamu bisa bertindak atas nama pengguna s.id.
Pelajari Lebih LanjutServer MCP
Biarkan AI agent membuat link, mengelola microsite, dan membaca analitik lewat server Model Context Protocol yang di-hosting. 28 tools.
Pelajari Lebih LanjutMulai Cepat
Buat short link dalam satu panggilan API.
URL Dasar: https://api.s.id/v2
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": "mylink"}'Endpoint
Semua endpoint memerlukan API key dengan scope yang sesuai.
| Metode | Path | Deskripsi | Scope |
|---|---|---|---|
| GET | /links | List links | links:read |
| POST | /links | Create a link | links:write |
| POST | /links/available | Check slug availability | links:read |
| GET | /links/{short} | Get a link | links:read |
| PUT | /links/{short} | Update a link | links:write |
| DELETE | /links/{short} | Archive a link | links:archive |
| POST | /links/{short}/unarchive | Restore an archived link | links:write |
| GET | /links/{short}/stats | Link click timeline | links:analytics |
| GET | /links/{short}/stats/lifetime | Lifetime click count | links:analytics |
| GET | /user | Get authenticated user | user:read |
| GET | /quota | Get account quota | user:read |
| GET | /microsites | List microsites | microsites:read |
| POST | /microsites | Create a microsite | microsites:write |
| GET | /microsites/{slug} | Get a microsite | microsites:read |
| PUT | /microsites/{slug} | Update a microsite | microsites:write |
| DELETE | /microsites/{slug} | Delete a microsite | microsites:delete |
| POST | /links/bulk | Bulk create links | links:write |
| GET | /stats | Account-level click analytics | links:analytics |
| GET | /qr | Get global QR settings | qr:read |
| PUT | /qr | Customize global QR settings | qr:write |
| GET | /links/{short}/qr | Get a link's QR settings | qr:read |
| PUT | /links/{short}/qr | Customize a link's QR settings | qr:write |
| POST | /microsites/available | Check microsite slug availability | microsites:read |
| GET | /microsites/{slug}/components | List microsite components | microsites:read |
| POST | /microsites/{slug}/components | Add a microsite component | microsites:write |
| PUT | /microsites/{slug}/components/{componentId} | Update a microsite component | microsites:write |
| DELETE | /microsites/{slug}/components/{componentId} | Delete a microsite component | microsites:delete |
| POST | /microsites/{slug}/components/order | Reorder microsite components | microsites:write |
| GET | /oauth/authorize | Get consent screen data | |
| POST | /oauth/token | Exchange code or refresh token | |
| POST | /oauth/revoke | Revoke a token | |
| POST | /oauth/introspect | Introspect a token | |
| GET | /oauth/userinfo | Get authorized user profile | |
| GET | /.well-known/oauth-authorization-server | OAuth 2.0 Authorization Server Metadata | |
| GET | /api/user/oauth/apps | List apps authorized by the current user | |
| DELETE | /api/user/oauth/apps/{clientId} | Revoke all tokens for an app | |
| POST | /integrations/make/webhook/subscribe | Subscribe a Make.com webhook | |
| POST | /integrations/make/webhook/unsubscribe | Unsubscribe a Make.com webhook | |
Scope API
Setiap API key punya scope, minta izin yang benar-benar dibutuhkan integrasimu aja.
links:readList and read linkslinks:writeCreate and update links (create, edit, restore)links:archiveArchive linkslinks:analyticsRead per-link click statistics and lifetime countsqr:readRead QR code settings (global and per-link)qr:writeCustomize QR code settings (global and per-link)user:readRead the authenticated user profile and account quotamicrosites:readRead micrositesmicrosites:writeCreate, update and manage components of micrositesmicrosites:deleteDelete microsites and their componentsWebhook
Daftarkan endpoint HTTPS untuk menerima event real-time. Setiap pengiriman ditandatangani POST dengan HMAC-SHA256.
Event yang tersedia
link.createdFired when a new link is createdlink.updatedFired when a link's URL or title is changedlink.archivedFired when a link is archivedlink.clickedFired on each redirect (per-click event)microsite.publishedFired when a microsite is publishedqr.scannedFired when a QR code is scannedContoh payload
{
"event": "link.created",
"link": {
"id": 123,
"short": "mylink",
"short_url": "https://s.id/mylink",
"long_url": "https://example.com/long-url",
"title": "My Link",
"created": "2026-06-22T10:00:00Z"
},
"timestamp": "2026-06-22T10:00:00Z"
}Verifikasi tanda tangan (Node.js)
const crypto = require('crypto');
function verifySignature(secret, rawBody, sigHeader) {
const expected = 'sha256=' +
crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
return crypto.timingSafeEqual(
Buffer.from(sigHeader),
Buffer.from(expected),
);
}Secret cuma ditampilkan sekali pas kamu bikin webhook. Verifikasi dulu sebelum memproses event.
Autentikasi
Dua cara autentikasi: API key untuk server-ke-server, OAuth 2.0 untuk alur atas nama pengguna.
API Key
Buat kunci di Dashboard → Developer → API Keys. Kirimkan sebagai token Bearer. Kunci memiliki scope dan dapat dicabut kapan saja.
Authorization: Bearer sk_live_...OAuth 2.0
Gunakan alur authorization-code untuk bertindak atas nama pengguna s.id. Arahkan ke /oauth/authorize, tukarkan kode di /oauth/token.
Panduan OAuth 2.0Siap mulai membangun?
Buat API key dalam hitungan menit. Sudah termasuk tier gratis, tanpa kartu kredit.