{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thebridge-dev/json-schema/thebridge-dev-tenant-user-response-dto-schema.json",
  "title": "TenantUserResponseDto",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thebridge-dev-openapi.json#/components/schemas/TenantUserResponseDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Shared properties with AuthTenantUserResponseDto"
    },
    "role": {
      "type": "string",
      "description": "Role of the user. Grants a set of privileges. Privileges are configured on the `App` model."
    },
    "email": {
      "type": "string",
      "description": "Email address, same as username ATM"
    },
    "username": {
      "type": "string",
      "description": "Username, same as Email address ATM"
    },
    "firstName": {
      "type": "string",
      "description": "Users first name"
    },
    "lastName": {
      "type": "string",
      "description": "Users last name"
    },
    "fullName": {
      "type": "string",
      "description": "Users full name (first name and last name concatenated)"
    },
    "onboarded": {
      "type": "boolean",
      "description": "If user is onboarded or not (should be put through app onboarding). If `firstname` and `lastname` are set on invitation `onboarded` is set to true"
    },
    "consentsToPrivacyPolicy": {
      "type": "boolean",
      "description": "If user have left consent to the app privacy policy or not (should be set during app onboarding)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Custom properties different from AuthTenantUserResponseDto"
    },
    "teams": {
      "description": "Array of identifiers that can be used to group several users into teams or groups",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "createdAt": {
      "format": "date-time",
      "type": "string",
      "description": "Date when the user was created"
    },
    "lastSeen": {
      "format": "date-time",
      "type": "string",
      "description": "Any account activity: sign-in, token refresh, email verification or a credentials change. NOT a sign-in timestamp — use `lastSignIn` for that. Undefined if never seen."
    },
    "lastSignIn": {
      "format": "date-time",
      "type": "string",
      "description": "When the user last signed in. Undefined if never signed in. Account-wide: a user who belongs to several workspaces has one value across all of them. Use `lastWorkspaceSignIn` to scope it to this workspace."
    },
    "lastWorkspaceSignIn": {
      "format": "date-time",
      "type": "string",
      "description": "When the user last signed in to THIS workspace. Undefined if they have not signed in here since 2026-09-08, when the field shipped — it is not backfilled, because the historical data does not exist. Unlike `lastSignIn`, a user who belongs to several workspaces has a separate value per workspace. Token refresh does not move it."
    },
    "customParams": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CustomParam"
      }
    },
    "tenant": {
      "description": "Users tenant",
      "allOf": [
        {
          "$ref": "#/$defs/TenantResponseDto"
        }
      ]
    }
  },
  "required": [
    "id",
    "role",
    "email",
    "username",
    "onboarded",
    "consentsToPrivacyPolicy",
    "enabled",
    "teams",
    "createdAt",
    "lastSeen",
    "customParams",
    "tenant"
  ],
  "$defs": {
    "CustomParam": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "userLabel": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "email",
            "phone",
            "number",
            "integer",
            "text",
            "regex",
            "boolean"
          ]
        },
        "regex": {
          "type": "string"
        }
      },
      "required": [
        "value",
        "label",
        "type",
        "regex"
      ]
    },
    "TenantResponseDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Logical id reference to this instance"
        },
        "plan": {
          "type": "string",
          "description": "Name of the subscription plan. (Read only)\nUse `setPlanDetails` to change it\nAutomatically set by the payment service if tenant used the checkout process"
        },
        "mfa": {
          "type": "boolean",
          "description": "MFA enabled"
        },
        "paymentStatus": {
          "type": "object",
          "description": "Payment status"
        },
        "trial": {
          "type": "boolean",
          "description": "Tenant is trialing (Read only)"
        },
        "locale": {
          "type": "string",
          "description": "The default locale / lang code for all users in this tenant (`ISO_639-1` format).\nThis property will set the i18n for all platform emails and can be used to"
        },
        "name": {
          "type": "string",
          "description": "Name of the tenant. Undefined from the begining until the Tenant owner complets tenant onboarding."
        },
        "logo": {
          "type": "string",
          "description": "Url to a public accessible logo"
        },
        "metadata": {
          "type": "object",
          "description": "Store app specific meta data for this tenant"
        },
        "onboarded": {
          "type": "boolean",
          "description": "If this tenant is considered onboarded"
        },
        "federationConnection": {
          "type": "string",
          "description": "Logins are made with this enterprise login connection"
        },
        "signupBy": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string"
            },
            "firstName": {
              "type": "string"
            },
            "lastName": {
              "type": "string"
            }
          },
          "required": []
        },
        "createdAt": {
          "format": "date-time",
          "type": "string",
          "description": "Timestamp when created"
        }
      },
      "required": [
        "id",
        "mfa",
        "paymentStatus",
        "trial",
        "locale",
        "metadata",
        "onboarded",
        "createdAt"
      ]
    }
  }
}