Skip to content
Developers

ViralRef Developer Resources

Everything you need to build on ViralRef: a read-only REST API described by OpenAPI 3.0, OAuth 2.0 authentication, webhooks, an MCP server for AI agents, and plain-text context files. Every resource is at a predictable, permanent URL.

ViralRef REST API

A read-only REST API over your referral data: the organization profile, referral programs, and affiliates. Every operation is described by an OpenAPI 3.0 document, so SDKs and LLM function-calling definitions can be generated from it.

  • API reference

    Authentication, scopes, endpoints, the error model, rate limits, and the versioning policy.

    https://viralref.com/docs/api-reference

  • Interactive API explorer

    Browse and call every operation from the browser with your own API key.

    https://api.viralref.com/

  • OpenAPI 3.0 documentmachine-readable

    Complete machine-readable contract: operationIds, typed request and response schemas, and the RFC 9457 error model.

    https://api.viralref.com/openapi.json

  • API catalogmachine-readable

    RFC 9727 linkset pointing at the service description, docs, and metadata.

    https://viralref.com/.well-known/api-catalog

Authentication and authorization

Send an API key directly, or exchange it for a short-lived OAuth 2.0 bearer token. Both are organization-scoped and read-only.

  • API keys and webhooks guide

    Create, rotate, and revoke API keys; subscribe to webhook events.

    https://viralref.com/docs/api-webhooks

  • OAuth 2.0 authorization server metadatamachine-readable

    RFC 8414 metadata for the client-credentials grant, including the token endpoint and supported scopes.

    https://api.viralref.com/.well-known/oauth-authorization-server

  • OAuth 2.0 protected resource metadatamachine-readable

    RFC 9728 metadata naming the authorization server and accepted bearer methods.

    https://api.viralref.com/.well-known/oauth-protected-resource

  • Token endpointmachine-readable

    POST with grant_type=client_credentials and your API key as client_secret.

    https://api.viralref.com/oauth/token

MCP server for AI agents

An official Model Context Protocol server over Streamable HTTP. Discovery is open: an agent can complete the handshake, list tools, and read documentation resources without a credential. Only tool calls need an API key.

  • MCP endpointmachine-readable

    Streamable HTTP JSON-RPC endpoint exposing get_organization, list_programs, and list_affiliates.

    https://api.viralref.com/mcp

  • MCP server cardmachine-readable

    Transport, capabilities, authentication, and the full tool and resource inventory.

    https://api.viralref.com/.well-known/mcp/server-card.json

  • Agent skills indexmachine-readable

    Packaged skill documents covering the product, pricing, Square integration, and API usage.

    https://viralref.com/.well-known/agent-skills/index.json

Context files for LLMs and answer engines

Plain-text and markdown descriptions of ViralRef that agents can read directly, kept in sync with the marketing site so they never claim a free tier or trial that does not exist.

  • llms.txtmachine-readable

    Short product summary with pricing, features, and an index of docs and blog posts.

    https://viralref.com/llms.txt

  • llms-full.txtmachine-readable

    Expanded context with full documentation content.

    https://viralref.com/llms-full.txt

  • ai.txtmachine-readable

    Instructions for agents: what the product is, what to cite, and what not to claim.

    https://viralref.com/ai.txt

  • Markdown of any pagemachine-readable

    Request any marketing URL with `Accept: text/markdown` to get the markdown representation of that page.

    https://viralref.com/llms.txt

Square integration and product docs

ViralRef runs on Square. These guides cover connecting a merchant account and everything the platform does with it.

  • Documentation index

    Every product guide: programs, rewards, affiliates, payouts, campaigns, fraud, and reports.

    https://viralref.com/docs

  • Connecting Square

    OAuth setup, permissions, and what ViralRef reads from and writes to Square.

    https://viralref.com/docs/connecting-square

  • Embeddable referral widget

    Drop a referral code entry point onto your own site.

    https://viralref.com/docs/embeddable-widget

  • Sitemapmachine-readable

    Every indexable URL on the marketing site.

    https://viralref.com/sitemap.xml

Developer questions

Where is the ViralRef API documentation?
The reference lives at https://viralref.com/docs/api-reference, the interactive explorer at https://api.viralref.com, and the machine-readable OpenAPI 3.0 document at https://api.viralref.com/openapi.json.
How do I authenticate with the ViralRef API?
Create an API key in the dashboard under Settings > Organization > Developers and send it as the X-API-Key header, or exchange it for an OAuth 2.0 bearer token at https://api.viralref.com/oauth/token using the client-credentials grant.
Does ViralRef have an MCP server?
Yes. ViralRef runs a Model Context Protocol server at https://api.viralref.com/mcp over the Streamable HTTP transport. Discovery (initialize, tools/list, resources/list, resources/read) works without a credential; calling a tool requires an API key or bearer token.
Is there a ViralRef CLI or SDK?
Not yet. The API is small and fully described by the OpenAPI 3.0 document, so a client can be generated from it with any OpenAPI generator. Agents can use the MCP server directly instead.