Models
This page documents all data models returned by The Bridge API.
App Profile Model
Section titled “App Profile Model”{ "id": "624c14cc0c01e70033356282", "name": "My app", "domain": "MY_APP", "apiUrl": "http://localhost:3000", "uiUrl": "http://localhost:8100", "emailSenderName": "My App", "emailSenderEmail": "noreply@myapp.com", "webhookUrl": "http://api.example.com/webhook", "stripeEnabled": false, "paymentsAutoRedirect": true, "passkeysEnabled": true, "magicLinkEnabled": true, "mfaEnabled": true, "azureMarketplaceEnabled": false, "googleSsoEnabled": false, "azureAdSsoEnabled": true, "linkedinSsoEnabled": true, "githubSsoEnabled": true, "facebookSsoEnabled": true, "onboardingFlow": "B2B", "tenantSelfSignup": true, "cloudViews": true, "redirectUris": ["http://localhost:8080/auth/oauth-callback"], "defaultCallbackUri": "http://localhost:8080/auth/oauth-callback", "logo": "https://public.nblocks.dev/assets/logos/nblocks-logo-black.svg", "websiteUrl": "http://localhost", "privacyPolicyUrl": "", "termsOfServiceUrl": "", "accessTokenTTL": 3600, "refreshTokenTTL": 604800}| Property | Type | Description |
|---|---|---|
id | string | Unique ID (read only) |
name | string | Name of the app |
domain | string | Unique domain name (read only) |
apiUrl | string | URL to your API |
uiUrl | string | URL to your frontend app |
webhookUrl | string | Webhook events URL |
logo | string | URL to your logo |
websiteUrl | string | URL to your website |
privacyPolicyUrl | string | Privacy policy URL |
termsOfServiceUrl | string | Terms of service URL |
emailSenderName | string | Email sender name |
emailSenderEmail | string | Email sender address |
stripeEnabled | boolean | Stripe payments enabled |
paymentsAutoRedirect | boolean | Auto-redirect to plan selection |
passkeysEnabled | boolean | Passkey login enabled |
magicLinkEnabled | boolean | Magic-Link login enabled |
mfaEnabled | boolean | Multi-factor auth enabled |
googleSsoEnabled | boolean | Google SSO enabled |
azureAdSsoEnabled | boolean | Azure AD SSO enabled |
linkedinSsoEnabled | boolean | LinkedIn SSO enabled |
githubSsoEnabled | boolean | GitHub SSO enabled |
facebookSsoEnabled | boolean | Facebook SSO enabled |
onboardingFlow | OnboardingFlow | Onboarding configuration |
cloudViews | boolean | Use Bridge-provided UI |
tenantSelfSignup | boolean | Allow self-service signup |
redirectUris | string[] | Allowed redirect URIs |
defaultCallbackUri | string | Default callback URI |
accessTokenTTL | number | Access token lifetime (seconds) |
refreshTokenTTL | number | Refresh token lifetime (seconds) |
Credentials State Model
Section titled “Credentials State Model”{ "stripeCredentialsAdded": true, "azureMarketplaceCredentialsAdded": true, "azureAdSsoCredentialsAdded": false, "googleSsoCredentialsAdded": true}| Property | Type | Description |
|---|---|---|
stripeCredentialsAdded | boolean | Stripe keys exist |
azureMarketplaceCredentialsAdded | boolean | Azure Marketplace credentials exist |
azureAdSsoCredentialsAdded | boolean | Azure AD SSO credentials exist |
googleSsoCredentialsAdded | boolean | Google SSO credentials exist |
Tenant Model
Section titled “Tenant Model”{ "id": "624c14cc0c01e70033356285", "plan": "TEAM", "trial": false, "paymentStatus": { "shouldSelectPlan": false, "shouldSetupPayments": false, "provider": "STRIPE", "paymentsEnabled": true }, "mfa": false, "locale": "en", "name": "Nebulr AB", "logo": "https://example.com/logo.png", "metadata": {}, "onboarded": true, "signupBy": { "email": "john@example.com", "firstName": "John", "lastName": "Doe" }, "createdAt": "2022-04-05T10:07:08.235Z"}| Property | Type | Description |
|---|---|---|
id | string | Unique ID (read only) |
plan | string | Subscribed plan key |
trial | boolean | Currently trialing |
locale | string | Default locale (ISO 639-1) |
name | string | Tenant name |
logo | string | Logo URI |
mfa | boolean | MFA/2FA required |
paymentStatus | PaymentStatus | Current payment status |
metadata | Record | Custom key-value data |
onboarded | boolean | Onboarding completed |
federationConnection | string | Federation connection ID |
signupBy | object | Original owner info |
createdAt | string | Created timestamp (read only) |
Tenant Payment Status
Section titled “Tenant Payment Status”{ "shouldSelectPlan": false, "shouldSetupPayments": false, "provider": "STRIPE", "paymentsEnabled": true}| Property | Type | Description |
|---|---|---|
shouldSelectPlan | boolean | Tenant needs to select a plan |
shouldSetupPayments | boolean | Tenant needs to setup payments |
paymentsEnabled | boolean | Payment method has been set up |
provider | string | Payment provider used |
Tenant Payment Details
Section titled “Tenant Payment Details”{ "status": { "shouldSelectPlan": false, "shouldSetupPayments": true, "paymentsEnabled": true, "provider": "STRIPE" }, "details": { "plan": { "id": "6516f55b900518015dc98f3e", "key": "premium", "name": "Premium", "trial": true, "trialDays": 15, "prices": [ { "amount": 100, "currency": "EUR", "recurrenceInterval": "month" } ] }, "price": { "amount": 100, "currency": "EUR", "recurrenceInterval": "month" }, "trial": false, "trialDaysLeft": 0 }}| Property | Type | Description |
|---|---|---|
status | PaymentStatus | Current payment status |
details.plan | Plan | Subscribed plan |
details.price | Price | Active price |
details.trial | boolean | Currently trialing |
details.trialDaysLeft | number | Days until trial ends |
Tenant User Model
Section titled “Tenant User Model”{ "id": "63cad6ac48dcba47e9322853", "role": "OWNER", "email": "john.doe@example.com", "username": "john.doe@example.com", "firstName": "John", "lastName": "Doe", "fullName": "John Doe", "onboarded": true, "consentsToPrivacyPolicy": false, "enabled": true, "teams": ["cool_gang"], "lastSeen": "2023-01-20T18:00:12.489Z", "createdAt": "2023-01-20T18:00:12.489Z", "tenant": { "id": "624c14cc0c01e70033356285", "plan": "TEAM", "name": "Nebulr AB" }}| Property | Type | Description |
|---|---|---|
id | string | Unique ID (read only) |
role | string | User role key |
email | string | Email address |
username | string | Username |
firstName | string | First name |
lastName | string | Last name |
fullName | string | Full name (concatenated) |
onboarded | boolean | Onboarding completed |
consentsToPrivacyPolicy | boolean | Privacy policy consent |
enabled | boolean | Can login |
teams | string[] | Group identifiers |
lastSeen | string | Last activity (read only) |
createdAt | string | Created timestamp (read only) |
tenant | Tenant | The tenant |
Tokens Response
Section titled “Tokens Response”| Property | Type | Description |
|---|---|---|
token_type | string | Token type |
expires_in | number | Seconds before access_token expires |
access_token | string | JWT access token |
refresh_token | string | JWT refresh token |
id_token | string | JWT OpenID Connect profile |
user_profile | object | Decoded id_token (shorthand endpoint only) |
Access Token Model
Section titled “Access Token Model”Decoded JWT payload:
{ "sub": "63d25a9e0796d40008680f9a", "scope": "TENANT_WRITE TENANT_READ USER_WRITE USER_READ AUTHENTICATED", "role": "OWNER", "aid": "624c14cc0c01e70033356282", "tid": "63d25a9e0796d40008680f96", "plan": "Basic"}| Property | Type | Description |
|---|---|---|
sub | string | User ID |
scope | string | User privileges |
role | string | User role |
aid | string | App ID |
tid | string | Tenant ID |
plan | string | Tenant plan key |
ID Token Model
Section titled “ID Token Model”Decoded JWT payload:
{ "sub": "63d25a9e0796d40008680f9a", "name": "John Doe", "family_name": "Doe", "given_name": "John", "preferred_username": "john@example.com", "locale": "en", "email": "john@example.com", "email_verified": true, "onboarded": true, "tenant_id": "63d25a9e0796d40008680f96", "tenant_name": "Johns Family", "tenant_locale": "en", "tenant_logo": ""}| Property | Type | Description |
|---|---|---|
sub | string | User ID |
name | string | Full name |
family_name | string | Last name |
given_name | string | First name |
preferred_username | string | Username |
locale | string | Preferred locale |
email | string | Email address |
email_verified | boolean | Email verified |
onboarded | boolean | Onboarding completed |
tenant_id | string | Tenant ID |
tenant_name | string | Tenant name |
tenant_locale | string | Tenant locale |
tenant_logo | string | Tenant logo URI |
Access Role Model
Section titled “Access Role Model”{ "id": "6516a01891eca485bfc230ba", "name": "Owner", "key": "OWNER", "description": "The owner of the app", "privileges": [ { "id": "6516a0ee38183223122704e3", "key": "AUTHENTICATED", "description": "Privilege for all authenticated users" } ], "isDefault": false}| Property | Type | Description |
|---|---|---|
id | string | Unique ID (read only) |
name | string | Presentable label |
key | string | Unique key for reference |
description | string | Description text |
privileges | Privilege[] | Linked privileges |
isDefault | boolean | Applied to new users by default |
Access Privilege Model
Section titled “Access Privilege Model”{ "id": "6516a0ee38183223122704e3", "key": "AUTHENTICATED", "description": "Privilege for all authenticated users"}| Property | Type | Description |
|---|---|---|
id | string | Unique ID (read only) |
key | string | Key used for access evaluation |
description | string | Description text |
Federation Connection Model
Section titled “Federation Connection Model”{ "id": "6571edf9dc018000227ac449", "type": "saml", "name": "Foobar SAML", "clientId": "client_1234", "loginUrl": "https://idp.example.com/api/saml/sso", "certificate": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----", "requestMethod": "POST", "signedRequest": true, "signedRequestAlgorithm": "sha256", "createdAt": "2023-12-07T16:08:25.061Z"}| Property | Type | Description |
|---|---|---|
id | string | Unique ID (read only) |
type | string | Connection type (saml) |
name | string | Connection name |
clientId | string | IdP application identifier |
loginUrl | string | SAML request URL |
certificate | string | IdP public key certificate |
requestMethod | string | GET or POST |
signedRequest | boolean | Signed SAML requests |
signedRequestAlgorithm | string | sha256 or sha512 |
privateKey | string | Request signing private key |
createdAt | string | Created timestamp (read only) |
Plan Model
Section titled “Plan Model”{ "id": "650c548c29b15b62e681f28a", "key": "premium", "name": "Premium", "trial": true, "trialDays": 14, "prices": [ { "amount": 50, "currency": "EUR", "recurrenceInterval": "month" } ], "createdAt": "2023-09-21T14:34:52.248Z"}| Property | Type | Description |
|---|---|---|
id | string | Unique ID (read only) |
key | string | Unique plan key |
name | string | Plan name (visible to customers) |
trial | boolean | New subscribers start with trial |
trialDays | number | Days before trial expires |
prices | Price[] | Available prices |
createdAt | string | Created timestamp (read only) |
Price Model
Section titled “Price Model”{ "amount": 50, "currency": "EUR", "recurrenceInterval": "month"}| Property | Type | Description |
|---|---|---|
amount | number | Recurring charge amount |
currency | string | ISO 4217 currency code |
recurrenceInterval | string | day, week, month, or year |
Tax Model
Section titled “Tax Model”{ "id": "650c55b8ac7f396d770a98b1", "countryCode": "DE", "name": "VAT", "percentage": 19, "createdAt": "2023-09-21T14:39:52.816Z"}| Property | Type | Description |
|---|---|---|
id | string | Unique ID (read only) |
countryCode | string | Two-letter ISO country code |
name | string | Tax name (visible to customers) |
percentage | number | Tax percentage (0-100) |
createdAt | string | Created timestamp (read only) |
Feature Flag Evaluation Context
Section titled “Feature Flag Evaluation Context”Fields in bold are auto-resolved when providing an access token.
{ "user": { "id": "63d2ab029e23db0afb07a5a7", "role": "ADMIN", "name": "John Doe", "email": "john@doe.com", "key": "custom-user-trait" }, "tenant": { "id": "66238feb99227400774266f5", "plan": "PREMIUM", "name": "My Workspace", "key": "custom-tenant-trait" }, "device": { "key": "iphone" }, "custom": { "property1": "value1", "property2": "value2" }}| Property | Type | Description |
|---|---|---|
user.id | string | User ID |
user.email | string | User email |
user.role | string | User role |
user.name | string | User name |
user.key | string | Custom value |
tenant.id | string | Tenant ID |
tenant.plan | string | Tenant plan key |
tenant.name | string | Tenant name |
tenant.key | string | Custom value |
device.key | string | Device identifier |
custom.* | string | Custom key-value pairs |
Feature Flag Segment
Section titled “Feature Flag Segment”{ "id": "64c6400fdaf20f0008e71b25", "key": "admins", "description": "This segment targets admins", "targets": [ { "user": { "role": { "operator": "eq", "value": "ADMIN" } } } ]}| Property | Type | Description |
|---|---|---|
id | string | Unique ID (read only) |
key | string | Segment key |
description | string | Description text |
targets | Target[] | Matching targets (AND logic) |
Target Operators
Section titled “Target Operators”| Operator | Description |
|---|---|
eq | Equal to (==) |
beginsWith | Starts with value |
endsWith | Ends with value |
contains | Contains value |
lessThan | Less than value |
greaterThan | Greater than value |
Feature Flag Model
Section titled “Feature Flag Model”{ "id": "64c64cfb47418500082f60b5", "key": "iphone-feature", "description": "A feature for iPhones", "defaultValue": false, "segments": [ { "id": "64c63e7adaf20f0008e71b20", "key": "iphones" } ], "targetValue": true, "enabled": true}| Property | Type | Description |
|---|---|---|
id | string | Unique ID (read only) |
key | string | Flag key for evaluation |
description | string | Description text |
defaultValue | boolean | Value when no segment matches |
segments | Segment[] | Linked segments (OR logic) |
targetValue | boolean | Value when a segment matches |
enabled | boolean | Only enabled flags are evaluated |