# Mulai cepat

:::tip[Pakai asisten AI?]
Anda tidak perlu langkah ini: [hubungkan MCP server](/id/agents/mcp/) lalu minta asisten menjadwalkan post-nya.
:::

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.

   ```sh
   export POSTFLOW_API_KEY=pf_...
   ```

2. **Cek workspace.** `/me` mengembalikan nama, zona waktu dan paket.

   ```sh
   curl https://postflow.biz.id/api/v1/me \
     -H "Authorization: Bearer $POSTFLOW_API_KEY"
   ```

   ```json
   {
     "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.

   ```sh
   curl https://postflow.biz.id/api/v1/accounts \
     -H "Authorization: Bearer $POSTFLOW_API_KEY"
   ```

   ```json
   [
     { "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](/id/guides/media/#upload-file).)

   ```sh
   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`](/api/operations/validatepost/): body-nya sama.

   ```sh
   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.

## Selanjutnya

- Belum tahu jamnya? Kirim `"useNextSlot": true` sebagai ganti `scheduledAt` untuk memakai [antrean](/id/guides/posts/#slot-antrean).
- Ingin tahu saat post tayang: tambahkan [webhook](/id/guides/webhooks/) untuk `post.published`.
- Semua yang bisa dibawa sebuah post: [Membuat dan menjadwalkan post](/id/guides/posts/).