{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/doorloop/json-schema/doorloop-file-schema.json",
  "title": "file",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/doorloop-files-api-openapi.yml#/components/schemas/file",
  "x-stoplight": {
    "id": "1125csq7d6u3b"
  },
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/mongoId"
    },
    "name": {
      "type": "string",
      "description": "The name of the file. Must be a valid unix file name.",
      "maxLength": 255
    },
    "notes": {
      "type": "string"
    },
    "linkedResource": {
      "$ref": "#/$defs/fileLinkedResource"
    },
    "tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/mongoId"
      }
    },
    "size": {
      "type": "number"
    },
    "mimeType": {
      "type": "string"
    },
    "createdBy": {
      "type": "string"
    },
    "createdAt": {
      "type": "string"
    },
    "downloadUrl": {
      "type": "string",
      "description": "Read Only. References the URL from which this file can be downloaded"
    }
  },
  "required": [
    "name",
    "linkedResource"
  ],
  "$defs": {
    "fileLinkedResource": {
      "title": "fileLinkedResource",
      "x-stoplight": {
        "id": "tdd2wdxg0yyjm"
      },
      "type": "object",
      "description": "",
      "properties": {
        "resourceId": {
          "$ref": "#/$defs/mongoId"
        },
        "resourceType": {
          "type": "string",
          "enum": [
            "TENANT",
            "OWNER",
            "VENDOR",
            "PROPERTY",
            "UNIT",
            "LEASE",
            "LEASE_DRAFT",
            "TASK",
            "RENTAL_APPLICATION",
            "BILL",
            "BILL_PAYMENT",
            "VENDOR_CREDIT",
            "NOTE",
            "INSURANCE_POLICY",
            "COMMUNICATION"
          ]
        }
      },
      "required": [
        "resourceId",
        "resourceType"
      ]
    },
    "mongoId": {
      "type": "string",
      "title": "mongoId",
      "x-stoplight": {
        "id": "40j7qlmpihfdj"
      },
      "pattern": "/^[a-f\\d]{24}$/i"
    }
  }
}