X-Token header. The API also accepts token as a query parameter, but the plugin never uses it: a key in a URL is logged by every proxy.
Accept: application/json is load-bearing. Sent without it, a failed call comes back as an HTML login page instead of the JSON error {"message":"Missing or invalid API Key","status":"ERROR","guid":"…"}. The plugin always sends it, and it keeps the guid on the error because that is what support asks for.
The store ID is the short string on Settings > API Keys (for example AbC123xy); every store route takes it as storeId.
Building a campaign takes two reads first:
rules.listgives every rule type, keyed by type (CART_FOLLOWUP_TIME, …), with itsoperators,possibleValuesanddefaultValue. A campaign action’srulesmust use those exact operator strings.campaigns.typesgives the campaign types the store supports (TRIGGER_CART_RECOVERY, …) with their mandatory and optional rules.
contacts.createemails the contact by default. Remarkety’sdoubleOptindefaults to true and sends a confirmation request; passdoubleOptin: falseto add a contact without it.propertiesis one object, not a list.stores.createandstores.updatecarry a different secret. TheapiKeythere is the key Remarkety uses to sync that store; it is not the token this plugin authenticates with.stores.updateisPUT /storeswith the id in the body, notPUT /stores/{id}. The same is true ofcampaigns.update, which isPUT /stores/{storeId}/campaigns.modedecides whether a campaign sends.runstarts it contacting shoppers,testsends a sample totestEmail, andstophalts it. Check the current mode withcampaigns.getbefore updating, and remember astopis the safe state to build in.- An email action needs a subject and a
baseTemplate; an api action needs awebhook. The plugin rejects either omission rather than creating a campaign Remarkety cannot run. This endpoint version expects exactly one action. stores.statusis the sync health check, andsyncStatusis the field to read.syncLastErrorholds the last runner message even on a healthy store (for exampleCampaign runner completed ( success: 0 )withsyncStatus: OK), so a non-empty value is not a failure.- Deleting a store is destructive and final. There is no archive state, and a store’s campaigns and contacts go with it.
- 20 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)
No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key.More: API Key
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 rules a campaign can useWhat’s next
API reference
Every
remarkety.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.