FactionDocs
Technical Reference

Architecture

Deployment topology, network, authentication, API standards, versioning, error model, sandbox, observability, rate limits.

Architecture overview

flowchart TB
    subgraph CALLER ["Caller-controlled estate"]
        D365["Microsoft Dynamics 365<br/>Customer Service"]
        ORCH["Orchestrator<br/>(workflow + business rules)"]
        APIM[["Azure API Management<br/>(APIM v2 gateway)"]]
        D365 --> ORCH
        ORCH --> APIM
    end

    APIM -->|"OAuth2 / API key, TLS 1.3"| FGW

    subgraph FACTION ["Faction (EU-resident)"]
        direction TB
        FGW[["Faction API Gateway"]]
        FGW --> SVCS

        subgraph SVCS ["Stateless service layer"]
            direction LR
            S1["Intent Classifier"]
            S2["Info Extractor"]
            S3["Customer Matcher"]
            S4["Product Matcher"]
        end

        SVCS --> ENGINE["Faction Engine"]
        ENGINE --> STORE[("Encrypted storage<br/>EU region")]
        SVCS -.-> OBS["Observability<br/>logs · metrics · traces"]
    end

    SVCS -->|"Response JSON"| APIM
    APIM --> ORCH
    ORCH --> D365

    SANDBOX["Sandbox / Staging<br/>(separate tenant)"] -.->|"parallel"| FGW

Deployment topology

Faction runs as a multi-region deployment. Tenants are pinned to a single region.

RegionDescription
eu-west-1Ireland. Default for EU-resident deployments.
eu-west-2London. Required for UK-only data residency.
eu-central-1Frankfurt. Available on request.

Cross-region replication is disabled by default. Disaster recovery uses in-region multi-AZ deployment plus encrypted snapshots in a paired region (still within the EU).

Network architecture

SurfaceDescription
Public ingressFaction API Gateway, TLS 1.3, certificate via public CA. Reachable by caller's APIM.
Private peering (optional)Azure Private Link supported for tenants who want to remove public internet from the path.
EgressFaction does not initiate inbound calls into the caller's network in the default deployment. Webhook callbacks (if opted in) call back to caller-supplied URLs over TLS.

Authentication flow

Default flow is OAuth2 client credentials.

# Step 1: APIM exchanges credentials for a token
POST https://auth.eu.faction.ai/oauth2/token
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials
&client_id=...
&client_secret=...
&scope=intent.classify+extract.quote+match.customer+match.product
{
  "access_token": "eyJhbGc...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "intent.classify extract.quote match.customer match.product"
}
# Step 2: APIM forwards the token on each call
POST https://api.eu.faction.ai/v1/intent/classify
Authorization: Bearer eyJhbGc...
X-Correlation-Id: 8f3c-b21
Content-Type: application/json

Tokens are short-lived (1 hour default; configurable). API key auth is supported as a fallback or for sandbox.

API standards

StandardFaction adheres to
HTTP semanticsRFC 7231. Idempotency per RFC 7234.
JSONRFC 8259. UTF-8.
TimestampsRFC 3339. Always UTC.
Country codesISO 3166-1 alpha-2.
Currency codesISO 4217.
Phone numbersE.164.
OpenAPIv3.0.3.
PaginationCursor-based. next_cursor field on list endpoints.

Versioning policy

Versions appear in the URL path: /v1/..., /v2/.... Within a major version, additive changes only.

EventNotice
New optional field addedNo notice; clients should ignore unknown fields.
New endpoint addedNo notice.
Field deprecated90 days before removal, signaled via response headers.
Endpoint deprecated90 days. Response includes Deprecation and Sunset headers.
Major version EOL12 months from new major release.

Error model

{
  "error_code": "EXTRACTION_PARTIAL_FAILURE",
  "message": "Human-readable summary.",
  "correlation_id": "8f3c-b21",
  "request_id": "req_01J...",
  "details": { }
}
HTTPerror_code examplesWhen
400INVALID_PAYLOAD, MISSING_REQUIRED_FIELDBad request from caller.
401INVALID_TOKEN, EXPIRED_TOKENAuth issue.
403SCOPE_INSUFFICIENT, TENANT_DISABLEDAuth ok but action not allowed.
404JOB_NOT_FOUNDAsync job ID unknown.
409IDEMPOTENCY_KEY_CONFLICTSame key, different payload.
422EXTRACTION_PARTIAL_FAILUREPartial result returned in details.
429RATE_LIMITEDHonor Retry-After.
500INTERNAL_ERRORUnexpected server error. Retry safe.
502UPSTREAM_ERRORDownstream model service unavailable. Retry safe.
504TIMEOUTServer timeout. Retry safe with same idempotency key.

Health endpoints

GET /healthz
HTTP/1.1 200 OK
{ "status": "ok", "version": "1.4.2" }

GET /readyz
HTTP/1.1 200 OK
{ "status": "ready", "checks": { "model_serving": "ok", "storage": "ok" } }

GET /readyz
HTTP/1.1 503 Service Unavailable
{ "status": "not_ready", "checks": { "model_serving": "degraded" } }

Sandbox environment

Sandbox is a separate tenant with its own credentials at https://api.eu.sandbox.faction.ai. Capabilities:

  • Same API surface as production.
  • Synthetic catalogue and customer data, or a customer-supplied subset.
  • Reduced SLA (best-effort).
  • Used for integration testing, UAT, training, pre-production rehearsals.

Observability

Per-request metrics are emitted and queryable via the dashboards API:

MetricDescription
request_countTotal requests, by module, status, tenant.
latency_msp50, p95, p99 per module.
confidence_distributionHistogram of confidence scores per module.
threshold_routingCounts of auto_accept / confirm / review / manual per module.
feedback_volumeRep edits per module per day.

Logs include correlation IDs, request IDs, tenant ID, module, decision summary, outcome.

Rate limits

ScopeDefault limitNotes
Per-tenant per-module60 req/secBurst up to 120/sec for 30 s.
Per-tenant total240 req/secAcross all modules.
Async job creation10/secHigher on request.

Rate limits are configurable per tenant. Production volumes are validated and provisioned before go-live.

On this page