API Dokümantasyonu
Panelin yapabildiği her şey API'den de yapılabilir: site bağla, plan çıkar, makale üret, düzenle, yayınla, WP yönet. Kendi altyapına içerik beslemek için webhook veya çekme (pull) kullan.
Hızlı başlangıç
# 1) Panel → Hesap → API erişimi → token oluştur (fbk_...) # 2) Tüm istekler: curl https://app.fatbotter.com/api/autopilot/articles \ -H "Authorization: Bearer fbk_xxxxxxxx" # Tek konuyu üretip yayınlat: curl -X POST https://app.fatbotter.com/api/autopilot/items/ITEM_ID/run \ -H "Authorization: Bearer fbk_xxxxxxxx"
Temel adres: https://app.fatbotter.com/api · Tüm gövdeler JSON (Content-Type: application/json), yalnızca /uploads multipart kabul eder. Hatalar: { "message": "...", "statusCode": 4xx } · 402 = kredi yetersiz, 403 = BYOK kota/lisans.
Kimlik doğrulama
Panel → Hesap → "API erişimi" bölümünden kişisel token oluştur (fbk_...). Token oluşturma anında bir kez gösterilir. Her isteğe şu başlığı ekle: Authorization: Bearer fbk_xxx
/auth/meHesap bilgisi ve bakiye
Yanıt
{ "id": "...", "email": "...", "billingMode": "CREDITS", "creditBalance": "481.19" }Siteler
/sitesBağlı siteleri listele
Yanıt
[{ "id": "site_id", "url": "https://...", "platform": "wordpress", "status": "CONNECTED" }]/sitesWordPress sitesi bağla (bağlantı anında doğrulanır)
İstek gövdesi
{ "url": "https://siteniz.com", "wpUsername": "admin", "wpAppPassword": "xxxx xxxx xxxx xxxx", "businessContext": "Antalya'da kamp ve bungalov tesisi..." }💡 wpAppPassword: WP panelinde Kullanıcılar → Profil → Uygulama Şifreleri bölümünden alınır.
/platforms/xenforo/connectXenForo forumu bağla
İstek gövdesi
{ "url": "https://forum.siteniz.com", "apiKey": "XF-Api-Key değeri", "forumUserId": 1, "businessContext": "..." }Yanıt
{ "id": "site_id", "forums": [{ "id": 5, "title": "Genel" }] }💡 Dönen forums listesinden hedef forumu POST /platforms/xenforo/{siteId}/node ile ({ "nodeId": 5 }) kaydet.
/platforms/custom/connectÖzel altyapı bağla (webhook + API ile çekme)
İstek gövdesi
{ "url": "https://siteniz.com", "webhookUrl": "https://siteniz.com/fatbotter-hook", "businessContext": "..." }Yanıt
{ "id": "site_id", "webhookSecret": "fbs_..." }💡 webhookSecret bir kez gösterilir. Makale yayınlandığında webhookUrl adresine imzalı JSON POST edilir.
💡 İmza doğrulama: X-FatBotter-Signature başlığı = HMAC-SHA256(ham istek gövdesi, webhookSecret) hex.
💡 webhookUrl vermezsen makaleleri GET /autopilot/articles ile çekersin.
/sites/{siteId}/syncWP sitesindeki mevcut tüm yazıları envantere tara
Yanıt
{ "synced": 42 }/sites/{siteId}/postsTaranan içerik envanteri (kelime sayısı, iyileştirme durumu)
/sites/posts/{postId}/improveEski yazıya AI iyileştirme önerisi üret (kredi düşer, 1-3 dk)
/sites/posts/{postId}/applyOnaylanan iyileştirmeyi WP'deki yazıya uygula
/sites/{siteId}/chatSite ajanıyla konuş
İstek gövdesi
{ "message": "Bu ay hangi konulara odaklanalım?" }Yanıt
{ "reply": "...", "briefUpdated": true }Otopilot — plan ve üretim
/autopilot/plansGerçek Keyword Planner verisiyle içerik planı çıkar (1-2 dk sürer)
İstek gövdesi
{ "siteId": "site_id", "articleCount": 20, "cadencePerWeek": 2 }Yanıt
{ "id": "plan_id", "status": "DRAFT", "items": [{ "id": "item_id", "title": "...", "targetKeyword": "...", "monthlyVolume": 480, "competition": "LOW" }] }/autopilot/plansPlanları listele
/autopilot/plans/{planId}Plan detayı (konular + durumlar + makale linkleri)
/autopilot/plans/{planId}/approvePlanı onayla — Otopilot takvime göre üretmeye başlar
/autopilot/plans/{planId}/pauseOtopilotu duraklat
/autopilot/items/{itemId}/runTek konuyu HEMEN uçtan uca işlet: üret + görsel doğrula + yayınla (2-5 dk)
Yanıt
{ "articleId": "...", "url": "https://siteniz.com/yazi-slug/" }/autopilot/report30 günlük özet + günlük seri (üretilen, yayınlanan, kredi)
Makaleler
/autopilot/articlesTüm makaleleri listele (durum, yayın URL'si dahil)
/autopilot/articles/{articleId}Makale detayı: tam HTML, SEO alanları, görseller, üretim maliyeti
/autopilot/articles/{articleId}Makaleyi düzenle — yayındaysa hedef platformda da güncellenir
İstek gövdesi
{ "title": "...", "html": "<h2>...</h2>", "seoTitle": "50-70 karakter", "seoDesc": "150-160 karakter" }Yanıt
{ ..., "wpUpdated": true }Dosya yükleme ve medya
Makale içi görseller için: önce yükle, dönen URL'yi HTML'de <img src> olarak kullan. Editördeki "Görsel yükle" butonu da bu ucu kullanır.
/uploadsGörsel yükle (multipart/form-data, alan adı: file, max 15 MB). Otomatik webp'ye çevrilir (max 1600px).
Yanıt
{ "url": "/api/media/uploads/1753...abc.webp", "fileName": "...", "bytes": 84210 }💡 curl örneği: curl -X POST https://app.fatbotter.com/api/uploads -H "Authorization: Bearer fbk_xxx" -F "[email protected]"
/media/{yol}Yüklenen görselleri servis eder (herkese açık, 1 yıl cache).
WordPress yönetimi
Bağlı WP sitesinin tüm yönetimi (canlı proxy — veriler WP'den anlık okunur/yazılır).
/sites/{siteId}/wp/categoriesKategoriler · POST ile yeni ekle: { "name": "..." }
/sites/{siteId}/wp/tagsEtiketler · POST ile yeni ekle
/sites/{siteId}/wp/comments?status=holdYorumlar (hold | approved | spam)
/sites/{siteId}/wp/comments/{commentId}Yorum moderasyonu
İstek gövdesi
{ "status": "approved" } // approved | hold | spam | trash/sites/{siteId}/wp/pagesSayfalar · POST ile oluştur: { "title", "content", "status" }
/sites/{siteId}/wp/mediaMedya kütüphanesi · DELETE /media/{id} ile sil
/sites/{siteId}/wp/settingsSite ayarları · POST ile güncelle: { "title", "description" }
Krediler ve faturalama
/billing/balanceBakiye + plan (CREDITS / BYOK_MONTHLY / BYOK_YEARLY) + BYOK kotası
/billing/packagesPaket fiyatları — BYOK aylık/yıllık + makale başı model fiyatları
/billing/transactionsKredi hareketleri (son 100)
/billing/topupKredi yükleme — PayTR ödeme token'ı döner
İstek gövdesi
{ "amountTry": 500 }/billing/licenseBYOK paketi satın al — PayTR ödeme token'ı döner
İstek gövdesi
{ "kind": "BYOK_MONTHLY" } // BYOK_MONTHLY | BYOK_YEARLY/tokensAPI token'larını listele · POST { "name": "..." } ile oluştur · DELETE /tokens/{id} ile iptal et
Webhook formatı (Özel platform)
Makale yayınlandığında webhook adresine POST edilir. İmzayı mutlaka doğrula:
// Gelen istek
POST https://siteniz.com/fatbotter-hook
X-FatBotter-Signature: 3f2a... (HMAC-SHA256 hex)
{
"event": "article.published",
"article": {
"id": "...", "title": "...", "slug": "...",
"html": "<h2>...</h2>...",
"seoTitle": "...", "seoDesc": "...", "excerpt": "...", "tags": "a, b, c",
"heroImage": { "fileName": "slug.webp", "alt": "...", "base64": "..." }
}
}
// Node.js doğrulama örneği
const crypto = require('crypto');
const expected = crypto.createHmac('sha256', WEBHOOK_SECRET)
.update(rawBody).digest('hex');
if (expected !== req.headers['x-fatbotter-signature']) return res.status(401).end();