{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/samva-dev/json-schema/samva-dev-attachment-list-schema.json",
  "title": "AttachmentList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/samva-dev-attachments-api-openapi.yml#/components/schemas/AttachmentList",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/$defs/AttachmentId"
          },
          "messageId": {
            "$ref": "#/$defs/MessageId"
          },
          "organizationId": {
            "$ref": "#/$defs/OrganizationId"
          },
          "filename": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "contentId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "isInline": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "messageId",
          "organizationId",
          "filename",
          "contentType",
          "size",
          "contentId",
          "isInline",
          "createdAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "items"
  ],
  "additionalProperties": false,
  "$defs": {
    "AttachmentId": {
      "type": "string",
      "pattern": "^att_[0-9a-hjkmnp-tv-z]{16,24}$",
      "x-samva-brand": "AttachmentId"
    },
    "MessageId": {
      "type": "string",
      "pattern": "^msg_[0-9a-hjkmnp-tv-z]{16,24}$",
      "x-samva-brand": "MessageId"
    },
    "OrganizationId": {
      "type": "string",
      "pattern": "^org_[0-9a-hjkmnp-tv-z]{16,24}$",
      "x-samva-brand": "OrganizationId"
    }
  }
}