Multi-tenancy
Fluide APIs are multi-tenant by design. Every product route (HR, Payroll, Pay, Books, Utils) scopes data to a tenant context resolved from your JWT and request headers. This page explains the two tenancy models Connect developers need to understand, when to use each, and which APIs to call.Two tenancy models
These models can coexist. A SERVICE_PARTNER org has its own organization record and manages separate client companies under workspaces.
Organization tenancy (direct)
Use this when your integration acts inside a single Fluide organization — for example automating HR for one business that owns the API credentials.How it works
- A user or machine token is bound to an active organization (
tenantIdin the JWT). - The gateway forwards requests with enriched user context (
X-User-Object, RBAC permissions). - Product services filter all reads and writes to that organization.
Key Auth APIs
Org roles include
owner, admin, member, and viewer. Custom org roles with permission strings are also supported. See RBAC.
Token response
After sign-in or token exchange, the access token envelope includestenantId:
Required headers (direct)
See Authorization for the full machine-token flow.
Partner tenancy (ISV / multi-merchant)
Use this when your product serves many end-customers (merchants, employers, payers) and you call Fluide APIs on their behalf. Developers onboard as SERVICE_PARTNER organizations in Fluide Connect. You do not register a separate OAuth app per merchant. Instead you use:- One developer API key (
fl_dev_...) and machine JWT - Workspaces — logical containers for your integration (e.g. production vs sandbox, or per region)
- Client companies — each merchant you onboard under a workspace
- Acting-client headers — tell the gateway which company each request targets
Setup flow
1
Complete developer onboarding
Sign in to Connect, verify your developer account, and provision API credentials via
POST /api/v1/auth/developer/ensure.2
Create a workspace
POST /api/v1/workspaces with a name. List workspaces with GET /api/v1/workspaces.3
Add client companies
POST /api/v1/workspaces/{workspaceId}/companies with company name, country, and currency. Each company is a distinct tenant context for product APIs.4
Submit client KYB (when required)
For regulated products, upload documents and submit via
POST .../workspaces/{workspaceId}/companies/{companyId}/kyb/submit. See the client KYB guide for the full flow.5
Call product APIs with acting-client headers
Exchange your API key for a machine token, then pass workspace and company on every gateway request (see below).
Acting-client headers
AfterPOST /api/v1/authorize/token, include these on every product API call when acting for a specific merchant:
The gateway resolves the effective tenant via
GET /api/v1/auth-context/{jti} and forwards the correct org context to downstream services.
Workspace and company APIs
Browse full request and response schemas in the Auth API reference.
Choosing a model
What is not supported (today)
Related docs
Authorization
Token exchange and required headers for machine tokens.
How-to guides
Partner onboarding, HR, payroll, and cross-product playbooks.
RBAC
Organization roles, permissions, and validate-session payload.
HR → Payroll sync
Employee mirror and payroll run lifecycle.
Payroll → Books GL
GL mappings and journal posting after payroll completes.