API Reference

This page documents the API families used by the current DartStream app. DartStream is microservice-based, so production uses separate service hosts instead of one monolithic API.

Authentication Headers

Protected API calls use Firebase ID token bearer authentication.

Authorization: Bearer <Firebase ID token>
Content-Type: application/json
X-Tenant-ID: <active tenant ID>

X-Tenant-ID is required for tenant-scoped calls. Auth bootstrap endpoints may not require it because they establish tenant context.

Auth API

Base host:

POST /api/v1/auth/signup

Bootstrap a newly created Firebase account.

{
  "idToken": "firebase_id_token",
  "email": "user@example.com",
  "password": "optional_password_context"
}

POST /api/v1/auth/login

Bootstrap an existing Firebase session.

{
  "idToken": "firebase_id_token"
}

POST /api/v1/auth/signin/google

Bootstrap a federated Firebase session.

{
  "idToken": "firebase_id_token",
  "providerName": "google"
}

Successful responses include user, active tenant, role, subscription, and memberships.

POST /api/v1/auth/logout

Log out the current backend session. The frontend also clears local Firebase and browser storage.

Billing API

Base host:

GET /api/v1/billing/subscription

Returns the active tenant billing snapshot and entitlement limits.

Example response shape:

{
  "tenantId": "tenant-id",
  "tenantName": "Workspace",
  "subscription": {
    "plan": "standard",
    "status": "active",
    "billingCycle": "annual",
    "customerId": "cus_...",
    "externalId": "sub_..."
  },
  "limits": {
    "auth_providers": 1,
    "database_connections": 1,
    "storage_gb": 5,
    "feature_flags": 25,
    "projects": 1,
    "environments": 2,
    "team_members": 3,
    "flutter_apps": 2,
    "game_projects": 1,
    "telemetry_events_monthly": 100000,
    "ai_runtime": 0
  },
  "features": {
    "auth_providers": true,
    "database_connections": true,
    "feature_flags": true,
    "ai_runtime": false
  }
}

GET /api/v1/billing/features/{feature}/check

Checks whether the active tenant can use a feature.

Example:

GET /api/v1/billing/features/auth_providers/check

Example response:

{
  "isValid": true,
  "failureReason": null,
  "hasWarning": false,
  "warningMessage": null,
  "used": 0,
  "limit": 1,
  "percentUsed": 0.0
}

POST /api/v1/billing/checkout

Creates a Stripe Checkout session for a subscription or routes an existing Stripe subscription to a targeted portal flow when applicable.

{
  "type": "subscription",
  "planId": "standard",
  "successUrl": "https://app.dartstream.io/membership/membership-paid?checkout=success&plan=standard",
  "cancelUrl": "https://app.dartstream.io/membership"
}

Response:

{
  "checkoutUrl": "https://checkout.stripe.com/c/pay/...",
  "type": "subscription"
}

POST /api/v1/billing/portal

Creates a Stripe Billing Portal session.

{
  "returnUrl": "https://app.dartstream.io/settings/billing"
}

Response:

{
  "portalUrl": "https://billing.stripe.com/p/session/..."
}

Enterprise API

Base host:

POST /api/v1/enterprise/enterprise-signup

Submits an Enterprise request from the membership flow.

The form captures use cases such as Flutter app runtime, Flame game backend, live-ops telemetry, Unity/native bridge planning, Dart FFI, AI runtime integration, private deployment, governance, security, compliance, and SLA needs.

Platform Health

GET /health

Each backend service exposes a health endpoint. Example:

GET https://apiplatform.dartstream.io/health

Status Values

Subscription status values include:

  • active

  • trialing

  • pendingCancel

  • cancelled

  • incomplete

  • inactive

Notes

Feature flag authoring and OpenFeature provider details belong primarily to IntelliToggle documentation. DartStream documents the feature and entitlement checks that the DartStream app uses.