reamaze({ host: 'acme.reamaze.io' }) or store it with keys.set_host(host). The brand name on its own (acme) and a pasted https://acme.reamaze.io/ are accepted too. Requests only go to https://<brand>.reamaze.io: another domain, an IP address or a port is rejected before anything is sent. Without a host the plugin throws before it sends anything.
Credentials are a login email and a personal API token, sent as HTTP Basic. The token lives under Settings, then API tokens, inside the brand. Store the pair as the account’s api_key, JSON-encoded as {"email":"...","token":"..."}, which is how a single-string key carries two values; reamaze({ key }) takes the same string.
Things to know before you call:
- Paging is by page number. Pass
page; the response carriespage_size,page_countandtotal_count.channels.listsends onlytotal_count, so readchannels.lengthfor that route. - Three routes answer a bare array, not a wrapper: contact notes, incidents and systems. The plugin wraps each under a named key (
notes,incidents,systems) so a caller always reads a collection, and a non-array body throws instead of becoming an empty list. - Report payloads are maps, not arrays.
reports.volumekeys conversation counts byYYYY-MM-DD,reports.tagskeys tag counts by tag name,reports.staffkeys metrics by staff display name, andreports.channelSummarykeys them by channel id. Read them withObject.entries. - Conversation status is an integer: 0 open, 1 responded, 2 done, 3 spam, 4 archived, 5 on hold, 6 auto-done, 7 and 8 for the AI agent, 9 AI spam.
- Request bodies are wrapped, in
conversation,message,contact,identity,article,incident,response_templateorstaff. Notes are the exception:notes.createandnotes.updatesend the fields unwrapped, as a bare{ body }plus the optionalcreator_emailandcreated_at. incidents.updateis a PUT. The vendor heading says PUT and its curl example sends-X POST; the route only answers PUT, so that is what the endpoint sends.- An unknown route answers HTML, not JSON. An unknown resource answers
{"errors":"Not Found"}, an unknown route{"status":404,"error":"Not Found"}, and a validation failure a map of field to message with status 422.
- 38 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 recent conversationsWhat’s next
API reference
Every
reamaze.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.