Tenant Context
Tenant context enables B2B2C (Business-to-Business-to-Consumer) integrations. Pass tenant information with work orders to track usage, route webhooks, and attribute costs to your end users.Understanding B2B2C
In the B2B2C model:- AgentGate is the first B (we provide the platform)
- Your Platform is the second B (you build products with AgentGate)
- End Users are the C (your customers use your product)
What Is Tenant Context
Tenant context is metadata that travels with work orders:Tenant Context Fields
All fields are optional, but providing them enables usage tracking and attribution.
Tenant ID
Identifies the organization or account in your system:- Billing aggregation by customer
- Usage limits per tenant
- Tenant-specific webhooks
Tenant User ID
Identifies the specific end user:- Per-user usage tracking
- User-level rate limiting
- Audit trails
Metadata
Custom information for your use:Passing Tenant Context
Include tenant context when creating work orders:Tenant Context in Webhooks
Webhooks include tenant context, enabling you to route notifications:Webhook Routing
Use tenant context to route webhooks to tenant-specific endpoints:Usage Attribution
Tenant context enables usage tracking and billing:Query Usage by Tenant
Billing Integration
Use usage data to bill your customers:Best Practices
Consistent Tenant IDs
Use consistent, stable identifiers:Good Examples
Good Examples
Avoid
Avoid
Metadata Guidelines
Include useful context in metadata:Privacy Considerations
Related
Credits
Track and manage credit usage
Webhooks
Receive tenant-aware notifications