APIv1.13 · 2026-07-08

Geliştirici API’si

Sunucularınızı, hostingi, alan adlarını, faturalandırmayı ve destek taleplerini programatik olarak yönetin. Tüm uç noktalar kapsam denetimli bir API anahtarıyla korunur.

Base URL
https://api.sunucu.com/v1
Kimlik doğrulama
Authorization: Bearer snc_…

AI bağlantısı (MCP)

Claude ve diğer MCP destekli araçları doğrudan hesabınıza bağlayın. API anahtarınızı taşıyıcı (Bearer) olarak kullanır; tüm araçlar anahtarın kapsamlarıyla sınırlıdır.

MCP uç noktası (Streamable HTTP)
https://api.sunucu.com/mcp
Claude Code ile ekleyin:
claude mcp add --transport http sunucu https://api.sunucu.com/mcp \
  --header "Authorization: Bearer snc_…"

71 araç: sunucular (ters DNS dahil), hosting, alan adları, faturalandırma, destek ve webhook’lar. API anahtarı oluşturun →

OAuth destekleyen istemciler anahtar yapıştırmadan bağlanabilir — tarayıcıda onaylarsınız (RFC 8628 cihaz kodu akışı).

Yerel/stdio çalıştırma: SUNUCU_API_KEY=snc_… npx -y @otwa/sunucu-mcp

Uç noktalar

Account

GET/v1/accountaccount:read

Returns the authenticated account profile.

Servers

GET/v1/serversservers:read

List every server on the account.

GET/v1/servers/:idservers:read

Server detail (backbone-scrubbed — no upstream provider, no provisioning logs).

GET/v1/servers/:id/statsservers:read

Live CPU / memory / network / disk usage.

GET/v1/servers/:id/snapshotsservers:read

Disk snapshots (restore points) for the server.

GET/v1/servers/:id/ipsservers:read

Every IP on the server with its current PTR record. `zoneHosted: false` means the reverse zone is not on our DNS and the PTR cannot be managed here.

GET/v1/servers/:id/plan-optionsservers:read

Plans this server can resize to — same family, same disk size (a plan change never alters disk). Returns the current plan and the switchable options, cheapest first.

POST/v1/servers/:id/power/:actionservers:write

Power the server start, stop, or reboot. `:action` ∈ {start,stop,reboot}.

POST/v1/servers/:id/ssoservers:read

Issue a short-lived URL that logs into the dashboard for this server.

{ "next": "/optional/path" }
POST/v1/servers/:id/change-planservers:write

Switch to another plan in the same family with the same disk size — an in-place vCPU/RAM resize. The server reboots (~1 min) to apply; disk is never changed. Only the recurring price changes: no proration on an up-switch, no credit on a down-switch — the next renewal bills the new plan. Use GET /servers/:id/plan-options for valid targets.

{ "productId": "..." }
POST/v1/servers/:id/snapshotsservers:write

Take a disk snapshot. Honours an optional Idempotency-Key header.

{ "name": "pre-upgrade", "description": "before kernel bump" }
DELETE/v1/servers/:id/snapshots/:snapshotIdservers:write

Remove a snapshot (non-destructive to the live disk).

PUT/v1/servers/:id/ips/:ip/ptrservers:write

Point the IP's PTR record at a hostname (e.g. `mail.example.com`). Idempotent upsert.

{ "hostname": "mail.example.com" }
DELETE/v1/servers/:id/ips/:ip/ptrservers:write

Remove the PTR record for the IP.

POST/v1/servers/:id/reinstallservers:destroy

DESTRUCTIVE — wipe the disk and rebuild from an OS template. Honours Idempotency-Key.

{ "osTemplate": "ubuntu-22.04", "os": "ubuntu" }
POST/v1/servers/:id/snapshots/:snapshotId/revertservers:destroy

DESTRUCTIVE — roll the live disk back to a snapshot.

DELETE/v1/servers/:idservers:destroy

DESTRUCTIVE — permanently terminate the server.

Hosting

GET/v1/hostinghosting:read

List web-hosting accounts.

GET/v1/hosting/:idhosting:read

Hosting account detail (connection info, backbone-scrubbed).

PUT/v1/hosting/:id/custom-domainhosting:write

Attach a custom domain to a hosting account.

{ "domain": "example.com" }
POST/v1/hosting/:id/custom-domain/verifyhosting:write

Re-check DNS and attach the custom domain once it points to us.

DELETE/v1/hosting/:id/custom-domainhosting:write

Detach the custom domain from the hosting account.

Hosting control panel

GET/v1/hosting/:id/statshosting:manage

Disk usage, inode count, bandwidth, and mailbox count for the account.

GET/v1/hosting/:id/logshosting:manage

Tail the access or error log. Query: `kind` ∈ {access,error}, `lines`.

POST/v1/hosting/:id/cert/retryhosting:manage

Retry the Let's Encrypt certificate issue now.

PUT/v1/hosting/:id/php-versionhosting:manage

Switch the account's PHP-FPM version.

{ "php_version": "8.3" }
GET/v1/hosting/:id/cronhosting:manage

Read the crontab (header + jobs).

PUT/v1/hosting/:id/cronhosting:manage

Replace the crontab.

{ "jobs": [ { "schedule": "0 3 * * *", "command": "php cron.php" } ] }
GET/v1/hosting/:id/protected-dirshosting:manage

Password-protected directories (htpasswd).

POST/v1/hosting/:id/protected-dirshosting:manage

Add or update a password-protected directory.

{ "path": "/admin", "basic_user": "u", "password": "…" }
DELETE/v1/hosting/:id/protected-dirshosting:manage

Remove protection. Query: `path`.

GET/v1/hosting/:id/wafhosting:manage

ModSecurity WAF status for the account.

GET/v1/hosting/:id/waf/accesshosting:manage

Whether temporary WAF-log access is active.

POST/v1/hosting/:id/waf/accesshosting:manage

Request temporary access to WAF logs.

GET/v1/hosting/:id/ssh-terminal/accesshosting:manage

Whether browser-SSH terminal access is enabled.

POST/v1/hosting/:id/ssh-terminal/accesshosting:manage

Enable browser-SSH terminal access.

POST/v1/hosting/:id/ssh-terminal/launchhosting:manage

Start a browser-SSH session; returns a session URL/token.

POST/v1/hosting/:id/ssh-terminal/stophosting:manage

Stop the browser-SSH session.

GET/v1/hosting/:id/githosting:manage

Git-deploy status for the account.

GET/v1/hosting/:id/git/deploy-keyhosting:manage

The SSH deploy key to add to your repo.

GET/v1/hosting/:id/git/webhookhosting:manage

The push-to-deploy webhook URL/secret.

POST/v1/hosting/:id/git/webhookhosting:manage

Enable push-to-deploy.

DELETE/v1/hosting/:id/git/webhookhosting:manage

Disable push-to-deploy.

POST/v1/hosting/:id/git/deployhosting:manage

Clone/deploy a repo into the site.

{ "repo_url": "git@…", "branch": "main", "subdir": "" }
POST/v1/hosting/:id/git/pullhosting:manage

Pull the latest commit for the deployed repo.

DELETE/v1/hosting/:id/githosting:manage

Disconnect git deploy from the site.

GET/v1/hosting/:id/fileshosting:manage

List a directory. Query: `path` (default /public_html).

GET/v1/hosting/:id/files/readhosting:manage

Read a text file's contents. Query: `path`.

PUT/v1/hosting/:id/fileshosting:manage

Create or overwrite a text file.

{ "path": "/public_html/x.txt", "content": "…" }
DELETE/v1/hosting/:id/fileshosting:manage

Delete a file or directory. Query: `path`, `recursive`.

GET/v1/hosting/:id/files/downloadhosting:manage

Stream a file as an attachment. Query: `path`.

POST/v1/hosting/:id/files/uploadhosting:manage

Upload a file (multipart form field `file`). Query: `path`.

POST/v1/hosting/:id/files/mkdirhosting:manage

Create a directory.

{ "path": "/public_html/new" }
POST/v1/hosting/:id/files/renamehosting:manage

Rename or move a file/directory.

{ "from": "/a", "to": "/b" }
GET/v1/hosting/:id/backupshosting:manage

Site backups (restore points).

POST/v1/hosting/:id/backupshosting:manage

Create a new site backup.

DELETE/v1/hosting/:id/backups/:bidhosting:manage

Delete a backup.

POST/v1/hosting/:id/backups/:bid/restorehosting:manage

Restore the site from a backup.

GET/v1/hosting/:id/backups/:bid/downloadhosting:manage

Stream a backup archive (gzip).

GET/v1/hosting/:id/visitor-statshosting:manage

Visitor statistics. Query: `period` ∈ {24h,7d,30d}.

GET/v1/hosting/:id/databaseshosting:manage

Extra MySQL databases on the account.

POST/v1/hosting/:id/databaseshosting:manage

Create an extra MySQL database.

{ "suffix": "wp2" }
DELETE/v1/hosting/:id/databases/:namehosting:manage

Delete an extra MySQL database.

Mail

GET/v1/mail/setupmail:read

The MX / SPF / DMARC records to add so mail for your domains routes to us.

GET/v1/mail/domainsmail:read

Every mail domain on the account.

POST/v1/mail/domainsmail:write

Enable email hosting for a domain.

{ "domain": "example.com" }
DELETE/v1/mail/domains/:idmail:write

Disable email hosting for a domain (removes its mailboxes and aliases).

GET/v1/mail/domains/:id/mailboxesmail:read

Mailboxes under one mail domain.

GET/v1/mail/domains/:id/aliasesmail:read

Forwarding aliases under one mail domain.

GET/v1/mail/mailboxesmail:read

Every mailbox across all your mail domains.

POST/v1/mail/mailboxesmail:write

Create a mailbox on a mail domain.

{ "domain_id": 12, "local_part": "info", "password": "…", "quota_mb": 2048 }
PATCH/v1/mail/mailboxes/:id/passwordmail:write

Set a new password for a mailbox.

{ "password": "…" }
DELETE/v1/mail/mailboxes/:idmail:write

Permanently delete a mailbox and its mail.

POST/v1/mail/aliasesmail:write

Create a forwarding alias (source → destination).

{ "domain_id": 12, "source_local": "sales", "destination": "info@example.com" }
DELETE/v1/mail/aliases/:idmail:write

Remove a forwarding alias.

Domains

GET/v1/domainsdomains:read

List registered domains.

GET/v1/domains/:iddomains:read

Domain detail.

PATCH/v1/domains/:iddomains:write

Update auto-renew, transfer lock, WHOIS privacy, or nameservers.

{ "auto_renew": true, "transfer_lock": true, "nameservers": ["ns1.example.com","ns2.example.com"] }

Billing

GET/v1/billing/invoicesbilling:read

Paginated invoice list. Query: page, limit.

GET/v1/billing/invoices/:idbilling:read

Single invoice with line items.

GET/v1/billing/walletbilling:read

Prepaid wallet balance and state.

GET/v1/billing/wallet/transactionsbilling:read

Recent wallet transactions. Query: limit.

PATCH/v1/billing/wallet/auto-rechargebilling:write

Configure automatic wallet top-up when the balance drops below a threshold. Returns the updated wallet state.

{ "enabled": true, "threshold_usd_cents": 500, "amount_usd_cents": 2000 }

Support tickets

GET/v1/ticketstickets:read

List support tickets.

GET/v1/tickets/:idtickets:read

Ticket detail with the message thread.

POST/v1/ticketstickets:write

Open a support ticket. Honours Idempotency-Key.

{ "subject": "Need help", "message": "…", "department": "technical", "priority": "medium" }
POST/v1/tickets/:id/replytickets:write

Post a customer reply on a ticket.

{ "body": "Thanks, that worked." }
POST/v1/tickets/:id/closetickets:write

Close the ticket.

Webhooks

GET/v1/webhookswebhooks:read

List webhook subscriptions.

POST/v1/webhookswebhooks:write

Subscribe a URL to events. Secret returned ONCE.

{ "url": "https://example.com/hooks", "events": ["*"], "description": "prod" }
GET/v1/webhooks/:idwebhooks:read

Webhook subscription detail (secret masked).

PATCH/v1/webhooks/:idwebhooks:write

Change url, events, description, or pause/resume (isActive).

DELETE/v1/webhooks/:idwebhooks:write

Delete a subscription.

POST/v1/webhooks/:id/rotate-secretwebhooks:write

Issue a fresh signing secret (returned ONCE). Old secret stops immediately.

GET/v1/webhooks/:id/deliverieswebhooks:read

Recent delivery attempts. Query: limit.

POST/v1/webhooks/:id/deliveries/:deliveryId/redeliverwebhooks:write

Re-queue a past delivery for another attempt.

Webhooks

Bir olay gerçekleştiğinde URL’nize imzalı bir POST gönderilir. İmza HMAC-SHA256’dır: X-Sunucu-Signature: t=<ts>,v1=HMAC(secret, "<ts>." + body). Başarısız teslimler üstel geri çekilmeyle yeniden denenir (1dk → 6sa).

server.created

A server finished provisioning. Payload: serverId, status, label.

server.power.changed

A power action ran. Payload: serverId, action (start/stop/reboot).

server.resized

A server changed plan (vCPU/RAM resize). Payload: serverId, productId, vcpu, ramMb.

server.reinstalled

A reinstall ran. Payload: serverId, os, osTemplate.

server.ptr.changed

A reverse-DNS (PTR) record was set or cleared. Payload: serverId, ip, ptr (null when cleared).

server.terminated

A server was terminated. Payload: serverId.

server.suspended

A server was suspended (e.g. expiry). Payload: serverId, reason.

hosting.created

A web-hosting account finished provisioning. Payload: hostingId, domain, status.

invoice.created

A new invoice was issued (any source — order, renewal, admin). Payload: invoiceId, invoiceNumber, status, totalUsdCents, currency.

invoice.paid

An invoice transitioned to paid (card, PayPal, crypto, or wallet). Payload: invoiceId, invoiceNumber, totalUsdCents, currency.

wallet.deposit.received

A wallet top-up was credited. Payload: amountUsdCents, gateway, transactionId.

domain.registered

A domain registration completed (post-payment). Payload: domainId, domain, periodYears, expiresAt.

ticket.created

A support ticket was opened. Payload: ticketId, ticketNumber, subject, status, priority.

ticket.replied

Support staff replied to your ticket. Payload: ticketId, ticketNumber, subject, status.

Hata kodları

400
Bad RequestMissing or invalid request body parameters.
401
UnauthorizedMissing, invalid, or expired API key.
403
ForbiddenAPI key lacks the required scope for this action.
404
Not FoundThe resource does not exist or belongs to another account.
429
Too Many RequestsPer-key rate limit exceeded (120 req/min). See the X-RateLimit-Limit / -Remaining / -Reset and Retry-After response headers.
500
Internal Server ErrorUnexpected server error. If persistent, contact support.

Değişiklik günlüğü

v1.132026-07-08latest
  • newNew webhook event server.resized — fires when a server changes plan (vCPU/RAM resize). Payload: serverId, productId, vcpu, ramMb.
v1.122026-07-08
  • newDashboard SSO for servers — POST /v1/servers/:id/sso returns a short-lived URL that logs into the dashboard for that server (scope servers:read). Also an MCP tool.
v1.112026-07-08
  • newWallet auto-recharge — PATCH /v1/billing/wallet/auto-recharge configures automatic top-up when your balance drops below a threshold. New opt-in scope billing:write (not in defaults).
v1.102026-07-08
  • newFull hosting control panel on the API — file manager (list/read/write/delete/upload/download/mkdir/rename), MySQL databases, backups (create/restore/download), cron, PHP version, SSL re-issue, protected directories, WAF, browser-SSH terminal, and git deploy. All under one new opt-in scope hosting:manage — powerful (file + shell access), so it is NOT granted by default; add it explicitly when minting a key. Also available as MCP tools.
v1.92026-07-08
  • newEmail hosting on the API — the full mail panel is now scriptable: GET/POST/DELETE /v1/mail/domains, GET/POST/DELETE /v1/mail/mailboxes (+ PATCH /v1/mail/mailboxes/:id/password), GET/POST/DELETE /v1/mail/aliases, and GET /v1/mail/setup for the MX/SPF/DMARC records. New scopes: mail:read (in defaults) and mail:write. Also available as MCP tools.
v1.82026-07-08
  • newServer resize — GET /v1/servers/:id/plan-options lists the plans a server can switch to (same family, same disk), and POST /v1/servers/:id/change-plan moves it to one, applying a new vCPU/RAM allocation. The server reboots (~1 min) and disk never changes. Only the recurring price changes — no proration on an up-switch, no credit on a down-switch. Reads carry servers:read, the switch carries servers:write. Powers the new Cloud Router line (move between Router S/M/L). Also in the dashboard and as MCP tools.
v1.72026-06-11
  • newReverse DNS (PTR) management — GET /v1/servers/:id/ips lists every IP on a server with its current PTR; PUT/DELETE /v1/servers/:id/ips/:ip/ptr set or clear the record. Reads carry servers:read, writes servers:write. Also available in the dashboard (Operations → Ters DNS) and as MCP tools.
  • newWebhook event server.ptr.changed — fires when a PTR record is set or cleared (from the dashboard, API, or MCP). Payload: serverId, ip, ptr (null when cleared).
v1.62026-06-03
  • newTwo more webhook events: invoice.created (fires for any new invoice — order, renewal, or admin) and domain.registered (a registration completed after payment). The catalogue is now 13 events.
  • improvedConnect-AI (MCP) wizard on the API Keys page — pick your client (Claude Code / Desktop / Cursor / VS Code) and copy a ready-made config.
v1.52026-06-03
  • newOAuth 2.0 device-code flow (RFC 8628). Connect AI tools by browser-approval instead of pasting a key: the client opens sunucu.com/oauth/device, you approve the requested scopes, and it receives a scoped snc_at_ access token (+ single-use snc_rt_ refresh, 90-day). Endpoints under /oauth/* with AS metadata at /.well-known/oauth-authorization-server. Revoke connected apps anytime from the API Keys page.
v1.42026-06-03
  • newModel Context Protocol (MCP) server — connect Claude and other AI tools directly to your account at https://api.sunucu.com/mcp (Streamable HTTP) using your snc_ API key as a Bearer token. 37 tools across servers, hosting, domains, billing, tickets and webhooks, scope-gated by the key.
v1.32026-06-03
  • newPer-key rate limiting — 120 requests/minute per API key, with X-RateLimit-Limit / X-RateLimit-Remaining / X-RateLimit-Reset headers on every response and Retry-After on a 429.
  • newFour more webhook events: server.suspended, hosting.created, invoice.paid (fires for card / PayPal / crypto / wallet payments alike), and wallet.deposit.received.
v1.22026-06-03
  • newWebhooks — subscribe a URL to account events and receive signed (HMAC-SHA256) POSTs. Eight endpoints under /v1/webhooks behind the new webhooks:read / webhooks:write scopes: list, create, get, update (incl. pause/resume), delete, rotate-secret, delivery log, and redeliver. Failed deliveries retry with exponential backoff (1m→6h).
  • newWebhook events: server.created, server.power.changed, server.reinstalled, server.terminated, ticket.created, ticket.replied.
v1.12026-06-03
  • newWrite endpoints. servers:write — power start/stop/reboot, password reset, create/delete snapshots. servers:destroy (opt-in, not in defaults) — reinstall, snapshot revert, terminate. hosting:write — set/verify/remove custom domain. domains:write — update auto-renew / lock / WHOIS / nameservers. tickets:write — open, reply, close.
  • improvedIdempotency-Key header on snapshot-create, reinstall, and ticket-create dedups retried requests for 24h.
v1.02026-06-03
  • newPublic API launch — read-only endpoints for account, servers (incl. live stats & snapshots), hosting, domains, billing (invoices & wallet) and support tickets. Authenticate with an snc_… API key minted from the dashboard.