{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/narmi/main/json-schema/narmi-thread-create-request-schema.json",
  "title": "ThreadCreateRequest",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/narmi-threads-api-openapi.yml#/components/schemas/ThreadCreateRequest",
  "type": "object",
  "properties": {
    "subject": {
      "type": "string",
      "minLength": 1,
      "description": "Subject of the thread.",
      "maxLength": 100
    },
    "body": {
      "type": "string",
      "minLength": 1,
      "description": "Text content of the initial message for this thread."
    },
    "file": {
      "allOf": [
        {
          "$ref": "#/$defs/ThreadFileRequest"
        }
      ],
      "description": "File to upload to this thread. Must include both 'url' and 'signature'."
    },
    "team_uuid": {
      "type": "string",
      "minLength": 1,
      "description": "Identifier for relevant team."
    }
  },
  "required": [
    "subject"
  ],
  "x-stoplight": {
    "id": "ygl8gsxdgfoq9"
  },
  "$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"
      }
    }
  }
}