# Kampanye

Daftar kampanye dan detailnya.

## Daftar kampanye

`GET /v1/campaigns`

Butuh scope `campaigns:read`.

| Parameter | Tipe | Isi |
| --- | --- | --- |
| `status` | string | `draft`, `pending_review`, `active`, `budget_depleted`, `paused`, `ended`, `rejected`, atau `cancelled` |
| `limit` | integer | Baris per halaman, 1 sampai 100, bawaan 50 |
| `cursor` | string | `next_cursor` dari halaman sebelumnya |

```bash
curl "https://api.wefluence.app/v1/campaigns?status=active" \
  -H "Authorization: Bearer $WEFLUENCE_API_KEY"
```
```python
requests.get(f"{API}/campaigns", headers=HEADERS, params={"status": "active"}).json()
```
```javascript
await (await fetch(`${API}/campaigns?status=active`, { headers })).json();
```
```json
{
  "object": "list",
  "data": [
    {
      "id": "abc123",
      "title": "Kampanye Oktober",
      "status": "active",
      "type": "clip_brand",
      "pricing": { "model": "per_views", "rate_per_1000_views": 5000 },
      "budget": 5000000,
      "payment_status": "paid",
      "target_platforms": ["TikTok"],
      "deadline": "2026-11-30T16:59:59.000Z",
      "created_at": "2026-10-01T03:00:00.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "as_of": "2026-11-02T09:00:00.000Z"
}
```
## Detail kampanye

`GET /v1/campaigns/{id}`

Butuh scope `campaigns:read`. Isinya sama dengan baris di daftar, ditambah kolom berikut.

| Kolom | Tipe | Isi |
| --- | --- | --- |
| `description` | string | Deskripsi kampanye |
| `brief` | string | Brief untuk kreator |
| `rules` | array | Aturan kampanye |
| `approval` | string | `auto` atau `manual` |
| `is_private` | boolean | Kampanye privat |
| `reference_video` | string atau null | Link video contoh |

```bash
curl https://api.wefluence.app/v1/campaigns/abc123 \
  -H "Authorization: Bearer $WEFLUENCE_API_KEY"
```
```python
requests.get(f"{API}/campaigns/abc123", headers=HEADERS).json()
```
```javascript
await (await fetch(`${API}/campaigns/abc123`, { headers })).json();
```
