TenancyEngine/ docs

Getting started

From zero to your first authenticated TenancyEngine API call.

1. Sign in to TE Console

Register or sign in at https://console.tenancyengine.com/login. Your organization is created for you on signup (see the TE Console onboarding wizard).

2. Create an organization API key

In TE Console, go to API keys (under your account) and create a key. Pick the narrowest scopes you actually need: applications.read, tenants.read, tenants.write, entitlements.read, etc. The plaintext key is shown once, at creation. Copy it into a secret manager or local env file immediately. TenancyEngine never stores or can show you the plaintext again (keys are hashed at rest, the same reveal-once model used by every serious API platform).

Never commit an API key to source control or paste it into client-side JavaScript that ships to end users. The one sanctioned browser-side exception is TE Console's own signed-in API playground, where the key stays on your machine and is sent directly to the real API. It never transits TE's own backend.

3. Make your first call

Every organization API key authenticates with the X-TenancyEngine-Api-Key header:

curl -sS "https://auth.saasruntime.com/api/v1/runtime/applications/your-app-slug" \
  -H "X-TenancyEngine-Api-Key: te_your_key_here"

A successful response looks like:

{
  "id": "5c9c6e2e-...",
  "slug": "your-app-slug",
  "name": "Your App",
  "lifecycleStatus": "Active"
}

4. Fetch your app's runtime context

The single most useful call for gating a request is the runtime context endpoint. It returns enabled features, roles, claims, and active offerings for one call:

curl -sS "https://auth.saasruntime.com/api/v1/runtime/applications/your-app-slug/context?environment=Production" \
  -H "X-TenancyEngine-Api-Key: te_your_key_here"

5. Install an SDK (optional)

.NET apps can skip hand-written HTTP calls entirely. See SDKs for TenancyEngine.Sdk install instructions and working code samples.

Next steps