{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thebridge-dev/json-schema/thebridge-dev-create-tenant-request-dto-schema.json",
  "title": "CreateTenantRequestDto",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thebridge-dev-openapi.json#/components/schemas/CreateTenantRequestDto",
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "The plan must be present in the configured App business model"
    },
    "priceOffer": {
      "description": "If a specific pricing offer should be used. Use this if you offer the same plan in multiple periods or currencies. Otherwise the first price will be used",
      "allOf": [
        {
          "$ref": "#/$defs/PriceOffer"
        }
      ]
    },
    "owner": {
      "description": "A user will need to be assigned as an owner to this tenant. Either reused if the user already exist or a new user will be created",
      "allOf": [
        {
          "$ref": "#/$defs/TenantOwnerRequestDto"
        }
      ]
    },
    "name": {
      "type": "string",
      "description": "Name of the new tenant. Can also be set by tenant owner during onboarding"
    },
    "onboarded": {
      "type": "boolean",
      "description": "Is the tenant considered onboarded from start?"
    },
    "logo": {
      "type": "string",
      "description": "A url to a logo. Can also be set by tenant owner during onboarding"
    },
    "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.\nDefaults to 'en'"
    },
    "metadata": {
      "type": "object",
      "description": "Store metadata for your own business logic that will be returned in every Tenant response. This data will never be outputted to the end user"
    },
    "authOriginUrl": {
      "type": "string",
      "description": "Origin URL of the caller — used to resolve where email links (e.g. password reset) should point"
    },
    "signupMethod": {
      "type": "string",
      "description": "TBP-505 — how the tenant owner signed up (e.g. 'google', 'ms-azure-ad',\n'linkedin'). Set ONLY by the federation signup path so account can fire\nthe SignUp/Lead conversion tracking server-side — SSO signups never pass\nthrough the client-side signup page that fires them for email signups.\nDeliberately NOT in the import allowlist (TBP-43): imports must not fire\nconversion events.",
      "maxLength": 32
    }
  },
  "required": [
    "owner"
  ],
  "$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"
      ]
    },
    "PriceOffer": {
      "type": "object",
      "properties": {}
    },
    "TenantOwnerRequestDto": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "description": "Required",
          "format": "email"
        },
        "firstName": {
          "type": "string",
          "description": "The first name"
        },
        "lastName": {
          "type": "string",
          "description": "The last name"
        },
        "muteNotifications": {
          "type": "boolean",
          "description": "Set this variable to true if you don't wish to send out any notifications to the new user"
        },
        "customParams": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CustomParam"
          }
        }
      },
      "required": [
        "email"
      ]
    }
  }
}