Lewati ke konten

Mulai cepat

Dari API key baru sampai post terjadwal dalam lima request.

  1. Buat key. Di PostFlow, buka Settings → Integrations → API & MCP, beri nama key (n8n, skrip-saya), biarkan Full access terpilih lalu buat. Salin sekarang: key hanya ditampilkan sekali.

    Terminal window
    export POSTFLOW_API_KEY=pf_...
  2. Cek workspace. /me mengembalikan nama, zona waktu dan paket.

    Terminal window
    curl https://postflow.biz.id/api/v1/me \
    -H "Authorization: Bearer $POSTFLOW_API_KEY"
    {
    "workspace": { "id": "ws_…", "name": "Kopi Senja", "timezone": "Asia/Jakarta", "approvalRequired": false },
    "subscription": { "status": "active", "plan": "Starter", "endsAt": "2026-11-30T16:59:59.000Z" },
    "limits": { "workspaces": 1, "socialAccounts": 3, "postsPerMonth": 60, "members": 1, "storageBytes": 2147483648 },
    "member": { "id": "u_…", "name": "Rani", "role": "owner" },
    "credential": { "type": "api_key", "name": "skrip-saya", "scope": "write" }
    }
  3. Lihat daftar akun. Tiap akun menyebutkan content type yang bisa diterbitkannya.

    Terminal window
    curl https://postflow.biz.id/api/v1/accounts \
    -H "Authorization: Bearer $POSTFLOW_API_KEY"
    [
    { "id": "acc_ig", "platform": "instagram", "name": "Kopi Senja", "username": "kopisenja", "avatarUrl": null,
    "status": "active", "error": null, "contentTypes": ["ig_image", "ig_carousel", "ig_reel", "ig_story"] }
    ]
  4. Masukkan foto. PostFlow mengunduhnya dari URL https:// publik dan mengembalikan id-nya. (Atau upload byte-nya.)

    Terminal window
    curl https://postflow.biz.id/api/v1/media \
    -H "Authorization: Bearer $POSTFLOW_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "url": "https://example.com/promo-oktober.jpg" }'
  5. Jadwalkan post. Satu target per akun, dengan content type yang didukung akun itu. Kalau mau, cek dulu dengan POST /posts/validate: body-nya sama.

    Terminal window
    curl https://postflow.biz.id/api/v1/posts \
    -H "Authorization: Bearer $POSTFLOW_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "caption": "Es kopi gula aren, diskon 20% sampai Minggu ☕",
    "mediaIds": ["MEDIA_ID"],
    "targets": [{ "socialAccountId": "acc_ig", "contentType": "ig_image", "options": { "firstComment": "#kopi #promo" } }],
    "action": "schedule",
    "scheduledAt": "2026-11-03T09:00:00+07:00"
    }'

    Respons berisi post dengan status: "scheduled". Post langsung muncul di kalender PostFlow.

  • Belum tahu jamnya? Kirim "useNextSlot": true sebagai ganti scheduledAt untuk memakai antrean.
  • Ingin tahu saat post tayang: tambahkan webhook untuk post.published.
  • Semua yang bisa dibawa sebuah post: Membuat dan menjadwalkan post.