API referansı
Bütün uçlar, programının gerçekten göreceği gövdelerle.
Temel adres: https://api.afilipost.com · Makine tarafından okunur şema: openapi.json
GET /v1/accounts
Çalışma alanına bağlı hesaplar. ?platform=instagram ile süzülür.
Yanıt
{
"accounts": [
{
"_id": "8b1e…7d",
"platform": "instagram",
"username": "afilipost",
"displayName": "Afilipost",
"isActive": true,
"status": "ok",
"profileId": { "_id": "0a4c…19" }
}
]
} POST /v1/media/presign
İmzalı bir yükleme adresi ister; dosyayı doğrudan depoya PUT edersin.
İstek
{
"filename": "reel.mp4",
"contentType": "video/mp4",
"size": 18432000
} Yanıt
{
"mediaId": "3d90…aa",
"uploadUrl": "https://…", // buraya PUT
"publicUrl": "https://cdn.afilipost.com/…mp4",
"expiresIn": 3600,
"contentType": "video/mp4"
} Baytlar API sunucusundan hiç geçmez. İmzalı adres bir saat geçerlidir; süre dolduğunda devam eden bir aktarım kesilmez.
POST /v1/posts
Gönderi oluşturur veya planlar. Bir gönderi aynı anda birden çok hesaba gidebilir.
İstek
{
"content": "Today's repo: a terminal file manager.",
"mediaItems": [
{ "type": "video",
"url": "https://cdn.afilipost.com/…mp4",
"filename": "reel.mp4",
"mimeType": "video/mp4" }
],
"platforms": [
{ "platform": "instagram",
"accountId": "8b1e…7d",
"platformSpecificData": {
"shareToFeed": true,
"firstComment": "Comment REPO for the link"
} }
],
"scheduledFor": "2026-08-24T19:40:00.000Z",
"timezone": "UTC",
"idempotencyKey": "repo-4192-tr"
} Yanıt
{
"post": {
"_id": "0f7a…42",
"status": "scheduled",
"scheduledFor": "2026-08-24T19:40:00.000Z",
"platforms": [
{ "platform": "instagram",
"accountId": "8b1e…7d",
"status": "scheduled",
"platformPostId": null }
]
}
} idempotencyKey gönderirsen tekrarlanan istek ikinci gönderi açmaz. İki ek özellik: scheduledFor düz "auto" olabilir — saati sunucu, kanalın ritminden seçer (aralık, günlük tavan, gündüz penceresi, çakışma tamponu; API anahtarı başına yalıtılmış); ve chain dizisi yayın SONRASI adımlar bağlar: [{kind:"crossPost", afterMinutes:5, accountIds:[…]}] aynı içeriği yayından 5 dk sonra başka hesaplara atar, [{kind:"followUp", …, content, mediaItems}] yeni içerik yayınlar.
GET /v1/posts
Gönderileri listeler. ?status=scheduled&accountId=…&limit=200 ile süzülür.
Yanıt
{ "posts": [ { "_id": "0f7a…42", "status": "scheduled", … } ] } Kendi kuyruğunu seyreltmek için: bir sonraki saati seçmeden önce o hesapta ne planlı olduğunu oku.
GET /v1/posts/{id}
Tek gönderi ve hedef bazlı durumu.
Yanıt
{
"post": {
"_id": "0f7a…42",
"status": "published",
"platforms": [
{ "platform": "instagram",
"status": "published",
"platformPostId": "17912…04",
"permalink": "https://www.instagram.com/p/…",
"publishedAt": "2026-08-24T19:40:12.000Z" }
]
}
} platformPostId, gönderi gerçekten yayınlanana kadar null'dur. Yorum otomasyonu buna ihtiyaç duyar; kural kurmadan önce burayı yokla.
POST /v1/comment-automations
Yayınlanmış bir gönderiye anahtar kelime → DM kuralı bağlar.
İstek
{
"accountId": "8b1e…7d",
"platformPostId": "17912…04",
"name": "Repo link — TR",
"keywords": ["repo", "link", "edit"],
"matchMode": "contains",
"typoTolerance": true,
"commentReply": "Sent it to your DMs 📩",
"dmMessage": "Here's the link. Follow for a new one daily.",
"buttons": [
{ "type": "url", "title": "Open repo",
"url": "https://github.com/…" }
],
"followGate": {
"message": "Follow first, then tap below 👇",
"buttonLabel": "I'm following"
}
} Yanıt
201 { "ok": true } Yalnızca Instagram, ve gönderi yayında olmalı. Aynı gönderi için ikinci kez çağırmak hata değildir; existing: true ile 200 döner. followGate gönderirsen link bir butonun arkasında bekletilir: butona basıldığında Meta'nın is_user_follow_business alanı okunur ve link yalnızca takip edene verilir. Meta bu alanı döndürmezse link yine gönderilir — gerçek bir takipçi kapıda bekletilmez.