# Wefluence API Pull campaigns, content, and creator views into your dashboard, database, spreadsheet, or AI assistant. REST and MCP, one key. ```bash curl https://api.wefluence.app/v1/campaigns \ -H "Authorization: Bearer $WEFLUENCE_API_KEY" ``` ```python import os, requests r = requests.get( "https://api.wefluence.app/v1/campaigns", headers={"Authorization": f"Bearer {os.environ['WEFLUENCE_API_KEY']}"}, ) print(r.json()) ``` ```javascript const res = await fetch("https://api.wefluence.app/v1/campaigns", { headers: { Authorization: `Bearer ${process.env.WEFLUENCE_API_KEY}` }, }); console.log(await res.json()); ``` ## Start here - [Quickstart](https://docs.wefluence.app/en/quickstart/): Make your first API call in 5 minutes. - [Keys and authentication](https://docs.wefluence.app/en/authentication/): Get a key and control what it can read. - [API reference](https://docs.wefluence.app/en/reference/): Every endpoint, parameter, and example response. ## What you can build - [Automatic daily reports](https://docs.wefluence.app/en/guides/daily-sync/): Pull content and views into your database every day. - [Google Sheets](https://docs.wefluence.app/en/guides/google-sheets/): Fill a spreadsheet without running a server. - [AI assistants](https://docs.wefluence.app/en/guides/ai-assistants/): Ask about your campaigns from the assistant you already use. ## Available data | Data | Contents | Reference | | --- | --- | --- | | Campaigns | Status, rate, budget, deadline | [Campaigns](https://docs.wefluence.app/en/reference/campaigns/) | | Summary | Content count, views, and cost per campaign | [Campaign stats](https://docs.wefluence.app/en/reference/campaign-stats/) | | Content | Link, platform, status, views, and engagement | [Content](https://docs.wefluence.app/en/reference/content/) | | Creators | Approved content, views, and amount paid | [Creators](https://docs.wefluence.app/en/reference/creators/) | | Invoices | Number, status, and line items | [Invoices](https://docs.wefluence.app/en/reference/invoices/) | For now the API only reads data. Creating campaigns, paying, and reviewing content happen in the Wefluence app. ## Frequently asked questions ### What is the Wefluence API? A read-only REST API and MCP server that pulls campaign, content, creator, and invoice data from one Wefluence brand account into a dashboard, database, spreadsheet, or AI assistant. ### Can the API create campaigns or make payments? Not yet. For now the API only reads data. Creating campaigns, paying, and reviewing content happen in the Wefluence app. ### How do I get an API key? Open **Settings**, then **API key** in the Wefluence app. A key is shown only once, is valid for 12 months, and one account can have up to 5 active keys. ### Can I use it from an AI assistant? Yes. Claude, Cursor, VS Code, and other tools that support remote MCP servers can connect to `https://api.wefluence.app/v1/mcp` with the same key. See [AI assistants](https://docs.wefluence.app/en/guides/ai-assistants/). ### What are the rate limits? 60 calls per minute and 5,000 calls per day for each key. The daily quota resets at 00:00 Western Indonesia Time (UTC+7). ### Are views real time? No. The API returns verified views, the same numbers as the Performance page in the app. They change when content is verified again. --- # Quickstart Call the Wefluence API for the first time in 5 minutes. ## Get a key In the Wefluence app, open **Settings** (Pengaturan), then **API key**, and create a new key. Tick the permissions you need. The key is shown only once, so save it as an environment variable right away. ```bash export WEFLUENCE_API_KEY="wfb_live_xxxxxxxx" ``` ```powershell setx WEFLUENCE_API_KEY "wfb_live_xxxxxxxx" ``` Want to try it without touching real data? Ask [hello@wefluence.id](mailto:hello@wefluence.id) for a `wfb_test_` key that reads a sample account. ## Check the connection Call `/v1/me` to make sure your key works. ```bash curl https://api.wefluence.app/v1/me \ -H "Authorization: Bearer $WEFLUENCE_API_KEY" ``` ```python import os, requests headers = {"Authorization": f"Bearer {os.environ['WEFLUENCE_API_KEY']}"} print(requests.get("https://api.wefluence.app/v1/me", headers=headers).json()) ``` ```javascript const headers = { Authorization: `Bearer ${process.env.WEFLUENCE_API_KEY}` }; const res = await fetch("https://api.wefluence.app/v1/me", { headers }); console.log(await res.json()); ``` If it works, you get the account name and remaining quota: ```json { "object": "account", "brand": { "name": "Brand Name" }, "key": { "label": "Marketing dashboard", "mode": "live", "scopes": ["campaigns:read", "content:read"], "expires_at": "2027-11-02T00:00:00.000Z" }, "quota": { "per_minute": 60, "per_day": 5000, "used_today": 1 } } ``` ## List campaigns ```bash curl "https://api.wefluence.app/v1/campaigns?status=active" \ -H "Authorization: Bearer $WEFLUENCE_API_KEY" ``` ```python r = requests.get( "https://api.wefluence.app/v1/campaigns", headers=headers, params={"status": "active"}, ) campaigns = r.json()["data"] ``` ```javascript const res = await fetch("https://api.wefluence.app/v1/campaigns?status=active", { headers }); const { data: campaigns } = await res.json(); ``` ## List content Use a campaign `id` from the previous step. ```bash curl "https://api.wefluence.app/v1/campaigns/abc123/content?status=approved" \ -H "Authorization: Bearer $WEFLUENCE_API_KEY" ``` ```python r = requests.get( f"https://api.wefluence.app/v1/campaigns/{campaigns[0]['id']}/content", headers=headers, params={"status": "approved"}, ) for item in r.json()["data"]: print(item["url"], item["views"]["verified"]) ``` ```javascript const url = `https://api.wefluence.app/v1/campaigns/${campaigns[0].id}/content?status=approved`; const { data } = await (await fetch(url, { headers })).json(); data.forEach((item) => console.log(item.url, item.views.verified)); ``` ## Next steps - [Daily sync](https://docs.wefluence.app/en/guides/daily-sync/): Pull every page and store it without duplicates. - [What the numbers mean](https://docs.wefluence.app/en/data/): Understand views, engagement, and amounts paid. - [API reference](https://docs.wefluence.app/en/reference/): See every endpoint and its parameters. --- # Keys and authentication How keys, scopes, and live or test mode work. Every request sends a key in the `Authorization` header. ```bash Authorization: Bearer wfb_live_xxxxxxxx ``` ## One key, one account A key reads one brand account. If you manage several brands, use one key for each account. You create keys yourself in the Wefluence app, under **Settings** (Pengaturan), then **API key**. Give the key a name and tick the permissions it needs. ## Scopes Scopes decide which data a key can read. | Scope | Contents | Default | | --- | --- | --- | | `campaigns:read` | Campaign list, details, and content and views summaries | Yes | | `content:read` | Content and creators per campaign | Yes | | `finance:read` | Remaining budget, amounts paid, service fees, and invoices | No | Without `finance:read`, campaign stats are still returned, without the `money` block. ## Live and test | Prefix | Reads | | --- | --- | | `wfb_live_` | Your brand account | | `wfb_test_` | A sample account, for trying the API without touching real data | ## Expiry Keys are valid for 12 months, and one account can have up to 5 active keys. To rotate a key, create a new one, move your systems over, then revoke the old one. A revoked key stops working immediately and cannot be turned back on. See also [how to keep keys safe](https://docs.wefluence.app/en/guides/key-safety/). --- # What the numbers mean How to read views, engagement, and amounts paid. Numbers in the API follow the same rules as the Performance page in the app, so you can match them directly. ## Views - **Verified views** have been checked, so they are not real time. They change when content is verified again. - **Views can exceed the budget.** Content that keeps running after the budget is spent is still counted, so `cost_per_1000_views` can be lower than the campaign rate. - **Per-video campaigns** pay per piece of content, so views can be 0 even when the content has been paid. - `views.flagged` is `true` when a piece of content's views were flagged as problematic. The number still counts toward totals, the same as in the app. ## Engagement Engagement only exists for content that has been scanned, so it can be `null`. Compare `items_with_data` with `items_counted` in the stats to see the coverage. `shares` is `null` on platforms that do not provide it, such as YouTube and Instagram. `null` means not available, not zero. ## Money - All amounts are whole Indonesian rupiah (IDR). - `paid_to_creators` excludes service fees and shopping funds. - `paid_amount` is recorded per application, not per piece of content. That is why the amount lives in [Creators](https://docs.wefluence.app/en/reference/creators/), not in [Content](https://docs.wefluence.app/en/reference/content/). ## Content status | Status | Meaning | | --- | --- | | `pending_review` | Waiting for your decision | | `approved` | Approved | | `rejected` | Rejected, the reason is in `rejection_reason` | Content still being checked by our team does not appear in lists yet, the same as in the app. Its count is still visible as `in_admin_moderation` in the stats. ## Other counts - `applicants` counts applications, not unique creators. - `as_of` shows when the data was read. - A content `id` stays the same every time you pull it, so it is safe to use as a unique key in your database. - `creator.ref` stays the same for the same creator within one account. --- # Pages and cursors How to read a long list all the way to the end. Lists are returned one page at a time. Use `limit` up to 100, the default is 50. When `has_more` is `true`, send `next_cursor` as `cursor` in the next request. ```bash GET /v1/campaigns/abc123/content?limit=100 GET /v1/campaigns/abc123/content?limit=100&cursor=eyJhIjoi... ``` ```json { "object": "list", "data": [], "has_more": true, "next_cursor": "eyJhIjoi...", "as_of": "2026-11-02T09:00:00.000Z" } ``` ## Rules - A page can hold fewer rows than `limit`, or even none. Only `has_more` tells you that you are done. - Treat the cursor as opaque text. - A cursor only works with the same key and the same list. - List order is stable, but it does not follow dates. Sort on your side if you need to. ## Example ```python import os, requests API = "https://api.wefluence.app/v1" HEADERS = {"Authorization": f"Bearer {os.environ['WEFLUENCE_API_KEY']}"} def get_all(path, **params): while True: page = requests.get(f"{API}{path}", headers=HEADERS, params=params).json() yield from page["data"] if not page["has_more"]: return params["cursor"] = page["next_cursor"] ``` ```javascript const API = "https://api.wefluence.app/v1"; const headers = { Authorization: `Bearer ${process.env.WEFLUENCE_API_KEY}` }; async function* getAll(path, params = {}) { while (true) { const qs = new URLSearchParams(params); const page = await (await fetch(`${API}${path}?${qs}`, { headers })).json(); yield* page.data; if (!page.has_more) return; params.cursor = page.next_cursor; } } ``` --- # Rate limits How many calls you can make, and what happens when you reach the limit. ## Limits per key | Limit | Value | | --- | --- | | Per minute | 60 calls | | Per day | 5,000 calls, resets at 00:00 Western Indonesia Time (UTC+7) | | Rows per page | 100 | | Reports | 30 files per day, the same request within 60 minutes is not counted | ## Checking your quota Usage per day, per key, and per endpoint is in the Wefluence app, under **Settings**, then **API key**. Every response carries these headers: | Header | Contents | | --- | --- | | `X-RateLimit-Limit` | Limit per minute | | `X-RateLimit-Remaining` | Calls left this minute | | `X-RateLimit-Reset` | Reset time, in Unix seconds | | `X-Daily-Limit` | Limit per day | | `X-Daily-Remaining` | Calls left today | ## When you hit the limit The API answers `429` with a `Retry-After` header in seconds. Wait that long before trying again. ```python import time r = requests.get(url, headers=headers) if r.status_code == 429: time.sleep(int(r.headers.get("Retry-After", "60"))) ``` ## Saving calls - Pull only active campaigns. A finished campaign only needs one more pull after it ends. - Need all content at once? A [report](https://docs.wefluence.app/en/reference/reports/) costs one call, however much content there is. - Need only the best content? [Top content](https://docs.wefluence.app/en/reference/content/) costs one call. - Stats are cached for up to 60 minutes, or 24 hours for finished campaigns. Calling more often does not make the numbers fresher. - Send `If-None-Match` with the last `ETag` to [Campaign stats](https://docs.wefluence.app/en/reference/campaign-stats/). The API answers `304` with no body when nothing has changed. --- # Errors The error format and what each code means. Errors use the RFC 9457 format with `Content-Type: application/problem+json`. Use `code` for logic in your system, because it never changes. The `title` and `detail` text is in Indonesian. ```json { "type": "https://docs.wefluence.app/errors/#rate_limited", "title": "Terlalu banyak permintaan", "status": 429, "code": "rate_limited", "detail": "Batas per menit tercapai.", "request_id": "req_7c21d0e4a1b2c3d4" } ``` Include the `request_id` when you contact our team. It is also in the `X-Request-Id` header. ## Error codes | Status | Code | Meaning | What to do | | --- | --- | --- | --- | | 400 | `invalid_request` | A parameter is invalid | Read `detail`, then fix the parameter | | 400 | `invalid_cursor` | The cursor is broken, or was made for another list or key | Start again from the first page | | 401 | `invalid_key` | The key is missing, malformed, or revoked | Check the `Authorization` header | | 401 | `key_expired` | The key has expired | Create a new key | | 403 | `account_blocked` | The brand account is blocked | Contact our team | | 403 | `insufficient_scope` | The key does not have the scope for this data | Use a key with the scope you need | | 404 | `not_found` | The data does not exist in this account | Check the ID and the key's account | | 405 | `method_not_allowed` | The method is not supported | The API uses `GET`, the MCP endpoint uses `POST` | | 429 | `rate_limited` | The per-minute limit was reached | Wait for `Retry-After` | | 429 | `daily_limit_reached` | The daily limit was reached | Try again after 00:00 UTC+7 | | 500 | `internal_error` | A problem on our side | Retry, and include the `request_id` if it keeps happening | | 503 | `api_disabled` | The API is temporarily unavailable | Try again in a few minutes | --- # Versions and changes How the API changes without breaking your integration. The version is in the URL, currently `/v1`. ## Change rules - New fields can be added at any time, so make sure your system ignores fields it does not know. - Breaking changes always ship as a new version. - `/v1` keeps working for at least 12 months after its successor is announced. ## History | Version | Changes | | --- | --- | | v1 | First release: campaigns, stats, content, creators, invoices, and the MCP server | --- # Daily sync Pull campaign data into your team's database every day without duplicates. The recommended pattern: pull active campaigns once or a few times a day, then read their content until `has_more` runs out. ## The flow 1. Get the campaign list with `status=active`. 2. For each campaign, read content until `has_more` is `false`. 3. Store rows with the content `id` as a unique key, so a re-pull updates the same row. 4. A campaign that has ended only needs one more pull after its `status` becomes `ended`. ## Full example ```python import os, time, requests API = "https://api.wefluence.app/v1" HEADERS = {"Authorization": f"Bearer {os.environ['WEFLUENCE_API_KEY']}"} def get_all(path, **params): while True: r = requests.get(f"{API}{path}", headers=HEADERS, params=params, timeout=30) if r.status_code == 429: time.sleep(int(r.headers.get("Retry-After", "60"))) continue r.raise_for_status() page = r.json() yield from page["data"] if not page["has_more"]: return params["cursor"] = page["next_cursor"] for campaign in get_all("/campaigns", status="active", limit=100): for content in get_all(f"/campaigns/{campaign['id']}/content", limit=100): print(campaign["title"], content["url"], content["views"]["verified"]) ``` ```javascript const API = "https://api.wefluence.app/v1"; const headers = { Authorization: `Bearer ${process.env.WEFLUENCE_API_KEY}` }; async function* getAll(path, params = {}) { while (true) { const res = await fetch(`${API}${path}?${new URLSearchParams(params)}`, { headers }); if (res.status === 429) { const wait = Number(res.headers.get("retry-after") || 60); await new Promise((r) => setTimeout(r, wait * 1000)); continue; } const page = await res.json(); yield* page.data; if (!page.has_more) return; params.cursor = page.next_cursor; } } for await (const campaign of getAll("/campaigns", { status: "active", limit: 100 })) { for await (const content of getAll(`/campaigns/${campaign.id}/content`, { limit: 100 })) { console.log(campaign.title, content.url, content.views.verified); } } ``` ## Scheduling One to four times a day is enough, because views update when content is verified. Use cron, GitHub Actions, or whatever scheduler you already have. If you manage several brands, run the same flow for each key. --- # Google Sheets Fill a spreadsheet with content data without running a server. ## Store the key Open the spreadsheet, choose **Extensions**, then **Apps Script**. In Project Settings, add a Script property named `WEFLUENCE_API_KEY`. Never put the key in a cell, because anyone who opens the file can read it. ## Paste the script Replace `abc123` with your campaign ID. ```javascript function pullContent() { var key = PropertiesService.getScriptProperties().getProperty('WEFLUENCE_API_KEY'); var id = 'abc123'; var sheet = SpreadsheetApp.getActiveSheet(); sheet.clearContents(); sheet.appendRow(['Creator', 'Platform', 'Link', 'Status', 'Views']); var cursor = ''; do { var url = 'https://api.wefluence.app/v1/campaigns/' + id + '/content?limit=100' + (cursor ? '&cursor=' + encodeURIComponent(cursor) : ''); var res = UrlFetchApp.fetch(url, { headers: { Authorization: 'Bearer ' + key } }); var page = JSON.parse(res.getContentText()); page.data.forEach(function (c) { sheet.appendRow([c.creator.name, c.platform, c.url, c.status, c.views.verified]); }); cursor = page.has_more ? page.next_cursor : ''; } while (cursor); } ``` ## Run it automatically In Apps Script, open **Triggers** and create a daily trigger for the `pullContent` function. --- # AI assistants Connect an AI assistant to your campaign data over MCP. With MCP, an AI assistant can read your campaigns and content directly, without writing code. Any tool that supports remote MCP servers with custom headers can use these two values: | Field | Value | | --- | --- | | URL | `https://api.wefluence.app/v1/mcp` | | Header | `Authorization: Bearer wfb_live_xxxxxxxx` | The tool list is in [MCP server](https://docs.wefluence.app/en/reference/mcp/). ## Claude In Claude on the web or Desktop: 1. Open Connectors settings, then add a custom connector. 2. Enter the MCP URL above and choose no sign-in. 3. Under Request headers, add `Authorization` with the value `Bearer wfb_live_xxxxxxxx`. On Team and Enterprise plans, an Owner adds the connector and every member uses the same key. The Free plan is limited to one custom connector. In Claude Code: ```bash claude mcp add --transport http wefluence https://api.wefluence.app/v1/mcp \ --header "Authorization: Bearer $WEFLUENCE_API_KEY" ``` ## Cursor Add this to `.cursor/mcp.json`: ```json { "mcpServers": { "wefluence": { "url": "https://api.wefluence.app/v1/mcp", "headers": { "Authorization": "Bearer ${env:WEFLUENCE_API_KEY}" } } } } ``` ## VS Code Add this to `.vscode/mcp.json`: ```json { "servers": { "wefluence": { "type": "http", "url": "https://api.wefluence.app/v1/mcp", "headers": { "Authorization": "Bearer ${input:wefluence-key}" } } } } ``` ## Your own agent In the Claude API, use the MCP connector with the beta header `anthropic-beta: mcp-client-2025-11-20`: ```json { "mcp_servers": [{ "type": "url", "url": "https://api.wefluence.app/v1/mcp", "name": "wefluence", "authorization_token": "wfb_live_xxxxxxxx" }], "tools": [{ "type": "mcp_toolset", "mcp_server_name": "wefluence" }] } ``` Agents on other models can call the API directly. Give them [openapi.yaml](https://docs.wefluence.app/openapi.yaml) as their tool list. ## Several brands One key reads one account. If you have several brands, add one connection per key, with different names such as `wefluence-brand-a` and `wefluence-brand-b`. ## Ready-to-copy prompts Daily report, for an assistant that is already connected: ```text Use the Wefluence tools. Get all active campaigns, then for each campaign use get_campaign_stats for the approved content count and total views, and get_top_content for the top 10 pieces of content with their links and creator names. State the as_of time, and say so if engagement data is incomplete. A null shares value means not available, not zero. ``` Full report as a file: ```text Use the Wefluence tools. Find the campaign I mention, create its report with create_campaign_report in xlsx format, and give me the download link. Do not pull all the content into the conversation. ``` Build an integration, for any coding assistant: ```text Help me connect this system to the Wefluence API. First read https://docs.wefluence.app/en/llms.txt and https://docs.wefluence.app/openapi.yaml. Read the key from the WEFLUENCE_API_KEY environment variable and never write it in code or logs. Pull per campaign, follow next_cursor until has_more is false, and wait for Retry-After on a 429. Use the content id as a unique key so re-pulls do not create duplicates. Treat null as data not available, not zero. ``` ## Files for AI Every docs page has a Markdown version. The **Copy page** button at the top right copies it, and can open it straight in an AI assistant. | File | Contents | | --- | --- | | [llms.txt](https://docs.wefluence.app/en/llms.txt) | A compact map of the docs | | [llms-full.txt](https://docs.wefluence.app/en/llms-full.txt) | All of the docs in one file | | [openapi.yaml](https://docs.wefluence.app/openapi.yaml) | The machine-readable API contract | | [openapi.json](https://docs.wefluence.app/openapi.json) | The same contract as JSON | --- # Keeping keys safe A key unlocks your account data, so treat it like a password. ## Do - Keep keys in a secret manager or an environment variable. - Use one key per integration, so you can revoke it without affecting the others. - Give each key the smallest scope it needs. Turn on `finance:read` only when you really need it. - Call the API from a server. The API deliberately cannot be called from a browser, so page visitors can never read your key. ## Don't - Don't put keys in code, repositories, or logs. - Don't paste keys into chat, including chats with AI assistants. - Don't store keys in spreadsheet cells. ## If a key leaks Revoke it right away under **Settings**, then **API key**, and create a new one. A revoked key stops working immediately. --- # Reference overview Base URL, authentication, and rules that apply to every endpoint. The Wefluence API is REST and answers in JSON. Every endpoint only reads data. ```text https://api.wefluence.app/v1 ``` ## Endpoints | Method | Path | Scope | | --- | --- | --- | | GET | [/v1/me](https://docs.wefluence.app/en/reference/account/) | Any | | GET | [/v1/campaigns](https://docs.wefluence.app/en/reference/campaigns/) | `campaigns:read` | | GET | [/v1/campaigns/{id}](https://docs.wefluence.app/en/reference/campaigns/) | `campaigns:read` | | GET | [/v1/campaigns/{id}/stats](https://docs.wefluence.app/en/reference/campaign-stats/) | `campaigns:read` | | GET | [/v1/campaigns/{id}/content](https://docs.wefluence.app/en/reference/content/) | `content:read` | | GET | [/v1/campaigns/{id}/top-content](https://docs.wefluence.app/en/reference/content/) | `content:read` | | GET | [/v1/campaigns/{id}/creators](https://docs.wefluence.app/en/reference/creators/) | `content:read` | | GET | [/v1/campaigns/{id}/report](https://docs.wefluence.app/en/reference/reports/) | `content:read` | | GET | [/v1/reports/{token}](https://docs.wefluence.app/en/reference/reports/) | No key | | GET | [/v1/invoices](https://docs.wefluence.app/en/reference/invoices/) | `finance:read` | ## General rules - Money is always whole Indonesian rupiah (IDR), times are always UTC in ISO 8601. - Data that is not available is `null`, not 0. - Data belonging to another account returns `404`, the same as an ID that does not exist. - Lists use [cursors](https://docs.wefluence.app/en/pagination/) and are subject to [rate limits](https://docs.wefluence.app/en/rate-limits/). The full contract is in [openapi.yaml](https://docs.wefluence.app/openapi.yaml) (also as [openapi.json](https://docs.wefluence.app/openapi.json)), which opens directly in Postman or similar tools. --- # Account Check your key, its scopes, and today's usage. ## Get account info `GET /v1/me` Returns the account name, the key's scopes, and today's usage. Handy as a connection test. Works with any key. ```bash curl https://api.wefluence.app/v1/me \ -H "Authorization: Bearer $WEFLUENCE_API_KEY" ``` ```python requests.get(f"{API}/me", headers=HEADERS).json() ``` ```javascript await (await fetch(`${API}/me`, { headers })).json(); ``` ```json { "object": "account", "brand": { "name": "Brand Name" }, "key": { "label": "Marketing dashboard", "mode": "live", "scopes": ["campaigns:read", "content:read"], "expires_at": "2027-11-02T00:00:00.000Z" }, "quota": { "per_minute": 60, "per_day": 5000, "used_today": 1 } } ``` --- # Campaigns The campaign list and campaign details. ## List campaigns `GET /v1/campaigns` Requires the `campaigns:read` scope. | Parameter | Type | Contents | | --- | --- | --- | | `status` | string | `draft`, `pending_review`, `active`, `budget_depleted`, `paused`, `ended`, `rejected`, or `cancelled` | | `limit` | integer | Rows per page, 1 to 100, default 50 | | `cursor` | string | `next_cursor` from the previous page | ```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": "October campaign", "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" } ``` ## Get a campaign `GET /v1/campaigns/{id}` Requires the `campaigns:read` scope. Contains the same fields as a list row, plus the following. | Field | Type | Contents | | --- | --- | --- | | `description` | string | Campaign description | | `brief` | string | Brief for creators | | `rules` | array | Campaign rules | | `approval` | string | `auto` or `manual` | | `is_private` | boolean | Private campaign | | `reference_video` | string or null | Example video link | ```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(); ``` --- # Campaign stats Content count, views, engagement, and cost for one campaign. ## Get stats `GET /v1/campaigns/{id}/stats` Requires the `campaigns:read` scope. The `money` block is only returned with `finance:read`. Stats are cached for up to 60 minutes, or 24 hours for finished campaigns. Responses carry an `ETag` header. Send it back in `If-None-Match`, and the API answers `304` with no body when nothing has changed. | Field | Contents | | --- | --- | | `applicants` | Number of applications | | `content` | Content count per status | | `views.verified_total` | Total verified views | | `views.by_platform` | Views per platform | | `engagement` | Total likes, comments, shares, and their coverage | | `money` | Budget, remaining budget, amount paid, and service fee | Read [What the numbers mean](https://docs.wefluence.app/en/data/) before using these numbers in a report. ```bash curl https://api.wefluence.app/v1/campaigns/abc123/stats \ -H "Authorization: Bearer $WEFLUENCE_API_KEY" ``` ```python requests.get(f"{API}/campaigns/abc123/stats", headers=HEADERS).json() ``` ```javascript await (await fetch(`${API}/campaigns/abc123/stats`, { headers })).json(); ``` ```json { "object": "campaign_stats", "campaign_id": "abc123", "applicants": 195, "content": { "pending_review": 0, "in_admin_moderation": 0, "approved": 783, "rejected": 26 }, "views": { "verified_total": 1414148, "by_platform": { "tiktok": { "views": 1414148 } } }, "engagement": { "likes": 18014, "comments": 1224, "shares": 1693, "items_with_data": 587, "items_counted": 800 }, "money": { "currency": "IDR", "budget": 5000000, "remaining_budget": 0, "paid_to_creators": 5000000, "cost_per_1000_views": 3536, "platform_fee": 750000, "platform_fee_percent": 15 }, "as_of": "2026-11-02T09:00:00.000Z" } ``` --- # Content Creator content in one campaign. ## List content `GET /v1/campaigns/{id}/content` Requires the `content:read` scope. Content still being checked by our team is not included yet, the same as in the app. | Parameter | Type | Contents | | --- | --- | --- | | `status` | string | `pending_review`, `approved`, or `rejected` | | `limit` | integer | Rows per page, 1 to 100, default 50 | | `cursor` | string | `next_cursor` from the previous page | | Field | Contents | | --- | --- | | `id` | Stays the same on every pull, safe as a unique key | | `creator.ref` | Stays the same for the same creator in your account | | `url` | Content link | | `status` | Content status | | `rejection_reason` | Rejection reason, only for rejected content | | `views.verified` | Verified views | | `views.flagged` | `true` when the views were flagged as problematic | | `engagement` | Likes, comments, and shares, or `null` if not scanned yet | ```bash curl "https://api.wefluence.app/v1/campaigns/abc123/content?status=approved&limit=100" \ -H "Authorization: Bearer $WEFLUENCE_API_KEY" ``` ```python requests.get( f"{API}/campaigns/abc123/content", headers=HEADERS, params={"status": "approved", "limit": 100}, ).json() ``` ```javascript await (await fetch(`${API}/campaigns/abc123/content?status=approved&limit=100`, { headers })).json(); ``` ```json { "object": "list", "data": [ { "id": "cnt_8f3a1c9e42d70b15", "campaign_id": "abc123", "creator": { "ref": "crt_19ab77c0d2e4f611", "name": "Creator Name" }, "platform": "tiktok", "url": "https://www.tiktok.com/@example/video/123", "status": "approved", "submitted_at": "2026-10-20T03:12:00.000Z", "reviewed_at": "2026-10-21T08:40:00.000Z", "views": { "verified": 12500, "flagged": false }, "engagement": { "likes": 410, "comments": 22, "shares": 9, "scanned_at": "2026-10-27T02:00:00.000Z" } } ], "has_more": true, "next_cursor": "eyJhIjoi...", "as_of": "2026-11-02T09:00:00.000Z" } ``` ## Top content `GET /v1/campaigns/{id}/top-content` Requires the `content:read` scope. Approved content with the most views, already sorted, without pulling every page. Each row has the same shape as the content list. The data is cached for up to 60 minutes, see `as_of`. | Parameter | Type | Contents | | --- | --- | --- | | `limit` | integer | Number of rows, 1 to 100, default 20 | | `platform` | string | `tiktok`, `instagram`, `youtube`, `facebook`, `threads`, `x`, or `capcut` | | `min_views` | integer | Minimum views | With `platform`, you get the top 50 for that platform. For all content, use a [report](https://docs.wefluence.app/en/reference/reports/). ```bash curl "https://api.wefluence.app/v1/campaigns/abc123/top-content?platform=tiktok&limit=10" \ -H "Authorization: Bearer $WEFLUENCE_API_KEY" ``` ```python requests.get( f"{API}/campaigns/abc123/top-content", headers=HEADERS, params={"platform": "tiktok", "limit": 10}, ).json() ``` ```javascript await (await fetch(`${API}/campaigns/abc123/top-content?platform=tiktok&limit=10`, { headers })).json(); ``` --- # Creators Creators who applied to one campaign. ## List creators `GET /v1/campaigns/{id}/creators` Requires the `content:read` scope. One row per application. The amount paid lives here because payments are recorded per application, not per piece of content. | Parameter | Type | Contents | | --- | --- | --- | | `limit` | integer | Rows per page, 1 to 100, default 50 | | `cursor` | string | `next_cursor` from the previous page | ```bash curl https://api.wefluence.app/v1/campaigns/abc123/creators \ -H "Authorization: Bearer $WEFLUENCE_API_KEY" ``` ```python requests.get(f"{API}/campaigns/abc123/creators", headers=HEADERS).json() ``` ```javascript await (await fetch(`${API}/campaigns/abc123/creators`, { headers })).json(); ``` ```json { "object": "list", "data": [ { "ref": "crt_19ab77c0d2e4f611", "name": "Creator Name", "joined_at": "2026-10-02T04:00:00.000Z", "approved_content": 3, "verified_views": 41200, "paid_amount": 206000 } ], "has_more": false, "next_cursor": null, "as_of": "2026-11-02T09:00:00.000Z" } ``` --- # Reports An Excel or CSV file for one campaign, built on the server and downloaded through a link. ## Create a report `GET /v1/campaigns/{id}/report` Requires the `content:read` scope. The server builds the full file for one campaign, then answers with a download link. The contents are not in the response, which suits campaigns with thousands of pieces of content and AI assistants. | Parameter | Type | Contents | | --- | --- | --- | | `format` | string | `xlsx` or `csv`, default `xlsx` | | `status` | string | `approved`, `pending_review`, `rejected`, or `all`, default `approved` | | Field | Contents | | --- | --- | | `url` | Download link, valid for 24 hours | | `expires_at` | When the link expires | | `rows` | Number of pieces of content in the file | | `truncated` | `true` when content exceeds 20,000 rows, the file then holds those with the most views | | `reused` | `true` when a file made less than 60 minutes ago was reused | ```bash curl "https://api.wefluence.app/v1/campaigns/abc123/report?format=xlsx" \ -H "Authorization: Bearer $WEFLUENCE_API_KEY" ``` ```python report = requests.get( f"{API}/campaigns/abc123/report", headers=HEADERS, params={"format": "xlsx"}, ).json() file = requests.get(report["url"]) open(report["file_name"], "wb").write(file.content) ``` ```javascript const report = await (await fetch(`${API}/campaigns/abc123/report?format=xlsx`, { headers })).json(); const file = await fetch(report.url); ``` ```json { "object": "report", "campaign_id": "abc123", "format": "xlsx", "status": "approved", "rows": 1248, "truncated": false, "file_name": "october-campaign.xlsx", "url": "https://api.wefluence.app/v1/reports/rpt_Zk3v...", "expires_at": "2026-11-04T09:00:00.000Z", "reused": false } ``` ## Download the file `GET /v1/reports/{token}` No key needed, so the link opens directly in a browser or can be handed to you by an AI assistant. Treat the link like the file itself: anyone who holds it can download until `expires_at`. The link stops working early if the key that created it is revoked. ## Excel file contents The sheets inside the file are named in Indonesian. | Sheet | Contents | Available to | | --- | --- | --- | | Ringkasan (Summary) | Total views, interactions, engagement rate, creator count, platform breakdown | Any key | | Konten teratas (Top content) | Every piece of content with views, likes, comments, shares, scan time, status, and link | Any key | | Performa kreator (Creator performance) | Views, interactions, engagement, content count, and each creator's contribution | Any key | | Performa kampanye (Campaign performance) | Budget, remaining budget, status, and deadline | `finance:read` | With `finance:read`, the Summary sheet also shows budget, paid to creators, remaining budget, and cost per 1,000 views, and Creator performance shows each creator's earnings. ## CSV file contents One row per piece of content, in UTF-8. Column names match the API so they are easy to map: `id`, `creator_name`, `creator_ref`, `platform`, `url`, `status`, `views`, `views_flagged`, `likes`, `comments`, `shares`, `scanned_at`, `submitted_at`, `reviewed_at` ## Limits One key can create 30 reports per day. The same request within 60 minutes reuses the existing file and is not counted again. --- # Invoices Your account's invoices and their status. ## List invoices `GET /v1/invoices` Requires the `finance:read` scope. | Parameter | Type | Contents | | --- | --- | --- | | `status` | string | `unpaid`, `claimed` (transfer being checked), `paid`, or `void` | | `limit` | integer | Rows per page, 1 to 100, default 50 | | `cursor` | string | `next_cursor` from the previous page | Invoice line labels are in Indonesian, as they appear on the invoice itself. ```bash curl "https://api.wefluence.app/v1/invoices?status=paid" \ -H "Authorization: Bearer $WEFLUENCE_API_KEY" ``` ```python requests.get(f"{API}/invoices", headers=HEADERS, params={"status": "paid"}).json() ``` ```javascript await (await fetch(`${API}/invoices?status=paid`, { headers })).json(); ``` ```json { "object": "list", "data": [ { "id": "inv123", "number": "INV/WF/2026/0001", "kind": "campaign", "status": "paid", "subject": "kampanye Kampanye Oktober", "campaign_id": "abc123", "lines": [ { "label": "Saldo kampanye (reward kreator)", "amount": 5000000 }, { "label": "Service & Protection Fee (15%)", "amount": 750000 } ], "fee_percent": 15, "total": 5750000, "received_amount": 5750000, "created_at": "2026-11-02T03:00:00.000Z", "due_at": "2026-11-09T03:00:00.000Z", "paid_at": "2026-11-02T06:00:00.000Z", "wallet_paid_at": null, "receipt_number": "KWT/WF/2026/0001" } ], "has_more": false, "next_cursor": null, "as_of": "2026-11-02T09:00:00.000Z" } ``` --- # MCP server Read tools for AI assistants, with the same key and limits as the API. ## Connection `POST /v1/mcp` Stateless Streamable HTTP, with an `Authorization: Bearer` header. Keys, scopes, and limits are the same as the API. Only tool calls count toward the daily quota. Setup steps are in [AI assistants](https://docs.wefluence.app/en/guides/ai-assistants/). ```json { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "list_content", "arguments": { "campaign_id": "abc123", "status": "approved", "limit": 20 } } } ``` ## Tools Every tool only reads data. Tools outside the key's scopes are not listed. | Tool | Scope | Contents | | --- | --- | --- | | `get_account` | Any | Account name, key scopes, and today's usage | | `list_campaigns` | `campaigns:read` | Campaign list | | `get_campaign` | `campaigns:read` | Campaign details | | `get_campaign_stats` | `campaigns:read` | Content, views, and engagement summary | | `get_top_content` | `content:read` | Content with the most views | | `create_campaign_report` | `content:read` | Excel or CSV file, the assistant only receives a link | | `list_content` | `content:read` | One campaign's content, page by page | | `list_creators` | `content:read` | One campaign's creators | | `list_invoices` | `finance:read` | Invoices | ## Keep conversations lean An AI assistant pays for every row it reads. For large campaigns, `get_campaign_stats` and `get_top_content` are enough to answer questions, and `create_campaign_report` covers the full data. `list_content` fits best when you only need a few rows. `create_campaign_report` returns a [download link](https://docs.wefluence.app/en/reference/reports/) that anyone holding it can open, so don't paste it anywhere public.