Tenant API
A small, tenant-scoped REST surface for reading and creating your parlour's clients, policies, claims and payments — plus outgoing webhooks for real-time events.
Authentication
All requests require an API key issued from Developer API. Every call is automatically scoped to your tenant — you can only see and write your own data.
Header (recommended)
X-API-Key: fss_live_xxxxxxxxxxxxxxxxxxxxxxxx
Or as a bearer token
Authorization: Bearer fss_live_xxxxxxxxxxxxxxxxxxxxxxxx
readwrite* (all)Base URL
https://dfnwctrhhbgqlmnqbsrd.supabase.co/functions/v1/tenant-api/{resource}Where {resource} is one of: clients, policies, claims, payments.
Endpoints
/tenant-api/clientsList clients belonging to your tenant.
Query parameters
limit— max rows (default 50, max 200)offset— pagination offset (default 0)
curl "https://dfnwctrhhbgqlmnqbsrd.supabase.co/functions/v1/tenant-api/clients?limit=25" \ -H "X-API-Key: fss_live_..."
{
"data": [
{ "id": "…", "full_name": "Jane Doe", "id_number": "…", "phone": "…", "email": "…", ... }
]
}/tenant-api/clientsCreate one client (object) or many (array). tenant_id is added automatically — do not send it.
curl -X POST "https://dfnwctrhhbgqlmnqbsrd.supabase.co/functions/v1/tenant-api/clients" \
-H "X-API-Key: fss_live_..." \
-H "Content-Type: application/json" \
-d '{ "full_name": "Jane Doe", "id_number": "8501015800088", "phone": "+27...", "email": "jane@example.com" }'/tenant-api/policiesList policies for your tenant. Supports the same limit/offset pagination.
curl "https://dfnwctrhhbgqlmnqbsrd.supabase.co/functions/v1/tenant-api/policies?limit=100&offset=0" -H "X-API-Key: fss_live_..."
/tenant-api/policiesCreate a policy. client_id must belong to your tenant; the API rejects cross-tenant references.
/tenant-api/claimsList claims for your tenant.
/tenant-api/claimsCreate a claim linked to one of your policies.
/tenant-api/paymentsList payments for your tenant.
/tenant-api/paymentsRecord a payment. Useful for reconciling external EFT or POS transactions.
Webhooks
Receive events at any HTTPS endpoint you control.
Signature verification
Every delivery includes an X-Signature header computed as HMAC-SHA256 of the raw request body using your webhook's signing secret.
X-Signature: sha256=8f4a9b…c02 Content-Type: application/json
Node.js verification example
import crypto from "node:crypto";
function verify(rawBody, header, secret) {
const [, sig] = (header || "").split("=");
const mac = crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
return crypto.timingSafeEqual(Buffer.from(sig, "hex"), Buffer.from(mac, "hex"));
}Standard events
client.created,client.updatedpolicy.created,policy.status_changedclaim.created,claim.status_changedpayment.received,payment.failed*— subscribe to everything
Delivery & retries
Non-2xx responses are marked failed and retried with backoff. Repeated failures are surfaced in the Developer API dashboard.
Rate limits & responses
{ "data": ... }.Fair-use limit: ~120 requests / minute per key. Contact support if you need more.
Get started
Three steps to your first request.
- Open Developer API in your dashboard.
- Create a new API key with the scopes you need and copy it (shown once).
- Call the base URL above with your
X-API-Keyheader.