Skip to content

Models

This page documents all data models returned by The Bridge API.


{
"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
}
PropertyTypeDescription
idstringUnique ID (read only)
namestringName of the app
domainstringUnique domain name (read only)
apiUrlstringURL to your API
uiUrlstringURL to your frontend app
webhookUrlstringWebhook events URL
logostringURL to your logo
websiteUrlstringURL to your website
privacyPolicyUrlstringPrivacy policy URL
termsOfServiceUrlstringTerms of service URL
emailSenderNamestringEmail sender name
emailSenderEmailstringEmail sender address
stripeEnabledbooleanStripe payments enabled
paymentsAutoRedirectbooleanAuto-redirect to plan selection
passkeysEnabledbooleanPasskey login enabled
magicLinkEnabledbooleanMagic-Link login enabled
mfaEnabledbooleanMulti-factor auth enabled
googleSsoEnabledbooleanGoogle SSO enabled
azureAdSsoEnabledbooleanAzure AD SSO enabled
linkedinSsoEnabledbooleanLinkedIn SSO enabled
githubSsoEnabledbooleanGitHub SSO enabled
facebookSsoEnabledbooleanFacebook SSO enabled
onboardingFlowOnboardingFlowOnboarding configuration
cloudViewsbooleanUse Bridge-provided UI
tenantSelfSignupbooleanAllow self-service signup
redirectUrisstring[]Allowed redirect URIs
defaultCallbackUristringDefault callback URI
accessTokenTTLnumberAccess token lifetime (seconds)
refreshTokenTTLnumberRefresh token lifetime (seconds)

{
"stripeCredentialsAdded": true,
"azureMarketplaceCredentialsAdded": true,
"azureAdSsoCredentialsAdded": false,
"googleSsoCredentialsAdded": true
}
PropertyTypeDescription
stripeCredentialsAddedbooleanStripe keys exist
azureMarketplaceCredentialsAddedbooleanAzure Marketplace credentials exist
azureAdSsoCredentialsAddedbooleanAzure AD SSO credentials exist
googleSsoCredentialsAddedbooleanGoogle SSO credentials exist

{
"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"
}
PropertyTypeDescription
idstringUnique ID (read only)
planstringSubscribed plan key
trialbooleanCurrently trialing
localestringDefault locale (ISO 639-1)
namestringTenant name
logostringLogo URI
mfabooleanMFA/2FA required
paymentStatusPaymentStatusCurrent payment status
metadataRecordCustom key-value data
onboardedbooleanOnboarding completed
federationConnectionstringFederation connection ID
signupByobjectOriginal owner info
createdAtstringCreated timestamp (read only)

{
"shouldSelectPlan": false,
"shouldSetupPayments": false,
"provider": "STRIPE",
"paymentsEnabled": true
}
PropertyTypeDescription
shouldSelectPlanbooleanTenant needs to select a plan
shouldSetupPaymentsbooleanTenant needs to setup payments
paymentsEnabledbooleanPayment method has been set up
providerstringPayment provider used

{
"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
}
}
PropertyTypeDescription
statusPaymentStatusCurrent payment status
details.planPlanSubscribed plan
details.pricePriceActive price
details.trialbooleanCurrently trialing
details.trialDaysLeftnumberDays until trial ends

{
"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"
}
}
PropertyTypeDescription
idstringUnique ID (read only)
rolestringUser role key
emailstringEmail address
usernamestringUsername
firstNamestringFirst name
lastNamestringLast name
fullNamestringFull name (concatenated)
onboardedbooleanOnboarding completed
consentsToPrivacyPolicybooleanPrivacy policy consent
enabledbooleanCan login
teamsstring[]Group identifiers
lastSeenstringLast activity (read only)
createdAtstringCreated timestamp (read only)
tenantTenantThe tenant

PropertyTypeDescription
token_typestringToken type
expires_innumberSeconds before access_token expires
access_tokenstringJWT access token
refresh_tokenstringJWT refresh token
id_tokenstringJWT OpenID Connect profile
user_profileobjectDecoded id_token (shorthand endpoint only)

Decoded JWT payload:

{
"sub": "63d25a9e0796d40008680f9a",
"scope": "TENANT_WRITE TENANT_READ USER_WRITE USER_READ AUTHENTICATED",
"role": "OWNER",
"aid": "624c14cc0c01e70033356282",
"tid": "63d25a9e0796d40008680f96",
"plan": "Basic"
}
PropertyTypeDescription
substringUser ID
scopestringUser privileges
rolestringUser role
aidstringApp ID
tidstringTenant ID
planstringTenant plan key

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": ""
}
PropertyTypeDescription
substringUser ID
namestringFull name
family_namestringLast name
given_namestringFirst name
preferred_usernamestringUsername
localestringPreferred locale
emailstringEmail address
email_verifiedbooleanEmail verified
onboardedbooleanOnboarding completed
tenant_idstringTenant ID
tenant_namestringTenant name
tenant_localestringTenant locale
tenant_logostringTenant logo URI

{
"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
}
PropertyTypeDescription
idstringUnique ID (read only)
namestringPresentable label
keystringUnique key for reference
descriptionstringDescription text
privilegesPrivilege[]Linked privileges
isDefaultbooleanApplied to new users by default

{
"id": "6516a0ee38183223122704e3",
"key": "AUTHENTICATED",
"description": "Privilege for all authenticated users"
}
PropertyTypeDescription
idstringUnique ID (read only)
keystringKey used for access evaluation
descriptionstringDescription text

{
"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"
}
PropertyTypeDescription
idstringUnique ID (read only)
typestringConnection type (saml)
namestringConnection name
clientIdstringIdP application identifier
loginUrlstringSAML request URL
certificatestringIdP public key certificate
requestMethodstringGET or POST
signedRequestbooleanSigned SAML requests
signedRequestAlgorithmstringsha256 or sha512
privateKeystringRequest signing private key
createdAtstringCreated timestamp (read only)

{
"id": "650c548c29b15b62e681f28a",
"key": "premium",
"name": "Premium",
"trial": true,
"trialDays": 14,
"prices": [
{ "amount": 50, "currency": "EUR", "recurrenceInterval": "month" }
],
"createdAt": "2023-09-21T14:34:52.248Z"
}
PropertyTypeDescription
idstringUnique ID (read only)
keystringUnique plan key
namestringPlan name (visible to customers)
trialbooleanNew subscribers start with trial
trialDaysnumberDays before trial expires
pricesPrice[]Available prices
createdAtstringCreated timestamp (read only)

{
"amount": 50,
"currency": "EUR",
"recurrenceInterval": "month"
}
PropertyTypeDescription
amountnumberRecurring charge amount
currencystringISO 4217 currency code
recurrenceIntervalstringday, week, month, or year

{
"id": "650c55b8ac7f396d770a98b1",
"countryCode": "DE",
"name": "VAT",
"percentage": 19,
"createdAt": "2023-09-21T14:39:52.816Z"
}
PropertyTypeDescription
idstringUnique ID (read only)
countryCodestringTwo-letter ISO country code
namestringTax name (visible to customers)
percentagenumberTax percentage (0-100)
createdAtstringCreated timestamp (read only)

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"
}
}
PropertyTypeDescription
user.idstringUser ID
user.emailstringUser email
user.rolestringUser role
user.namestringUser name
user.keystringCustom value
tenant.idstringTenant ID
tenant.planstringTenant plan key
tenant.namestringTenant name
tenant.keystringCustom value
device.keystringDevice identifier
custom.*stringCustom key-value pairs

{
"id": "64c6400fdaf20f0008e71b25",
"key": "admins",
"description": "This segment targets admins",
"targets": [
{
"user": {
"role": {
"operator": "eq",
"value": "ADMIN"
}
}
}
]
}
PropertyTypeDescription
idstringUnique ID (read only)
keystringSegment key
descriptionstringDescription text
targetsTarget[]Matching targets (AND logic)
OperatorDescription
eqEqual to (==)
beginsWithStarts with value
endsWithEnds with value
containsContains value
lessThanLess than value
greaterThanGreater than value

{
"id": "64c64cfb47418500082f60b5",
"key": "iphone-feature",
"description": "A feature for iPhones",
"defaultValue": false,
"segments": [
{
"id": "64c63e7adaf20f0008e71b20",
"key": "iphones"
}
],
"targetValue": true,
"enabled": true
}
PropertyTypeDescription
idstringUnique ID (read only)
keystringFlag key for evaluation
descriptionstringDescription text
defaultValuebooleanValue when no segment matches
segmentsSegment[]Linked segments (OR logic)
targetValuebooleanValue when a segment matches
enabledbooleanOnly enabled flags are evaluated