- Real email.
events.sendcan trigger workflows that email real people, andtransactional.senddelivers a published transactional email to a real inbox.transactionalIdis the id of a transactional email you created in the Loops dashboard, not the recipient. - Upserts.
contacts.updatecreates the contact when no match exists, so it cannot fail with not-found.contacts.createanswers 409 when the email or userId already exists. - Deleting a contact is permanent.
contacts.deleteremoves the contact and its subscriptions; there is no restore call. - Custom properties. Pass them under
customProperties; values can be strings (max 500 characters), numbers or booleans, and they land on the request body beside the fixed fields, so a key likeemailoruserIdthere is rejected. A custom property must exist in the team before a call sets it: create it once withcontacts.createPropertyor in the dashboard. The write example’splanNameneedscontacts.createProperty({ name: 'planName', type: 'string' })first on a new team. - Success envelope. A 2xx body with
success: falseis still a failure: the plugin throws core’sApiErrorwith Loops’ message (status 200). Errors keep Loops’ answer inbody(validation failures name apaththere) and leave out the request body, which holds contact data and template variables. - Feature gating. Campaigns, campaign/transactional/workflow groups, transactional-email management, email messages, workflows and workflow nodes, themes, components, footers, uploads, audience segments and event patterns use Loops’ content API. A team without it gets a 401 whose message says the feature is not enabled; the plugin keeps that apart from a bad key and never retries it.
- Campaign sends.
campaigns.createandcampaigns.updatetakescheduling;{ method: 'now' }sends the campaign to its whole audience, so both aredestructive. Leaveschedulingout to work on a draft. - Workflow edits use revisions. Workflow and node writes need the workflow’s current
expectedRevisionId(fromworkflows.get) and answer 409 on a stale one.workflows.changeMailingListand the node deletes takedryRun: true; with queued contacts they answerstatus: 'queuedContactsFound'until you passqueuedContactPolicy. - Uploads.
uploads.createanswers a presigned URL; PUT the file there yourself, then calluploads.complete. - Pagination. List calls take
perPage(10 to 50) andcursor; the next cursor ispagination.nextCursor.lists.listandcontacts.listPropertiesanswer bare arrays. - Rate limits. 10 requests per second per team. Loops sends
x-ratelimit-limitandx-ratelimit-remainingbut no Retry-After; the plugin retries a 429 up to three times with exponential backoff, except a used-up quota (50 uploads per 24 hours, the daily preview limit), which it returns at once. - Idempotency.
transactional.sendandevents.sendaccept anidempotencyKey(max 100 characters). Reusing one within 24 hours answers 409 instead of sending a duplicate. Passing a key also lets the plugin replay a 5xx safely; other writes are never replayed. - Inbound webhooks. Loops signs every delivery the Standard Webhooks way (
webhook-id,webhook-timestamp,webhook-signature: v1,<base64>) with the signing secret from Settings → Webhooks (one endpoint per team). SetwebhookSecret, or store it withkeys.set_webhook_signature. Verification needs the untouched request body; deliveries more than five minutes off are refused. Events:contact.created,contact.unsubscribed,contact.deleted,contact.mailingListSubscribed,contact.mailingListUnsubscribed,transactional.emailSent,campaign.emailSent,loop.emailSent,email.delivered,email.softBounced,email.hardBounced,email.opened,email.clicked,email.unsubscribed,email.resubscribed,email.spamReportedandtesting.testEvent.
- 82 typed API operations
- 17 incoming webhook event types
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 Loops API key before the first call: More: API Key
pnpm corsair setup --plugin=loops --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 mailing listsWebhooks
This plugin registers 17 webhook event types. Configure the provider to POST to your Corsair HTTP handler, then usewebhookHooks on the plugin factory.
See Webhooks for every event path and payload shape, and Webhooks concept for routing.
What’s next
API reference
Every
loops.api.* operation with input and output types.Webhooks
Event paths, payloads, and
webhookHooks examples.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.