Multi-Tenancy
Details on how to support ingestion and analytics for multiple sub-organizations from a single Context.ai account.
For embedded integrations, Context.ai supports ingesting and producing analytics that are scoped to to subtenants via a single integration. This means you can use the same API key to support generating analytics for multiple sub-accounts, with guaranteed isolation between your users.
Ingestion
To support multi-tenant ingestion, include a unique tenant_id
field within each log
, thread
, orupsert
request. The tenant ID can be any string under 40 characters, but must remain fixed across the lifetime of the tenant. You are responsible for generating and storing the unique identifier for each sub-account.
Consuming Analytics
When using multi-tenant ingestion, analytics can also be consumed on a per-tenant basis. This means that all metrics and analysis will be specifically scoped each unique team_id
.
To consume analytics for a sub-tenant, pass same tenant ID as a URL query parameter in all GET
requests.
Example
A request to the below URL will fetch all conversations under the tenant with ID jGaCfkiPj2Zdhr3tIg21L
.
Last updated