API Requester
Buat campaign, tarik hasil, dan terima notifikasi otomatis secara programatik. Cocok untuk otomasi, integrasi pipeline data, atau tool internal.
Kelola API key & webhook di dashboardAutentikasi
Setiap request wajib menyertakan API key kamu di header Authorization. Buat key di dashboard — key hanya ditampilkan sekali. Perlakukan seperti password.
Authorization: Bearer flvt_ab12cd34ef56_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxKonvensi
- Base URL: domain platform kamu, mis.
https://flavetask.com - Semua body & respons berupa JSON (Content-Type: application/json).
- Nilai uang dalam unit minor & dikirim sebagai string: IDR 1 = Rp1; USDT 1.000.000 = $1.
- reward pada create campaign memakai satuan tampilan (mis. "5000" = Rp5.000).
Endpoint
/api/v1/campaignsWajib: title, category, currency, reward, positions. Opsional: instruction, estMinutes, proofType, items[] (dataset), consensusCount (1–5), dll.
curl -X POST https://flavetask.com/api/v1/campaigns \
-H "Authorization: Bearer $FLAVETASK_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Label 100 foto produk",
"category": "IMAGE_TAG",
"currency": "IDR",
"reward": "1000",
"positions": 100,
"instruction": "Pilih kategori yang paling cocok untuk tiap foto.",
"estMinutes": 2
}'{
"campaign": {
"id": "cmr1gv...",
"title": "Label 100 foto produk",
"currency": "IDR",
"rewardPerPosition": "1000",
"feePerPosition": "100",
"positions": 100,
"taken": 0,
"approvedCount": 0,
"totalCost": "110000",
"status": "ACTIVE",
"hasDataset": false,
"createdAt": "2026-07-03T..."
}
}/api/v1/campaigns (dataset + konsensus)Kirim items[] agar tiap worker dapat 1 item unik. isGold + goldAnswer = item kontrol (auto-cek). consensusCount = jumlah worker per item; positions dihitung otomatis (item × konsensus).
{
"title": "Sentimen 3 ulasan",
"category": "AI_TRAIN",
"currency": "IDR",
"reward": "500",
"positions": 1,
"consensusCount": 3,
"items": [
{ "payload": "Barang bagus, cepat sampai" },
{ "payload": "Kecewa, tidak sesuai" },
{ "payload": "Apa ibukota Indonesia?", "isGold": true, "goldAnswer": "Jakarta" }
]
}/api/v1/campaignscurl https://flavetask.com/api/v1/campaigns -H "Authorization: Bearer $FLAVETASK_KEY"/api/v1/campaigns/:idTermasuk description, instruction, taken, approvedCount, status.
/api/v1/campaigns/:id/results{
"count": 2,
"results": [
{ "worker": "Budi", "country": "ID", "item": 4,
"fileUrl": null, "submittedAt": "2026-07-03T...",
"answers": { "jawaban": "positif" } }
]
}/api/v1/campaigns/:id/itemsHanya untuk campaign dataset. finalAnswer = majority vote; agreement 0–1; disputed = perlu ditinjau.
{
"consensusCount": 3, "total": 3, "resolved": 3, "disputed": 0,
"items": [
{ "item": 1, "payload": "Barang bagus...", "control": false,
"status": "RESOLVED", "answers": 3,
"finalAnswer": "positif", "agreement": 1, "disputed": false }
]
}/api/v1/campaigns/:id/closeEscrow untuk posisi yang belum disetujui dikembalikan ke saldomu.
Webhook
Set URL webhook di dashboard. Saat campaign selesai (semua posisi disetujui atau ditutup), kami kirim POST ber-signature. Verifikasi header x-flavetask-signature dengan HMAC-SHA256 dari raw body memakai signing secret-mu.
POST <your-webhook-url>
x-flavetask-event: campaign.completed
x-flavetask-signature: sha256=<hex>
{
"event": "campaign.completed",
"sentAt": "2026-07-03T...",
"data": {
"campaignId": "cmr1gv...", "title": "Label 100 foto produk",
"positions": 100, "approved": 100, "currency": "IDR",
"rewardPerPosition": "1000", "completedAt": "2026-07-03T...",
"resultsUrl": "/api/v1/campaigns/cmr1gv.../results"
}
}Contoh verifikasi (Node.js / Express):
import crypto from "crypto";
app.post("/webhooks/flavetask",
express.raw({ type: "application/json" }), (req, res) => {
const sig = req.get("x-flavetask-signature") || "";
const expected = "sha256=" + crypto
.createHmac("sha256", process.env.FLAVETASK_WEBHOOK_SECRET)
.update(req.body) // raw body (Buffer), bukan yang sudah di-parse
.digest("hex");
const ok = sig.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected));
if (!ok) return res.sendStatus(401);
const event = JSON.parse(req.body.toString());
// ... proses event.data ...
res.sendStatus(200);
});Kode Error
| Status | Arti |
|---|---|
| 401 | API key tak ada / salah / dicabut |
| 403 | Bukan requester, atau fitur dinonaktifkan admin |
| 404 | Campaign tak ditemukan / bukan milikmu |
| 413 | Body terlalu besar (maks 8 MB) |
| 422 | Validasi gagal (cek pesan error) |
| 503 | Platform sedang pemeliharaan |
Body error: { "error": "pesan" }
Batas
- Ukuran body maksimum: 8 MB.
- Dataset: maksimum 5.000 item per campaign.
- Konsensus: 1–5 worker per item.
- Batas reward minimum & posisi per campaign diatur admin platform.