s.id Logo
s.id
Platform Developer

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 Lanjut

Webhook

Langganan link.created, link.clicked, qr.scanned, dan lainnya. Payload bertanda tangan HMAC.

Pelajari Lebih Lanjut

OAuth 2.0

Alur authorization-code dengan PKCE dan rotasi refresh token bikin aplikasi kamu bisa bertindak atas nama pengguna s.id.

Pelajari Lebih Lanjut

Server MCP

Biarkan AI agent membuat link, mengelola microsite, dan membaca analitik lewat server Model Context Protocol yang di-hosting. 28 tools.

Pelajari Lebih Lanjut

Mulai Cepat

Buat short link dalam satu panggilan API.

1Buka Dashboard → Developer → API Keys
2Buat kunci dengan scope yang kamu butuhkan
3Panggil API dengan Bearer sk_live_...

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.

Referensi API Lengkap ↗
MetodePathDeskripsiScope
GET/linksList linkslinks:read
POST/linksCreate a linklinks:write
POST/links/availableCheck slug availabilitylinks:read
GET/links/{short}Get a linklinks:read
PUT/links/{short}Update a linklinks:write
DELETE/links/{short}Archive a linklinks:archive
POST/links/{short}/unarchiveRestore an archived linklinks:write
GET/links/{short}/statsLink click timelinelinks:analytics
GET/links/{short}/stats/lifetimeLifetime click countlinks:analytics
GET/userGet authenticated useruser:read
GET/quotaGet account quotauser:read
GET/micrositesList micrositesmicrosites:read
POST/micrositesCreate a micrositemicrosites:write
GET/microsites/{slug}Get a micrositemicrosites:read
PUT/microsites/{slug}Update a micrositemicrosites:write
DELETE/microsites/{slug}Delete a micrositemicrosites:delete
POST/links/bulkBulk create linkslinks:write
GET/statsAccount-level click analyticslinks:analytics
GET/qrGet global QR settingsqr:read
PUT/qrCustomize global QR settingsqr:write
GET/links/{short}/qrGet a link's QR settingsqr:read
PUT/links/{short}/qrCustomize a link's QR settingsqr:write
POST/microsites/availableCheck microsite slug availabilitymicrosites:read
GET/microsites/{slug}/componentsList microsite componentsmicrosites:read
POST/microsites/{slug}/componentsAdd a microsite componentmicrosites:write
PUT/microsites/{slug}/components/{componentId}Update a microsite componentmicrosites:write
DELETE/microsites/{slug}/components/{componentId}Delete a microsite componentmicrosites:delete
POST/microsites/{slug}/components/orderReorder microsite componentsmicrosites:write
GET/oauth/authorizeGet consent screen data
POST/oauth/tokenExchange code or refresh token
POST/oauth/revokeRevoke a token
POST/oauth/introspectIntrospect a token
GET/oauth/userinfoGet authorized user profile
GET/.well-known/oauth-authorization-serverOAuth 2.0 Authorization Server Metadata
GET/api/user/oauth/appsList apps authorized by the current user
DELETE/api/user/oauth/apps/{clientId}Revoke all tokens for an app
POST/integrations/make/webhook/subscribeSubscribe a Make.com webhook
POST/integrations/make/webhook/unsubscribeUnsubscribe a Make.com webhook

Scope API

Setiap API key punya scope, minta izin yang benar-benar dibutuhkan integrasimu aja.

links:readList and read links
links:writeCreate and update links (create, edit, restore)
links:archiveArchive links
links:analyticsRead per-link click statistics and lifetime counts
qr: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 quota
microsites:readRead microsites
microsites:writeCreate, update and manage components of microsites
microsites:deleteDelete microsites and their components

Webhook

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 created
link.updatedFired when a link's URL or title is changed
link.archivedFired when a link is archived
link.clickedFired on each redirect (per-click event)
microsite.publishedFired when a microsite is published
qr.scannedFired when a QR code is scanned

Contoh 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.

Panduan lengkap webhook

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.0

Siap mulai membangun?

Buat API key dalam hitungan menit. Sudah termasuk tier gratis, tanpa kartu kredit.