API reference
Explore endpoints, request fields, response schemas, and examples in the interactive OpenAPI docs.
API keys
Create an org-scoped key, set an expiration date, and manage access for your automations.
Use API keys, the API reference, n8n, and agent workflows to automate viral.app operations.
The viral.app API lets your team automate brand workflows outside the UI. Use it for programmatic access to tracked accounts, tracked videos, analytics, tags and products, Creator Hub, payout workflows, integrations, and live lookups when your plan includes API access. For the product-level view, start with the viral.app API overview.
This page gives a broad overview. Use the API reference for exact endpoints, request fields, response fields, and examples.
Explore endpoints, request fields, response schemas, and examples in the interactive OpenAPI docs.
Create an org-scoped key, set an expiration date, and manage access for your automations.
Use API Keys to create and manage API keys for your workspace.
When you create a key, give it a clear name, such as Weekly reporting workflow or Finance payout review. You can also set an expiration date.
viral.app shows the full API key only once after creation. Save it in your team's secure secrets manager before you leave the page. If you lose the key, create a new one and delete the old key.
The API key table also shows status, global rate limit, expiration, last-used time, creation date, and the teammate who added the key.
Owners and admins can pause and resume any key from the row menu on the API Keys page. Requests with a paused key return 401 Unauthorized with the message API key is disabled. An organization admin can re-enable it under Settings → API → Keys.
viral.app also pauses keys automatically when nearly all of their requests keep failing over a sustained period — usually a sign of an integration stuck in a retry loop. When that happens, the key shows as Auto-paused and your workspace's owners and admins receive an email with the failing error codes. Fix the integration, then resume the key from the same page; the resume takes effect immediately.
API requests use the x-api-key header. The API key identifies the workspace and controls access according to your plan.
API access is plan-gated. If your current plan does not include API access, the API Keys page shows that access is unavailable.
List endpoints such as GET /api/v1/videos and GET /api/v1/accounts return one page at a time. Ask for a page with page (from 1) and perPage (up to 100, 10 by default); the response carries the rows in data, plus pageCount and totalRows. There is no hasMore or cursor field: request pages 1 to pageCount and collect data from each, or a script stops at the first page. A few lists page by offset instead and return nextOffset, which is null on the last page. The API reference shows which fields each endpoint returns.
Open the interactive API reference to explore available resources and test requests. Use the machine-readable OpenAPI spec when you need to generate clients, connect tools, or review schemas outside the browser.
The API reference is the source of truth for endpoint-specific details. Keep docs, automations, and internal tools aligned with the reference instead of copying endpoint details into team documents.
Many workflows available in the UI can also be automated through the API where the API supports that resource area. Common automation areas include:
Start with tracked resources and analytics for regular reporting. Use live lookups for fresh one-off discovery or enrichment. Live lookups can use extra credits.
The tracking routes do what Tracking Options does in the app. Every route below lives under https://viral.app/api/v1.
| Route | What it does |
|---|---|
POST /accounts/tracked | Starts tracking accounts. Accounts you already track stay unchanged and come back under alreadyTracked. |
POST /videos/tracked | Starts tracking individual videos. |
DELETE /accounts/tracked | Removes tracked accounts. Send { "ids": ["…"] } with the id of each account from GET /accounts/tracked, up to 500 per request. |
DELETE /videos/tracked | Removes individually tracked videos. Send { "videos": [{ "id": "…" }] } with the id of each video from GET /videos/tracked, up to 500. |
Removing cannot be undone. An account's tags, tag rules, creator link and individually tracked videos go with it, its videos leave analytics, and historical data of removed accounts and videos is cleared regularly. An account that only held individual videos is removed with its last video. To stop syncing an account and keep its data, pause it instead: set its video limit to 0 with PUT /accounts/tracked/{id}/max-videos. Both DELETE routes answer with deletedCount. An id you do not track is skipped, and the request fails with 400 only when none of the ids is tracked.
Adding an account or video again is not a refresh. This applies to an account you removed before, and to a video you already track or removed before. It does not fetch new data while the data you already have is as fresh as your sync schedule keeps it. The item is tracked again right away, and the add response lists it under syncSkipped with dataFrom, the time its data was loaded. The next scheduled sync updates it. Use a refresh for fresh data now: POST /accounts/tracked/refresh or POST /videos/tracked/refresh (a manual refresh, which uses credits). An account or video you add for the first time is always fetched, and so is an account you add again with a higher video limit than it had.
Creator campaigns have their own guide. You send the campaign in the campaign sheet's own vocabulary, a dry-run reads every payout rule back as a sentence before anything is written, and the same routes assign creators, end a campaign, and reactivate it. The guide is written to be handed to an agent as well.
Briefs are what creators read before they film: write them in markdown or the editor's JSON, attach sample videos from your tracked accounts or the viral video library, and link them to campaigns.
Payouts have their own guide as well. It covers the four payout queues, the calculate-then-initiate loop for a due billing window, and manual payouts with an id you mint yourself, so a retried request never pays twice. Approving a Talentir payout stays in the dashboard.
The chat API reads your creator conversations and writes to them as your brand: replies with files, group chats and broadcasts. It is what a helpdesk integration or an AI agent answering creators builds on.
The ads routes do what Analytics › Ads does: list the ads on your connected ad accounts, create TikTok Spark Ads and Meta partnership ads from tracked posts, and pause, resume, or reschedule the ads you created through viral.app. Every route below lives under https://viral.app/api/v1; replace {network} with tiktok or meta.
| Route | What it does |
|---|---|
GET /ads | Lists the TikTok and Meta ads on your tracked content with goal, status, spend, and results. Ads created through viral.app show syncing until the first sync returns them. |
GET /ads/{network}/{adId}/daily | Returns one ad's daily spend, impressions, paid views, clicks, and results. |
GET /integrations/ads/{network}/create-options | Lists the ad accounts you can create ads on and the goals each one offers. /countries, /targeting, and /targets under the same path return target countries, detailed targeting, and the pixels or apps a goal optimizes for. |
POST /integrations/ads/{network}/ads/check | Checks the creator's code, or a Meta account-level permission, for a post before you create anything. Nothing runs or bills. |
POST /integrations/ads/tiktok/ads | Creates a Spark Ad. Leave out authCode when the creator already approved the post for that ad account. |
POST /integrations/ads/meta/ads | Creates a partnership ad under the brand identity you pick. |
POST /integrations/ads/{network}/ads/{adId}/status | Pauses or resumes an ad created through viral.app. |
PATCH /integrations/ads/{network}/ads/{adId} | Changes the daily budget or the end date of an ad created through viral.app. |
GET and POST /integrations/ads/meta/creator-permissions | Lists or requests a creator's account-level permission for partnership ads. POST …/{permissionId}/refresh reads one permission from Meta again, and POST …/{permissionId}/revoke withdraws a request or removes a permission. |
Creating an ad starts real spend: the network bills the ad account for the budget. Send a fresh clientRequestId with every new ad, so a retried request returns the first ad instead of creating a second one. Asking a creator for a TikTok video permission stays in the dashboard, with Request Video Permission on Analytics › Ads. The API reference has every field.
Instead of polling the API, add a webhook endpoint in the Webhooks tab and viral.app sends your systems a signed request the moment something changes: a creator replies in chat, an application arrives, a billing window becomes due, a payout reaches a creator. Admins and owners manage endpoints there, in the dashboard; API keys cannot.
viral.app provides an n8n package for teams that build automations in n8n.
Use n8n when you want low-code workflows such as weekly performance reports, Slack alerts, spreadsheet updates, creator intake checks, or payout review notifications.
Create an API key in API Keys, then add it to your n8n credentials for the viral.app node.
Connect ChatGPT, Claude, Cursor, Codex, Gemini, Grok, or any other MCP client to the viral.app MCP server with one URL and a browser sign-in. Connect AI agents with MCP walks through every client.
Open Agents to set up viral.app inside agent workflows such as Codex, Claude Code, Open Claw, or similar tools.
Agent workflows are useful when your team wants conversational access to analytics, tracking checks, live lookups, or Creator Hub operations. Start with read-only prompts until your team has reviewed the workflow and API key access.
The Agents page includes install commands, starter prompts, and links to the skill source.