# Viral Loops — how to use (mcp.ai)

Connect your Viral Loops account and use 9 tools for marketing automation straight from your AI agent. Connect with your own API key. Viral Loops is a referral marketing platform for managing campaigns, participants, referrals, conversions, leaderboards, and rewards.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_viral_loops?ms=1787296080000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `viral_loops_get_campaign_info`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/viral_loops`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/viral_loops/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/viral_loops/get/campaign/info` — Return the connected campaign's identity, template, expiration mode and date, points, GDPR, and integration configuration without bulky presentation styling.
- `POST https://api.mcp.ai/api/viral_loops/get/campaign/stats` — Return the connected campaign's lead count and total referral count.
- `POST https://api.mcp.ai/api/viral_loops/get/participant` — Return one participant's profile, referral totals, rank, referrer, and reward summaries by email or referral code.
  - body: { email?: string, referral_code?: string }
- `POST https://api.mcp.ai/api/viral_loops/list/participant/referrals` — Return one participant's referrals by email or referral code, with explicit offset pagination. The provider's response fields and pagination metadata are preserved as returned.
  - body: { email?: string, limit?: integer, offset?: integer, referral_code?: string }
- `POST https://api.mcp.ai/api/viral_loops/look/up/participants` — Batch lookup exact participant and referrer identifiers, returning matching campaign records with explicit offset pagination.
  - body: { limit?: integer, offset?: integer, referrers?: object[], participants?: object[] }
- `POST https://api.mcp.ai/api/viral_loops/register/participant` — Register an email address in the connected campaign, optionally with a referrer and participant metadata. This creates persistent participant data; Viral Loops provides no API operation to delete it.
  - body: { email: string, consents?: object, last_name?: string, extra_data?: object, first_name?: string, acquired_from?: string, referral_source?: string, referrer_referral_code?: string }
- `POST https://api.mcp.ai/api/viral_loops/search/participants` — Search campaign participants by text, conversion status, and acquisition source, with explicit offset pagination.
  - body: { limit?: integer, offset?: integer, source?: string, search_term?: string, conversion_status?: string }
- `POST https://api.mcp.ai/api/viral_loops/track/participant/conversion` — IRREVERSIBLE: Record a conversion event for one registered participant. This operation cannot be undone and may affect conversion counts, campaign automation, and rewards. It is available only for Mil
  - body: { email?: string, value?: number, referral_code?: string }
- `POST https://api.mcp.ai/api/viral_loops/update/participant` — Update one participant's name, referral or conversion counts, or custom data, identified by email or referral code. Campaign emails and connected integration triggers default to off; when enabled, tho
  - body: { email?: string, last_name?: string, extra_data?: object, first_name?: string, send_emails?: boolean, referral_code?: string, referral_count?: integer, conversion_count?: integer, trigger_integrations?: boolean }

## Example prompts
- "What can I do in Viral Loops?"
- "Show me a summary of my Viral Loops account"

## More
- Page: https://mcp.ai/viral_loops
- Agent spec (llms.txt): https://mcp.ai/viral_loops/llms.txt
- Postman collection: https://mcp.ai/viral_loops/postman.json
