oauth_2 as its auth type. Register an app in Developer Settings at https://www.toneden.io/settings/developer to get a client ID and secret; ToneDen reviews the app before the API works. The token is a user token, so every call acts as that user.
Things to know:
- Every route is scoped to a user. Campaigns and user lists take
user_idin the path, and links and attachments are listed per user (links.listForUser,attachments.listForUserwith atypeofunlockorcontest). Callusers.getwithuser_id: 'me'to read the connected user and its ID. - A taken path is a successful call.
links.validPathanswers 200 withvalid: falseand a reason, so check the flag rather than catching an error. - Writes send only what you pass. ToneDen documents no required body field, so an update with no field is rejected here rather than sending an empty body that changes nothing.
- Campaign writes can spend money.
campaigns.createcreates a real campaign on Facebook or Google, and a campaign or playbook update can change its budget or status, socampaigns.create,campaigns.update,playbooks.createandplaybooks.updatearedestructive. Review the body before calling them. - Link insights need a metric.
links.insightstakesmetric(clicks,clickthroughsorrsvps) and the window asstart_dateandend_date. - Errors. HTTP failures are core’s
ApiError;describeToneDenErrorreads the message out of its body. - Ad campaigns need a linked ad account. A campaign write also needs the ad account, creative and targeting fields ToneDen documents; the plugin forwards whatever you send without inventing defaults.
- User lists need ToneDen approval. The custom-audience endpoints say to contact support for access.
- No webhooks. ToneDen posts no events, so performance is read through the insights routes.
- 36 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- OAuth 2.0 (Recommended)
- API Key
Open hub.corsair.dev, navigate to your project, and enter the client ID and client secret from your ToneDen OAuth app.More: OAuth 2.0
4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
List your linksWhat’s next
API reference
Every
toneden.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.