apikey query parameter;
errors never carry it, the request body or the email addresses Moosend
quotes back.
- Errors arrive as HTTP 200. Moosend wraps every answer in
{Code, Error, Context}and signals failure with a nonzero Code. The plugin throws core’sApiErrorwith the HTTP status the code means: 429 forRATE_LIMITING(retried with backoff), 401 forAPI_KEY_NOT_VALID, 404 for any*_NOT_FOUND, 400 for validation errors, 500 for an internal error. The original Code and Error are onerror.body. - Outputs keep Moosend’s field names (
ID,Name,MailingLists,Paging, …). Dates come as ASP.NET strings such as/Date(1795515243966+0000)/, and most enums as numbers (a subscriber’sSubscribeTypeis 1 subscribed, 2 unsubscribed, 3 bounced, 4 removed). - subscribe is an upsert. It updates the existing subscriber with that
email, re-subscribes one who unsubscribed, and clears custom fields left
out of the call (so does
subscribers.update). On a double opt-in list it emails a confirmation unlesshasExternalDoubleOptInis true. Both subscribe operations aredestructivefor that reason.subscribers.subscribeManyskips invalid addresses and reports them innotice. - remove, unsubscribe and delete differ.
removemarks the member Removed (it stays visible under that status),unsubscribemarks it Unsubscribed, and thedeleteoperations erase it. Moosend refuses to remove an address that already unsubscribed. - Segment criteria are addressed by position.
segments.addCriteriareturns the new criterion’s position (1 = first);segments.updateCriteriatakes that number, not the criterion’sID.segments.updatewithcriteriareplaces all of them. To filter on a custom field, setfieldto that field’s ID fromlists.get(CustomFieldsDefinition[].ID); the documentedCustomField+CustomFieldNameform is rejected by the API. - No campaigns yet. Moosend answers the campaign list routes with
CAMPAIGN_NOT_FOUNDwhen the account has none;campaigns.listreturns an empty list for that answer. - Sending.
campaigns.send,campaigns.sendTest,campaigns.scheduleandtransactional.sendemail real people and aredestructive. Creating, updating and cloning campaigns only makes drafts. - Rate limits. Moosend limits some routes per API key: campaign activity 2 calls a minute, adding subscribers 10 per 10 s, bulk adds 2 per 10 s, tag updates 5 per 10 s.
- Moosend’s website tracking API (track.moosend.com) is a separate, site-ID based API and is not part of this plugin.
- 52 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
- API Key (Recommended)
Store the Moosend API key before the first call: More: API Key
pnpm corsair setup --plugin=moosend --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.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 the subscribed members of a mailing listWhat’s next
API reference
Every
moosend.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.