Skip to content

Build a Platform (Multi-Tenant Architecture)

How to build social posting into your own app: one Zernio profile per customer, their accounts connected under it, webhooks routed back to the right customer record.

The model

  1. Profile creation, POST /v1/profiles with the customer's identifier as the name. Store the returned profile._id on your customer record.
  2. Account connection, GET /v1/connect/{platform} with that customer's profileId. Subscribe to account.connected webhooks to map the resulting accountId back to the profileId.
  3. Publishing, GET /v1/accounts?profileId=... to list the customer's connected accounts, then POST /v1/posts against those account IDs.
  4. Webhook routing, point every platform at one team-level webhook endpoint. Route incoming events by accountId for post-level events, or profileId for account-level events.
  5. Account health monitoring. Watch for account.disconnected webhooks and run periodic account-health checks, then prompt the customer to reconnect on an auth failure.

Rate limits and access control

Rate limits scale with the number of connected accounts across the team. Use scoped API keys to restrict a key to specific profiles, or to disable whole resource groups, when a key is handed to a per-customer backend.

Billing and offboarding

  • GET /v1/usage?groupBy=profile attributes usage cost back to each profile, so you can bill customers individually.
  • To offboard a customer: disconnect their accounts first, then delete the profile.

See also