4-Tier Integration Model

Otesse integrations are built on a four-tier architecture that cleanly separates the global catalog of available services from organization-level activation, individual user authentication, and provider-specific resource management. This design ensures security, auditability, and flexibility as your integration needs grow.

The Four Tiers

Tier 1: Provider Catalog (Global)

The provider catalog defines what integrations are available on the platform. Each entry in the catalog is an IntegrationProvider record containing:

  • Provider metadata — Name, description, logo URL, documentation link
  • Authentication type — Whether the provider uses OAuth 2.0 or API key authentication
  • OAuth configuration — Authorization URL, token URL, required scopes (for OAuth providers)
  • Required credentials — JSON schema defining what credentials the provider needs (for API key providers)
  • Category — Which category the provider belongs to (Payment, Communication, Mapping, AI, etc.)

The provider catalog is managed by platform administrators and is shared across all organizations. Individual organizations cannot add providers to the catalog — they can only activate providers that already exist.

Tier 2: Tenant Instance (Per-Organization)

When an organization activates a provider, a IntegrationInstance is created. This record represents the organization's relationship with the provider:

FieldDescription
Organization IDWhich organization activated this provider
Provider IDWhich provider was activated
StatusCurrent connection status (pending, connected, error, revoked, suspended)
EnvironmentProduction or sandbox
EnabledWhether the instance is currently active
Last ConnectedTimestamp of the last successful connection
ConfigurationProvider-specific settings

Each organization can have at most one instance per provider. If an organization disconnects and later reconnects, the existing instance is reused (status updated from "revoked" to "pending").

Tier 3: User Connection (Per-User)

Each user who authenticates with an integration gets their own IntegrationConnection record. This record owns the encrypted credentials:

FieldDescription
Connection NameDisplay name (e.g., "Stripe - Nathaniel")
Instance IDWhich organization instance this connection belongs to
User IDWhich user authenticated
StatusConnection health (pending, connected, error, expired, revoked)
Connected AtWhen the connection was successfully established
MetadataAuthentication details (grant type, scopes, auth type)

Multiple users in the same organization can have their own connections to the same instance. The instance status reflects the best connection status — if any user is connected, the instance is considered connected.

Tier 4: Integration Resource (Per-Instance)

Resources are provider-specific manageable items that belong to an instance. Not all providers have resources — only those that expose configurable items:

Resource TypeProviderDescription
Sender EmailPostmarkEmail addresses used for sending (e.g., hello@otesse.com)
Phone NumberQuo (OpenPhone)Phone numbers for SMS messaging
Webhook URLStripeWebhook endpoint URLs for receiving payment events
Model PreferenceAnthropicAI model selection (e.g., Claude Opus, Claude Sonnet)

Resources are managed through the Connected Apps drawer, where administrators can add, edit, delete, and set defaults for each resource type.

How the Tiers Relate

Provider Catalog (global)
  └── Instance (org activates provider)
        ├── Connection (user authenticates)
             └── Credential (encrypted tokens/keys)
        └── Resource (manageable items: emails, phone numbers)

Example flow: Postmark is a provider in the catalog (Tier 1). When Otesse enables Postmark, an instance is created (Tier 2). When Nathaniel enters the Postmark API key, a connection is created with encrypted credentials (Tier 3). Nathaniel then adds sender email addresses like hello@otesse.com and support@otesse.com as resources on the instance (Tier 4).

Integration Categories

Providers are organized into categories for browsing in the catalog:

CategoryCodeExample Providers
PaymentpaymentStripe, Square, PayPal
AccountingaccountingQuickBooks, Xero, FreshBooks
CommunicationcommunicationPostmark, Twilio, Quo (OpenPhone)
MarketingmarketingMailchimp, SendGrid, HubSpot Marketing
SchedulingschedulingGoogle Calendar, Calendly
CRMcrmSalesforce, HubSpot CRM
StoragestorageGoogle Drive, Dropbox
AnalyticsanalyticsGoogle Analytics, Mixpanel

Categories help administrators find the right integration quickly. The All Integrations tab displays provider cards grouped by category with search and filter capabilities.

Connection Status Values

Both instances and connections track their status using a shared set of status codes:

StatusMeaningUsed By
pendingCreated but not yet authenticatedInstance, Connection
connectedActive and healthyInstance, Connection
errorLast health check or auth attempt failedInstance, Connection
revokedUser or admin explicitly disconnectedInstance, Connection
expiredOAuth token expired and refresh failedConnection only
suspendedAdmin disabled the integrationInstance only

Understanding these statuses helps administrators diagnose connection issues. A "connected" instance with an "expired" connection means the user's tokens need refreshing, while an "error" instance means the last health check failed for all connections.