{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mammoth-io/json-schema/mammoth-io-workspace-create-schema.json",
  "title": "WorkspaceCreate",
  "description": "Create workspace schema details",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mammoth-io-openapi.json#/components/schemas/WorkspaceCreate",
  "properties": {
    "name": {
      "type": "string",
      "title": "Name of the workspace",
      "description": "Name of the workspace to be created"
    },
    "user_email": {
      "type": "string",
      "format": "email",
      "title": "Email of the user",
      "description": "Email of the customer"
    },
    "plan_id": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Plan ID",
      "description": "Plan ID"
    },
    "payment_frequency": {
      "type": "string",
      "title": "Payment frequency of the workspace",
      "description": "Payment frequency of the workspace"
    },
    "storage_gb": {
      "oneOf": [
        {
          "type": "integer",
          "exclusiveMinimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Chosen TOTAL storage allocation in GB for the subscription",
      "description": "Chosen TOTAL storage allocation in GB for the subscription"
    },
    "origin": {
      "oneOf": [
        {
          "type": "string",
          "default": "DIRECT_SIGNUP"
        },
        {
          "type": "null"
        }
      ],
      "title": "Origin of the request",
      "description": "Origin of the request",
      "default": "DIRECT_SIGNUP"
    },
    "template": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Public-gallery template slug the sign-up came for",
      "description": "Public-gallery template slug the sign-up came for"
    },
    "anon_distinct_id": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Visitor's PostHog anonymous distinct id at signup",
      "description": "Visitor's PostHog anonymous distinct id at signup"
    },
    "landing_url": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Visitor's first-touch landing page URL",
      "description": "Visitor's first-touch landing page URL"
    },
    "referring_domain": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Visitor's first-touch referring domain",
      "description": "Visitor's first-touch referring domain"
    },
    "utm_source": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Visitor's first-touch utm_source",
      "description": "Visitor's first-touch utm_source"
    },
    "utm_medium": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Visitor's first-touch utm_medium",
      "description": "Visitor's first-touch utm_medium"
    },
    "utm_campaign": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Visitor's first-touch utm_campaign",
      "description": "Visitor's first-touch utm_campaign"
    },
    "gclid": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Visitor's first-touch Google Ads click id",
      "description": "Visitor's first-touch Google Ads click id"
    },
    "current_url": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "The page the visitor was on at the moment of signing up",
      "description": "The page the visitor was on at the moment of signing up"
    },
    "signup_channel": {
      "type": "string",
      "enum": [
        "cli",
        "mcp",
        "web"
      ],
      "title": "Where the sign-up started: cli, mcp or web (default)",
      "description": "Where the sign-up started: cli, mcp or web (default)",
      "default": "web"
    },
    "is_verified": {
      "type": "boolean",
      "title": "Is verified",
      "description": "Is verified",
      "default": true
    },
    "is_registration": {
      "type": "boolean",
      "title": "Is registration",
      "description": "Is registration",
      "default": false
    },
    "file_id": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "File ID of the file",
      "description": "File ID of the file"
    },
    "table_number": {
      "oneOf": [
        {
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Table number of the file",
      "description": "Table number of the file"
    },
    "plan_create": {
      "oneOf": [
        {
          "$ref": "#/$defs/CreatePlanRequestSchema"
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional plan payload. If provided, a plan will be created first and its ID used for the workspace subscription."
    }
  },
  "type": "object",
  "required": [
    "name",
    "payment_frequency",
    "user_email"
  ],
  "$defs": {
    "CreatePlanRequestSchema": {
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 128,
          "minLength": 2,
          "description": "Plan name"
        },
        "display_name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "maxLength": 128,
          "minLength": 2,
          "description": "Plan display name"
        },
        "monthly_price": {
          "type": "number",
          "minimum": 0.0,
          "description": "Monthly price in USD"
        },
        "description": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "maxLength": 500,
          "description": "Plan description"
        },
        "annual_price": {
          "oneOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "Annual price in USD"
        },
        "annual_only": {
          "type": "boolean",
          "description": "Whether plan is annual only",
          "default": false
        },
        "is_self_serve": {
          "type": "boolean",
          "description": "Whether users can self-subscribe"
        },
        "is_purchasable": {
          "type": "boolean",
          "description": "Whether a new customer may pick this plan",
          "default": true
        },
        "trial_days": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "maximum": 365,
          "description": "Trial period in days"
        },
        "storage_amount": {
          "type": "integer",
          "minimum": 0.0,
          "description": "Included storage in GB",
          "default": 0
        },
        "max_storage": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Maximum storage in GB"
        },
        "max_users": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "minimum": 1,
          "description": "Maximum number of users"
        },
        "no_of_users": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Number of included users"
        },
        "seat_price": {
          "oneOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "Price per additional user seat"
        },
        "number_of_tiers": {
          "type": "integer",
          "maximum": 10.0,
          "minimum": 1.0,
          "description": "Number of storage tiers",
          "default": 1
        },
        "storage_block_size": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "minimum": 1,
          "description": "Storage block size in GB"
        },
        "tiers": {
          "oneOf": [
            {
              "items": {
                "$ref": "#/$defs/subscription_schemas_StorageTierSchema"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "description": "Storage pricing tiers"
        },
        "uses_inline_pricing": {
          "type": "boolean",
          "description": "Bill this plan with composed price_data (plan price plus the chosen storage option) instead of stored Stripe prices",
          "default": false
        },
        "storage_options": {
          "oneOf": [
            {
              "items": {
                "$ref": "#/$defs/StorageOptionRequestSchema"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "description": "Purchasable storage sizes for inline-pricing plans"
        },
        "connector_profile_id": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "minimum": 1,
          "description": "Connector profile ID"
        },
        "feature_profile_id": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "minimum": 1,
          "description": "Feature profile ID"
        },
        "source_plan_id": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "minimum": 1,
          "description": "Copy entitlements from this plan: the new plan gets its own copies of the source's feature and connector profiles, and its trial and storage ladder unless the payload states them"
        }
      },
      "type": "object",
      "required": [
        "is_self_serve",
        "monthly_price",
        "name"
      ],
      "title": "CreatePlanRequestSchema"
    },
    "StorageOptionRequestSchema": {
      "properties": {
        "storage_gb": {
          "type": "integer",
          "maximum": 1000000.0,
          "exclusiveMinimum": 0.0,
          "description": "Total storage the option grants, in GB"
        },
        "monthly_price": {
          "type": "number",
          "minimum": 0.0,
          "description": "Monthly add in USD on top of the plan price"
        },
        "annual_price": {
          "type": "number",
          "minimum": 0.0,
          "description": "Annual add in USD on top of the plan price"
        }
      },
      "type": "object",
      "required": [
        "annual_price",
        "monthly_price",
        "storage_gb"
      ],
      "title": "StorageOptionRequestSchema"
    },
    "subscription_schemas_StorageTierSchema": {
      "properties": {
        "gb": {
          "type": "integer",
          "maximum": 10000.0,
          "minimum": 1.0,
          "exclusiveMinimum": 0.0,
          "description": "Storage amount in GB"
        },
        "price_per_gb": {
          "type": "number",
          "maximum": 100.0,
          "minimum": 0.0,
          "description": "Price per GB in USD"
        }
      },
      "type": "object",
      "required": [
        "gb",
        "price_per_gb"
      ],
      "title": "StorageTierSchema"
    }
  }
}