Clients and compliance profiles
Serve many customers from one project, each isolated and with its own residency rules.
Most applications serve many customers. In Sparq each of your customers is a client (the API calls it an audience tenant) inside your project. You do not need a separate project per customer.
How a request is tied to a client
When your users sign in with your identity provider, their token carries a claim that names their
organisation. You tell Sparq which claim (tenant_claim on the project's issuer binding). Sparq
reads the client only from that verified claim, and only if it names a registered, active client.
It is never taken from a request header.
curl -X POST "$SPARQ_API_URL/v1/admin/projects/$PROJECT_ID/audience-tenants" \
-H "Authorization: Bearer $SPARQ_KEY" -H "Content-Type: application/json" \
-d '{ "external_id": "org_4417", "name": "Northwind Retail" }'Compliance profiles
A compliance profile sets the rules for one client:
| Field | Meaning |
|---|---|
data_regions | Where prompts and outputs may be processed, for example ["eu"]. ["any"] means unrestricted. |
allowed_providers | Model providers the client accepts. |
allowed_model_classes | Model classes the client accepts. |
provider_retention | Whether providers may retain data, for example zero_retention_required. |
max_classification_to_external | The most sensitive data class that may go to an external provider. |
features_locked | End-user features fixed for this client. |
trace_content_policy | How much prompt and response content may reach trace destinations. |
retention_days | How long the client's conversations are kept. It can only shorten the workspace setting. |
approval_strictness | How often agents stop for approval for this client. |
Profiles are versioned. To change one, send the whole profile with version set to the current
version plus one; any other version is refused with 409 conflict.
curl -X PUT "$SPARQ_API_URL/v1/admin/audience-tenants/$CLIENT_ID/compliance-profile" \
-H "Authorization: Bearer $SPARQ_KEY" -H "Content-Type: application/json" \
-d '{
"audience_tenant_id": "'$CLIENT_ID'",
"version": 2,
"data_regions": ["eu"],
"allowed_providers": ["azure-openai"],
"provider_retention": "zero_retention_required",
"trace_content_policy": "redacted",
"retention_days": 90
}'A client without a profile follows the default rules. Read the current profile with
GET /v1/admin/audience-tenants/{id}/compliance-profile; it answers 404 when there is none.
Fail closed
If no model deployment satisfies a client's profile, the call fails with no_compliant_model. Sparq
never quietly routes the request somewhere else. See model routing.