İçeriğe geç
White page Kit
Türkçe

API dokümantasyonu

Whitepage siteleri kendi kodunuzdan, kodsuz bir araçtan ya da sadece bir yapay zekâ asistanına söyleyerek oluşturun; ilerlemeyi izleyin ve dosyaları indirin. Tüm istekler HTTPS üzerinden JSON kullanır.

Nasıl çalışır

Nasıl bağlanırsanız bağlanın, üç adım:

  1. API anahtarı oluşturun Giriş yapın, panelde API anahtarları sayfasını açın ve bir anahtar oluşturun. Hesabınız için bir parola gibi çalışır; gizli tutun.
  2. Site isteyin Bir başlık ve bir dil gönderin; isterseniz konu, hedef kitle ve anahtar kelimeleri de ekleyin. Üretim ücreti bakiyenizden ayrılır ve site oluşturulmaya başlar.
  3. Sitenizi alın Genellikle dakikalar içinde hazır olur. Durumu sorgulayın ya da bittiğinde adresinizi çağırmamızı sağlayın; sonra önizleyin, düzenleyin ve dosyaları indirin.

Nasıl bağlanacağınızı seçin

Kodsuz araçlar: HTTP isteği gönderebilen her şey (Zapier, Make, n8n, bir tablo betiği) aynı çağrıları yapabilir. POST /sites siteyi başlatır; zamanlayıcıyla GET /sites/{uuid} ya da bir callback_url bittiğini bildirir. API anahtarını Authorization başlığına koyun.

Temel kavramlar

Site
Tüm sayfalarıyla üretilmiş tek bir web sitesi. Bir uuid ile tanımlanır.
Durum
Üretilirken pending, hazır olunca done, başarısız olursa error. Başarısız site otomatik iade edilir.
API anahtarı
İsteğin hesabınızdan geldiğini kanıtlayan gizli bir metin. Anahtarları panelden oluşturur ve iptal edersiniz.
Bakiye
Hesabınızdaki ön ödemeli tutar. Site oluşturmak üretim ücretini bakiyeden ayırır.
Callback
Bir site bittiğinde bir kez çağırdığımız adresiniz; durumu sürekli sormanız gerekmez.
Idempotency anahtarı
İsteğe eklediğiniz bir etiket; aynı isteği iki kez göndermek iki site oluşturmaz ve iki kez ücret almaz.

Yapay zekâ asistanlarıyla kullanın

Bir yapay zekâ asistanı bağlayın ve sadece isteyin: "Diş kliniğim için Türkçe bir site yap." Asistan aynı API'yi sizin hesabınızla çağırır. Kontrol sizde kalır: site oluşturmak bakiye harcar ve iyi asistanlar bunu yapmadan önce size sorar.

Söyleyebilecekleriniz

  • Bakiyem ne kadar, bir site kaç para?
  • Bir fırın için hangi tasarım kitleri uygun?
  • Sakin bir liman pansiyonu olan Alder House için İngilizce tek sayfalık bir site oluştur.
  • Sitem hazır mı? Önizleme bağlantısını gönder.

MCP ile bağlayın (Claude, Cursor ve diğerleri)

MCP, asistanların dış araçları çağırmak için kullandığı açık standarttır. Asistanınızı MCP adresine yönlendirin ve API anahtarınızı Bearer belirteci olarak verin.

Claude Code

bash

claude mcp add --transport http whitepagekit https://whitepagekit.com/api/v1/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Cursor

~/.cursor/mcp.json

{
  "mcpServers": {
    "whitepagekit": {
      "url": "https://whitepagekit.com/api/v1/mcp",
      "headers": {
        "Authorization": "Bearer ${env:WPK_API_KEY}"
      }
    }
  }
}

Claude Desktop

claude_desktop_config.json

{
  "mcpServers": {
    "whitepagekit": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://whitepagekit.com/api/v1/mcp",
               "--header", "Authorization:${WPK_AUTH}"],
      "env": { "WPK_AUTH": "Bearer YOUR_API_KEY" }
    }
  }
}

Ham JSON-RPC

curl

curl -X POST https://whitepagekit.com/api/v1/mcp \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_account","arguments":{}}}'

Claude Desktop uzak sunuculara mcp-remote köprüsüyle bağlanır; Node.js gerekir.

ChatGPT (özel GPT)

  1. ChatGPT'de bir GPT oluşturun, Configure sekmesini açın ve Create new action seçin.
  2. Import from URL seçin ve https://whitepagekit.com/api/v1/openapi.json?profile=assistant adresini yapıştırın. Bu kısaltılmış şemada yalnızca altı asistan aracı bulunur.
  3. Authentication altında API key seçin, Auth Type olarak Bearer belirleyin ve API anahtarınızı yapıştırın.
  4. ChatGPT, bir şeyi değiştiren istekleri göndermeden önce onayınızı ister; bakiye harcayan her şey sizin kontrolünüzde kalır.

Schema URL

https://whitepagekit.com/api/v1/openapi.json?profile=assistant

OpenAI API (MCP aracı)

Responses API, MCP adresini uzak araç olarak kullanabilir. require_approval, insanı döngüde tutar.

Python

from openai import OpenAI

client = OpenAI()
response = client.responses.create(
    model="YOUR_MODEL",
    tools=[{
        "type": "mcp",
        "server_label": "whitepagekit",
        "server_url": "https://whitepagekit.com/api/v1/mcp",
        "headers": {"Authorization": "Bearer YOUR_API_KEY"},
        "require_approval": "always",
    }],
    input="What does one site cost, and which design kits suit a bakery?",
)
print(response.output_text)

Kendi araç döngünüz (function calling)

Model döngüsünü kendiniz yönetiyorsanız hazır araç şemalarını alın ve her araç çağrısını ilgili REST uç noktasında çalıştırın. Biçimler: openai (Responses API), openai-chat, anthropic ve mcp.

curl

curl "https://whitepagekit.com/api/v1/ai-tools?format=openai"   # or openai-chat, anthropic, mcp

Altı araç

Altı araç
Araç Ne yapar REST çağrısı Maliyet
get_account Bakiyenizi ve bir sitenin ücretini gösterir. GET /me Ücretsiz
list_languages Sitenin yazılabileceği dilleri listeler. GET /languages Ücretsiz
list_themes Tasarım kitlerini konu veya stile göre arar. GET /themes Ücretsiz
create_site Site üretimini başlatır ve üretim ücretini bakiyenizden alır. POST /sites Bakiye harcar
get_site Tek bir siteyi gösterir: ilerleme, önizleme ve indirme bağlantısı. GET /sites/{uuid} Ücretsiz
list_sites Sitelerinizi en yeniden eskiye listeler. GET /sites Ücretsiz

Bu dokümanı herhangi bir yapay zekâya verin

Bu sayfa düz Markdown olarak da vardır; bir sohbete yapıştırmak veya bir kodlama asistanına vermek için idealdir:

Markdown

https://whitepagekit.com/api/v1/docs.md

Yapıştırabileceğiniz bir istem

Prompt

You can build websites with the White Page Kit API. Read https://whitepagekit.com/api/v1/docs.md first.
My API key is in the environment variable WPK_API_KEY.
Check my balance and the price, then create a site for my dental clinic in Izmir, in Turkish,
wait until it is ready and send me the preview link.

Güvenlik ve maliyet

  • Yalnızca create_site bakiye harcar. Diğer beş araç sadece okur.
  • Asistanlar için ayrı bir anahtar kullanın. Panelde ona son kullanma tarihi ve hız sınırı verin, istediğiniz zaman iptal edin.
  • Asistanlar site silemez, ayarları değiştiremez ve ödemelere dokunamaz: bu rotalar araç olarak sunulmaz.
  • create_site için idempotency_key verin; yeniden deneme iki kez ücret almaz. Başarısız üretimler iade edilir.
  • Sayfa düzenleme, referans görselleri ve ZIP indirme REST API ve panelde kalır.

Hızlı başlangıç

Üç çağrı, bir brief’ten indirilebilir bir siteye götürür. YOUR_API_KEY yerine panelden aldığınız anahtarı yazın.

1. Üretimi başlatın

POST /sites brief’inizi doğrular, üretim ücretini bakiyenizden ayırır ve hemen yanıt verir.

curl

curl -X POST https://whitepagekit.com/api/v1/sites \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1042-attempt-1" \
  -d '{"title":"Alder House","lang":"en","sector":"guesthouse","keywords":"quiet stay, harbour","structure":"onepage"}'

Yanıt, yeni siteyle birlikte 202 Accepted’dır:

202 Accepted

{
  "success": true,
  "data": {
    "uuid": "550e8400-e29b-41d4-a716-446655440000",
    "status": "pending",
    "title": "Alder House",
    "lang": "en",
    "preview_url": null,
    "download_url": null
  }
}

2. Durumu sorgulayın

status done veya error olana kadar GET /sites/{uuid} adresini yaklaşık 5–20 saniyede bir sorgulayın ya da sorgulama yerine callback URL kullanın.

curl

curl https://whitepagekit.com/api/v1/sites/550e8400-e29b-41d4-a716-446655440000 \
  -H "X-API-Key: YOUR_API_KEY"

3. Dosyaları indirin

Tamamlanan site ZIP olarak iner. format multi veya onepage; assets inline veya external olabilir.

curl

curl -o site.zip \
  -H "X-API-Key: YOUR_API_KEY" \
  "https://whitepagekit.com/api/v1/sites/550e8400-e29b-41d4-a716-446655440000/download?format=multi&assets=inline"

Aynı akış kodla

PHP

<?php
$ch = curl_init('https://whitepagekit.com/api/v1/sites');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('WPK_API_KEY'),
        'Content-Type: application/json',
        'Idempotency-Key: order-1042-attempt-1',
    ],
    CURLOPT_POSTFIELDS => json_encode(['title' => 'Alder House', 'lang' => 'en']),
]);
$site = json_decode(curl_exec($ch), true)['data'];
do {
    sleep(5);
    $ch = curl_init('https://whitepagekit.com/api/v1/sites/' . $site['uuid']);
    curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('WPK_API_KEY')]]);
    $site = json_decode(curl_exec($ch), true)['data'];
} while ($site['status'] === 'pending');

Node.js

const headers = {
  Authorization: `Bearer ${process.env.WPK_API_KEY}`,
  'Content-Type': 'application/json',
  'Idempotency-Key': 'order-1042-attempt-1',
};
let { data: site } = await (await fetch('https://whitepagekit.com/api/v1/sites', {
  method: 'POST', headers,
  body: JSON.stringify({ title: 'Alder House', lang: 'en' }),
})).json();
while (site.status === 'pending') {
  await new Promise((r) => setTimeout(r, 5000));
  ({ data: site } = await (await fetch(`https://whitepagekit.com/api/v1/sites/${site.uuid}`, { headers })).json());
}

Python

import os, time, requests

headers = {"Authorization": f"Bearer {os.environ['WPK_API_KEY']}",
           "Idempotency-Key": "order-1042-attempt-1"}
site = requests.post("https://whitepagekit.com/api/v1/sites", headers=headers,
                     json={"title": "Alder House", "lang": "en"}).json()["data"]
while site["status"] == "pending":
    time.sleep(5)
    site = requests.get(f"https://whitepagekit.com/api/v1/sites/{site['uuid']}", headers=headers).json()["data"]

Kimlik doğrulama

OpenAPI belgesi dışındaki her istekte bir API anahtarı gönderin. Anahtarları sunucunuzda tutun; tarayıcı koduna veya URL’lere koymayın.

  • Başlık: Authorization: Bearer YOUR_API_KEY veya X-API-Key: YOUR_API_KEY.
  • Anahtarları panelden oluşturun, iptal edin ve hız sınırı verin. Anahtarların son kullanma tarihi ve IP izin listesi olabilir.
  • Yalnızca kendi sitelerinizi görürsünüz. Başka bir hesaba ait site 404 not_found döndürür.
  • Hata mesajlarını yerelleştirmek için ?lang=xx veya Accept-Language ekleyin.

Idempotency

POST /sites isteğinde Idempotency-Key gönderin (8–80 karakter: harf, rakam, _ ve -). Aynı anahtarı tekrarlamak özgün siteyi döndürür ve iki kez ücret almaz; böylece zaman aşımından sonra yeniden denemek güvenlidir. Başarısız bir üretimi yeniden denemek için yeni anahtar kullanın.

Webhook’lar (callback)

POST /sites isteğine callback_url verin (veya hesap webhook’u ayarlayın); iş bittiğinde (site.completed) veya başarısız olduğunda (site.failed) bir JSON POST alırsınız.

POST callback_url

{
  "event": "site.completed",
  "uuid": "550e8400-e29b-41d4-a716-446655440000",
  "status": "done",
  "site_title": "Alder House",
  "lang": "en",
  "domain": null,
  "created_at": "2026-01-15T09:30:00+00:00",
  "preview_url": "https://whitepagekit.com/preview?uuid=550e8400-…"
}

Hesapta webhook sırrı varsa her istek, ham gövdenin HMAC-SHA256 değeri olan X-Webhook-Signature: sha256=<hex> başlığını taşır. JSON’u ayrıştırmadan önce sabit zamanlı karşılaştırmayla doğrulayın:

PHP

$raw = file_get_contents('php://input');
$expected = 'sha256=' . hash_hmac('sha256', $raw, $webhookSecret);
if (!hash_equals($expected, $_SERVER['HTTP_X_WEBHOOK_SIGNATURE'] ?? '')) {
    http_response_code(401);
    exit;
}

Node.js

import crypto from 'node:crypto';

const expected = 'sha256=' + crypto
  .createHmac('sha256', webhookSecret).update(rawBody).digest('hex');
const received = req.get('x-webhook-signature') ?? '';
const ok = received.length === expected.length
  && crypto.timingSafeEqual(Buffer.from(received), Buffer.from(expected));

Her callback 10 saniyelik zaman aşımıyla bir kez denenir ve yeniden gönderilmez. Bunu bir bildirim sayın ve GET /sites/{uuid} ile eşleştirin. Tekrarları uuid ve event ile idempotent işleyin. Özel ağ hedefleri reddedilir.

Hatalar

Her yanıt bir zarf kullanır. Hatalar kararlı bir kod, yerelleştirilmiş bir mesaj ve doğrulama hatalarında hatalı alanı taşır.

JSON

{
  "success": false,
  "error": {
    "code": "validation_error",
    "message": "...",
    "details": { "field": "title" }
  }
}
Hatalar
HTTPHata kodları
400 validation_error, invalid_json, invalid_webhook_url
401 missing_api_key
402 insufficient_balance
403 api_disabled, invalid_api_key, forbidden
404 not_found, route_not_found
405 method_not_allowed
409 site_not_ready, conflict, edits_reset_required
413 payload_too_large
415 unsupported_media_type
429 rate_limited
500 internal_error, export_failed
502 generation_failed

Sınırlar

Sınırlar
Sınır Değer
Anahtar başına istek Varsayılan dakikada 60 (anahtar başına ayarlanır, 0 = sınırsız). Aynı IP’den tekrarlanan geçersiz anahtarlar Retry-After ile 429 alır.
İstek gövdesi 2 MB; referans görselli POST /sites en çok 162 MB; editör kayıtları en çok 4 MB.
Referans görseller En çok 12 PNG, JPEG veya WEBP görsel (base64 veya data URL), her biri en çok 10 MB.
Editör sayfa içeriği HTML en çok 500.000 karakter, CSS en çok 100.000. Betikler ve olay işleyicileri kaldırılır.
Site görselleri PNG, JPEG, WEBP veya GIF, her biri 5 MB, site başına en çok 200.
Site başlığı Site başlığı 1–200 karakter.

Editör API

Panel editörünün yaptığı her şey tamamlanmış siteleriniz için kullanılabilir: sayfa içeriği, sayfa ve bölüm planı, stil, başlık/tema/yerleşim/yapı, takip ve görseller. Sayfa düzenlemeleri sayfayı değiştirir; DELETE üretilen sayfayı geri yükler.

curl

# Load, change and save a page
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://whitepagekit.com/api/v1/sites/UUID/editor?page=index"
curl -X PATCH https://whitepagekit.com/api/v1/sites/UUID/editor \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"index","html":"<main>…</main>","css":""}'
# Restore the generated page
curl -X DELETE -H "X-API-Key: YOUR_API_KEY" \
  "https://whitepagekit.com/api/v1/sites/UUID/editor?page=index"

Düzenleme tamamlanmış bir site gerektirir (aksi halde 409 site_not_ready). Düzenlenmiş sayfaların üzerinde tema, yerleşim veya yapı değiştirmek, reset_edits true değilse 409 edits_reset_required döndürür. Düzenleme ücretsizdir.

Uç nokta başvurusu

OpenAPI belgesinden üretilir, bu yüzden canlı API ile her zaman uyumludur. Yollar taban URL’ye göredir.

Hesap

  • GET /me

    Get the authenticated account

  • GET /transactions

    List account balance transactions

Katalog

  • GET /languages

    List enabled supported languages

  • GET /themes

    List site themes

  • GET /layouts

    List enabled layouts

Siteler

  • GET /sites

    List the authenticated account's sites

  • POST /sites

    Start site generation

  • GET /sites/{uuid}

    Get site status and refresh generation state

  • DELETE /sites/{uuid}

    Delete a terminal site and its generated data — Pending, queued and running generation jobs cannot be deleted. Wait for done or error; active deletion returns 409 conflict without refunding or removing the job.

  • GET /sites/{uuid}/download

    Download a completed site archive

Yapay zekâ ve otomasyon

  • GET /ai-tools

    Function-calling tool schemas — The same six tools the MCP endpoint offers, as JSON schemas for your own tool loop. format is openai (Responses API), openai-chat (Chat Completions), anthropic or mcp. Public; no response envelope.

  • GET /docs.md

    Documentation as Markdown — The developer guide, endpoint reference and AI integration guide as one Markdown file, written for language models and quick copy-paste. Public.

  • POST /mcp

    Model Context Protocol endpoint — MCP over Streamable HTTP (JSON-RPC 2.0, one JSON reply per POST). Methods: initialize, ping, tools/list, tools/call. Tools: get_account, list_languages, list_themes, create_site (paid), get_site, list_sites. Authenticate with the same API key; point an MCP client at this URL.

Editör

  • GET /sites/{uuid}/editor

    Load a page for editing — Editor access for the site owner's API key; mirrors the dashboard editor. Only completed sites (409 site_not_ready otherwise).

  • PATCH /sites/{uuid}/editor

    Save a page's edited content — Replaces the page content and CSS. html must be non-empty (use DELETE to restore the generated page); scripts, event handlers and javascript: URLs are removed, HTML is limited to 500000 and CSS to 100000 characters, request body to 4 MB. Returns the saved page as GET does.

  • DELETE /sites/{uuid}/editor

    Restore a page's generated content — Discards the page's saved edits. Returns the regenerated page.

  • GET /sites/{uuid}/editor/canvas

    Get editing canvas data — Stylesheet, Tailwind theme, body class, direction, section blocks, icons and sample copy an external visual editor needs to render the page like the dashboard editor.

  • GET /sites/{uuid}/pages

    Get the page and section plan — Returns structure, pages with their sections and edited flag, one-page sections and the sections available to add. Same payload as the dashboard.

  • POST /sites/{uuid}/pages

    Save the page and section plan — Body: pages (list of {slug, title, nav, sections}; the first page is index) and, for onepage sites, onepage_sections. Sections of pages with saved edits are locked in the dashboard; edited pages that are removed lose their edits. At most 12 pages.

  • GET /sites/{uuid}/style

    Get style overrides — Returns stored overrides, effective colors, fonts, radius and density, and the allowed font, radius and density values.

  • POST /sites/{uuid}/style

    Save or reset style overrides — Send style ({colors, fonts: {heading, body}, radius, density}) or reset=true to return to the theme.

  • GET /sites/{uuid}/design

    Get site title, theme and layout — Returns site_title, title_suggestions, theme_variant, theme_mode, layout, structure and whether the site has saved edits.

  • POST /sites/{uuid}/design

    Change site title, theme, mode, layout or structure — theme_variant, theme_mode, layout and structure are required; site_title (1-200 characters), apply_blueprint and reset_edits are optional. Changing theme, layout or structure while pages have saved edits returns 409 edits_reset_required unless reset_edits is true; renaming alone keeps edits.

  • GET /sites/{uuid}/tracking

    Get tracking settings

  • POST /sites/{uuid}/tracking

    Save tracking settings — Body: tracking {ga4_measurement_id, google_ads_id, google_ads_conversion_label, meta_pixel_id, privacy_policy_url, terms_url}. Applied to exports; an empty object removes all tracking.

  • GET /sites/{uuid}/media

    List uploaded site images

  • POST /sites/{uuid}/media

    Upload or delete site images — multipart/form-data with one or more files in files[] (PNG, JPEG, WEBP or GIF, 5 MB each, at most 200 images per site), or JSON {"action": "delete", "name": <name>}. Returns the updated list for uploads. 409 conflict when the per-site image limit is reached.

Harici ödemeler (yalnız yönetici anahtarları)

  • GET /payment-sites

    List external payment sites owned by the admin API account — Admin role required; payment.manage permission alone is insufficient. Webhook secrets are never returned.

  • POST /payment-sites

    Register an external payment site (admin only)

  • PATCH /payment-sites/{id}

    Update an owned external payment site (admin only)

  • DELETE /payment-sites/{id}

    Delete an owned external payment site (admin only) — Deletion is allowed only when the site has no orders. Sites with orders must be disabled instead.

  • GET /payments

    List external orders owned by the admin API account

  • POST /payments

    Create external checkout or automatic subscription (admin only) — Server-to-server only. Separate from wallet top-ups: no White Page Kit balance, bonus or referral credit. Repeated idempotency key returns the original order; a different payload or reused external order ID conflicts. Provider uncertainty never starts a second checkout automatically.

  • GET /payments/{uuid}

    Read owned external payment status (admin only)

  • POST /payments/{uuid}/cancel

    Cancel an owned subscription or locally close a pending one-time order (admin only) — Subscriptions stop future renewals. Pending one-time cancellation is a local close, not a refund; an already-open provider checkout may still accept payment. A late authenticated real payment remains recorded and notified. No payment is marked paid by a browser return.

  • POST /payments/{uuid}/approve

    Approve funds received for an owned pending or locally cancelled bank transfer (admin only) — Manual confirmation of funds received, including a transfer arriving after local cancellation; never approves a Dodo or Enigmoss order and never credits White Page Kit balance.

Açıklamalar OpenAPI belgesinden gelir ve İngilizcedir. İstek ve yanıt şemaları şema dosyasındadır.

Hazır entegrasyonlar

Entegrasyon kiti; üretim formu, durum sorgulama, imzalı callback rehberi ve bu API ile sunucu tarafı proxy üzerinden konuşan tam bir görsel editör içeren küçük bir PHP uygulamasıdır. Anahtar almak için hesap oluşturun, her üretimin maliyeti için fiyatlandırmaya bakın.