{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/narmi/main/json-schema/narmi-message-create-request-schema.json",
  "title": "MessageCreateRequest",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/narmi-threads-api-openapi.yml#/components/schemas/MessageCreateRequest",
  "type": "object",
  "properties": {
    "body": {
      "type": "string",
      "minLength": 1,
      "description": "Text content of the message; should not be specified with the `file` parameter."
    },
    "file": {
      "allOf": [
        {
          "$ref": "#/$defs/ThreadFileRequest"
        }
      ],
      "writeOnly": true,
      "description": "File to upload to this message. Must include both 'url' and 'signature'."
    },
    "internal_note": {
      "type": "boolean",
      "default": false,
      "description": "Text which should only be visible to FI staff members."
    }
  },
  "x-stoplight": {
    "id": "eeyyxym9jkngz"
  },
  "$defs": {
    "ThreadFileRequest": {
      "type": "object",
      "description": "Serializer for file uploads to threads that validates both URL and signature.",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "minLength": 1,
          "pattern": "^https://production-sandbox-uploads\\.s3(?:[.-][a-z0-9-]+)?\\.amazonaws\\.com/original/support/[A-Za-z0-9]{24,}/"
        },
        "signature": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "signature",
        "url"
      ],
      "x-stoplight": {
        "id": "tl2ecehruzowj"
      }
    }
  }
}