{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/karbonhq/json-schema/karbonhq-file-list-schema.json",
  "title": "FileList",
  "description": "A collection of files associated with an entity in Karbon",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/karbonhq-files-api-openapi.yml#/components/schemas/FileList",
  "type": "object",
  "properties": {
    "EntityKey": {
      "type": "string",
      "description": "The unique key of the entity the list of files is associated with"
    },
    "EntityType": {
      "type": "string",
      "enum": [
        "WorkItem",
        "Contact",
        "Organization"
      ],
      "description": "The type of entity the file list is associated with"
    },
    "TotalCount": {
      "type": "integer",
      "description": "The number of files matching the `$filter` expression, before `$skip` and `$top` are applied"
    },
    "Attachments": {
      "type": "array",
      "description": "An array of Files including a name, mimetype, size, creation timestamp and download url",
      "items": {
        "$ref": "#/$defs/FileListItem"
      }
    }
  },
  "$defs": {
    "FileListItem": {
      "description": "A single File",
      "type": "object",
      "properties": {
        "FileContextKey": {
          "type": "string",
          "description": "The unique key of the file"
        },
        "Source": {
          "type": "string",
          "enum": [
            "WorkItem",
            "Contact",
            "Organization"
          ],
          "description": "The type of entity the file was uploaded against"
        },
        "FileName": {
          "type": "string",
          "description": "The name of the file"
        },
        "FileSize": {
          "type": "integer",
          "description": "The size of the file in bytes"
        },
        "MimeType": {
          "type": "string",
          "description": "The mimetype of the uploaded file"
        },
        "DownloadUrl": {
          "type": "string",
          "description": "The API path than can be called to download the file"
        },
        "DateCreated": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp of when the file was created"
        },
        "IsArchived": {
          "type": "boolean",
          "description": "Whether the file has been archived"
        },
        "IsShared": {
          "type": "boolean",
          "description": "Whether the client can see the file. Files uploaded by a client, or attached to a Client Task, External Comment, Approval or eSignature, are always shared. Read-only."
        }
      }
    }
  }
}