{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/assetlab-ca/json-schema/assetlab-ca-asset-create-schema.json",
  "title": "AssetCreate",
  "description": "`qr_code`, `risk_score`, `financial_impact`, `archived_at`, `archived_by`,\n`archived_previous_status_id` and other derived fields are read-only and are\nsilently stripped if sent. To archive an asset, set `status_id` to the Archived\nstatus; to restore it, set `status_id` back to `archived_previous_status_id`.\n",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/assetlab-ca-openapi.yaml#/components/schemas/AssetCreate",
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 500
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 5000
    },
    "asset_id": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 100,
      "description": "Your own asset code/tag. Free text, not the AssetLab UUID."
    },
    "asset_type_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "manufacturer_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "model": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 500
    },
    "serial_number": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 200
    },
    "purchase_cost": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "description": "Money in the organization's currency - GET /v1/organization-settings for currency_code"
    },
    "replacement_value": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "description": "Cost to replace this asset today, in current dollars as recorded. NOT escalated, unlike purchase_cost, which is aged forward from purchase_date. Money in the organization's currency - GET /v1/organization-settings for currency_code"
    },
    "replacement_value_reviewed_on": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "description": "Date replacement_value was last confirmed. Informational only - the value is never indexed forward from it."
    },
    "purchase_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "expected_lifetime_years": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0
    },
    "condition_score": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "maximum": 100
    },
    "risk_factor": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "CRITICAL",
        "HIGH",
        "MEDIUM",
        "LOW"
      ]
    },
    "status_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "GET /v1/asset-statuses. Setting the status whose system_key is archived archives the asset; setting any other status restores it."
    },
    "image_url": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000
    },
    "site_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "building_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "location_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "system_class_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "system_group_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "system_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "last_maintenance_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "quantity": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0
    },
    "unit_of_measure": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 100
    },
    "unit_replacement_value": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "description": "Money in the organization's currency - GET /v1/organization-settings for currency_code"
    },
    "cost_per_sq_ft": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "description": "Money in the organization's currency - GET /v1/organization-settings for currency_code"
    },
    "salvage_value": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "description": "Money in the organization's currency - GET /v1/organization-settings for currency_code"
    },
    "salvage_value_percentage": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "maximum": 100
    },
    "safety_impact": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "LOW",
        "MEDIUM",
        "HIGH",
        "CRITICAL"
      ]
    },
    "service_impact": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "LOW",
        "MEDIUM",
        "HIGH",
        "CRITICAL"
      ]
    },
    "environmental_impact": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "LOW",
        "MEDIUM",
        "HIGH",
        "CRITICAL"
      ]
    },
    "regulatory_impact": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "LOW",
        "MEDIUM",
        "HIGH",
        "CRITICAL"
      ]
    },
    "reputation_impact": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "LOW",
        "MEDIUM",
        "HIGH",
        "CRITICAL"
      ]
    },
    "consequence_of_failure_score": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 5,
      "description": "Setting it marks it a manual value that a system change no longer replaces; null returns it to the default from its system."
    },
    "likelihood_of_failure_score": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 5,
      "description": "Derived from condition_score unless set. Setting it marks it a manual value that condition changes no longer replace; null returns it to derivation."
    },
    "current_meter_reading": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "description": "Current meter/odometer reading"
    },
    "meter_unit": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 50,
      "description": "Meter unit (km, miles, hours, cycles)"
    },
    "archived_reason": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "replaced",
        "disposed",
        "sold",
        "transferred",
        "other"
      ],
      "description": "Why it was archived. Kept only while the asset is archived."
    }
  }
}