Partner Hub (Admin)
Audience: Marketing ops · Engineering · Where in app: Admin sidebar → Partner Hub (/admin/partner-hub, own layout PartnerHubWorkspaceLayout.vue); taskers use the public creator pages at /creators/* · Access: super admins, or admin staff with the Partner Hub section (partner_hub). The user_type === 'admin' check lives in the controllers.
Partner Hub pays outside people ("taskers" / creators) for disclosed content — Reddit and Quora answers, LinkedIn comments, videos — that mentions Knock Knock. Admins publish tasks, taskers claim and submit links, admins review, a checker confirms the work is still live 48 hours later, and payouts go out every Monday (NZ time). Shipped in two phases (backend 6bd3dc4a8, 50e940b56; frontend 0e9a5f05, bc1d1ca9).
Admin workspace
Menu: Today, Topics, Tasks, Creators, Outreach, Review, Taskers, Payouts, Rules.
| Screen | Purpose |
|---|---|
| Today | "Today's admin work" checklist (approve submissions, spot-check links, post LinkedIn tasks, "Run Monday payouts"), "Waiting for your approval" (agent drafts, topic suggestions, reply/first-email drafts), stats (tasks live, active taskers, cash paid this month vs budget), agent run status. |
| Topics | Topics the agents work from (partner_hub_topics), competitor suggestions to accept/reject, API usage. |
| Tasks | Draft → publish (one or many) → close/reject (partner_hub_tasks). |
| Creators / Outreach | Creator records (partner_hub_creators) and the outreach queue: first emails and reply drafts to approve/edit/skip (partner_hub_outreach, partner_hub_creator_messages). |
| Review | Submitted claims to approve/reject, plus spot-checks the live checker couldn't open. |
| Taskers | Tasker profiles (partner_hub_taskers). |
| Payouts | "Monday payouts": who gets paid, export files (Wise batch CSV, PayPal Payouts CSV, Payoneer list), mark paid, earlier weeks. We never call a payment API — the admin uploads the file in each provider. Account credit is added in Knock Knock; affiliate commission is separate (Stripe). |
| Rules | Pay and caps, safety, daily agent switches and per-API caps — one partner_hub row in the settings collection; money in cents. |
Tasker side (public)
Routes in frontend/src/router/creators.js: /creators/sign-in, /creators/welcome, /creators/profile, /creators/tasks, /creators/tasks/:id, /creators/my-tasks, /creators/earnings. Taskers are not users: they sign in with an emailed code (POST /partner-hub/auth/code → /verify, rate-limited) and carry their own JWT signed with PARTNER_HUB_TOKEN (backend secret; PARTNER_HUB_TOKEN_EXPIRY default 30 days). app/middlewares/partnerHubAuth.js answers 401 PARTNER_HUB_SESSION_INVALID, which only the creator pages act on.
Rules enforced in app/lib/partnerHub.js (backed by unique indexes on partner_hub_claims): one person per thread, one task per subreddit per person per day; a claim locks the task (60 minutes for Reddit and Quora) and submission links must be on the platform's hosts.
Jobs (schedular)
| Job | Every | What it does |
|---|---|---|
PartnerHubClaimExpiryJob | 1 min | Returns tasks whose claim lock ran out with nothing submitted. |
PartnerHubTaskNoticeJob | 5 min | One email to taskers listing everything published since the last one (waits until publishing goes quiet). |
PartnerHubOutreachJob | 5 min | Outreach mailbox via Unipile: sends the next approved email inside the sending window and daily limit, re-checking opt-out/reply first; hands new replies to PartnerHubReplySorter. |
PartnerHubAgentsJob | 10 min | Starts each daily agent once per NZ day after its start time, if switched on in Rules: Topic Agent, scout, planner, creator finder, outreach drafter. Everything they make waits for an admin. Runs are in partner_hub_agent_runs; spend per API in partner_hub_api_usage. |
PartnerHubLiveCheckJob | 15 min | The 48-hour check: fetches approved links whose 48 hours are up and records live / removed / unreachable. Removed work drops out of the payout; unreachable goes to an admin spot-check. |
The agents' paid APIs go through a metered client (app/lib/partnerHubApis.js) that checks the day's cap before each call: SERPER_API_KEY and/or DATAFORSEO_LOGIN + DATAFORSEO_PASSWORD, BRAVE_SEARCH_API_KEY, AHREFS_API_KEY, YOUTUBE_API_KEY, ANTHROPIC_API_KEY. Locally, PARTNER_HUB_AGENTS_FAKE=on makes every API return realistic fake data.
In PROD these API keys and PARTNER_HUB_TOKEN are in the backend secret only. PartnerHubAgentsJob runs in the schedular, so scheduled agent runs need the keys added to the schedular secret too; Run now (POST /admin/partner-hub/agents/:agent/run) runs on an API pod and works either way.