Masheev Developers

Open Markdown · Agent index

Partner API

For software platforms that create and manage Masheev workspaces for their own customers. A partner pays for the usage of those workspaces and bills its customers itself; Masheev never bills them and never shows them a price. The API is for the platform's servers: it creates and manages connected accounts, invites people, reads usage and statements, and receives signed events. It never returns a customer's conversations, contacts or messages, and it cannot sign anyone in.

This page needs a partner account with API access switched on by Masheev. The complete reference (every field, limit and error) is generated from the product and ships with the masheev-platform skill, and the operations are in the OpenAPI document under the Partner tag.

Authenticate

A partner owner issues a key in the partner console, on the API page: a name, read or write access, and an expiry of up to 365 days. The key starts with ptk_, is shown once, and is a secret: keep it on a server.

curl "https://api.masheev.com/api/rpc/partner.v1.orgs.list?input=%7B%7D" \
  -H "x-api-key: $MASHEEV_PARTNER_KEY"

Calls are tRPC over HTTP. A query is a GET with the input as URL-encoded JSON in ?input=. A change is a POST with the input as the JSON body. Rotate a key by issuing a new one, deploying it, and then revoking the old one in the console. A revoked key fails on its next request, and so does a key whose issuer is no longer a partner owner.

Create a connected account

curl -X POST https://api.masheev.com/api/rpc/partner.v1.orgs.create \
  -H "x-api-key: $MASHEEV_PARTNER_KEY" -H "content-type: application/json" \
  -d '{"name":"Luna Bistro","ownerName":"Luna Owner","ownerEmail":"owner@lunabistro.example","country":"GB","region":"eu","externalRef":"customer_42","idempotencyKey":"create-customer_42-v1"}'
  • The owner must be a real person at the customer's business. They receive the "your workspace is ready" email when the workspace is approved and sign in with an email code, a passkey or Google.
  • Send an idempotencyKey you stored before the first attempt. Repeating the call with the same key and details returns the same workspace, even after a failure part-way.
  • The region (eu or us-east) is chosen once and cannot change. Country is GB or US.
  • If the owner's email already has a Masheev account the answer is 409 with reason: owner_email_in_use.
  • externalRef is your own reference; it comes back on accounts, usage rows and events.

Invite people

users.invite sends the standard invitation (admin or member). The person accepts it and signs in themselves; it expires after 7 days. users.list shows members (email and role) and open invitations. Both work only for workspaces you created: the people of a workspace that connected by its owner's consent are the owner's to manage.

Events

Masheev posts signed JSON events to the webhook address a partner owner sets in the console. Events are delivered at least once with backoff for 7 days, carry only ids, your externalRef, states and cents, and stay replayable with events.list for 90 days.

  • Headers: X-Masheev-Signature: sha256=<hex>, X-Masheev-Event, X-Masheev-Event-Id, Idempotency-Key.
  • The signature is the hex HMAC-SHA256 of the exact raw body with your signing secret.
  • Deduplicate on the event id and answer 2xx once you stored the event.

Event types: org.created, org.approved, org.rejected, org.paused, org.resumed, org.limit_reached, org.detached, org.offboard_scheduled, org.erased, usage.daily, balance.low, settlement.blocked, settlement.resumed, invoice.issued, invoice.overdue, accounts.stopped and partner.terminating. Each payload is listed in the skill's events.md.

Usage and statements

usage.list returns one row per account, UTC day, channel and price tier. A day's rows are written once, early the next day (UTC), and never change; a late refund appears as a negative amount on its own day. Page with cursor. statements.get (and statements.csv) gives a month per account, and settlements.list lists each charge to your main account. For a closed month the daily rows plus monthly fees equal the settlements and the statement total.

Limits, pausing and leaving

  • orgs.update sets or clears an account's monthly limit; orgs.pause and orgs.resume stop and restart it.
  • orgs.offboard with transfer detaches the account: it becomes an ordinary customer with its data intact and its owner is told. With erase (only for a workspace you created) its erasure is scheduled after a 30-day hold, which the owner can cancel.
  • A partnership ends with at least 30 days' notice: accounts still connected on the date are detached (not erased), owners are told their choices, and the keys stop.
  • Requests are limited per key and per partner. A workspace that is not one of your connected accounts is always NOT_FOUND.

The AI notice that tells people they are speaking to an AI cannot be switched off by a partner or by any call on this API.

White-label

White-label is part of the agreement. Masheev switches it on for your partnership and sets your product name, logo and primary color; the API neither reads nor changes them. While it is on, each connected account shows your name and logo in the app and in the workspace-ready and invitation emails. Those emails are still sent from Masheev's domain, with your name as the sender's display name and your support address as the reply-to. A color that cannot stay readable in light or dark falls back to Masheev's accent in that scheme. New web chat inboxes of your connected accounts start without the Powered by mark only if your contract allows it.

Some things always stay Masheev's: sign-in, security, erasure and legal emails, the legal pages (Masheev is named as the provider and processor) and the AI notice, which is the same under every brand. A detached account returns to Masheev's brand at once.

Not supported: the app inside your iframe. The app refuses to be framed and its session cookie is not sent from a framed page. Link to the app's sign-in page from your product instead. A custom domain is not available yet.