{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/collectly/json-schema/collectly-user-schema.json",
  "title": "User",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/collectly-users-api-openapi.yml#/components/schemas/User",
  "properties": {
    "active": {
      "default": false,
      "type": "boolean"
    },
    "allowed_clients": {
      "items": {
        "format": "int32",
        "type": "integer"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "company": {
      "allOf": [
        {
          "$ref": "#/$defs/CompanyProfile"
        }
      ],
      "readOnly": true
    },
    "confirmed_at": {},
    "created_at": {
      "readOnly": true
    },
    "email": {
      "format": "email",
      "type": "string"
    },
    "external_id": {
      "type": "string"
    },
    "first_name": {
      "type": "string"
    },
    "id": {
      "readOnly": true,
      "type": "string"
    },
    "last_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "password": {
      "type": "string",
      "writeOnly": true
    },
    "phone": {
      "maxLength": 20,
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "email",
    "first_name",
    "password"
  ],
  "type": "object",
  "$defs": {
    "CompanyProfile": {
      "properties": {
        "address": {
          "type": [
            "string",
            "null"
          ]
        },
        "allow_smart_retries": {
          "type": "boolean"
        },
        "allow_users_edit_pp": {
          "type": "boolean"
        },
        "auto_approve_rules": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "city": {
          "type": [
            "string",
            "null"
          ]
        },
        "collectly_activated": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "company_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "country_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "hide_access_codes": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "hide_appointments": {
          "type": "boolean"
        },
        "hide_dashboard_user": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "id": {
          "readOnly": true,
          "type": "string"
        },
        "is_2fa_enforced": {
          "type": "boolean"
        },
        "is_template": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "logo_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "salesforce_account_id": {
          "maxLength": 1024,
          "readOnly": true,
          "type": [
            "string",
            "null"
          ]
        },
        "sidebar_logout_timeout_minutes": {
          "format": "int32",
          "type": [
            "integer",
            "null"
          ]
        },
        "state": {
          "type": [
            "string",
            "null"
          ]
        },
        "zip_code": {
          "maxLength": 20,
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    }
  }
}