{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/revyl/json-schema/revyl-atlas-session-grounded-annotation-thread-create-request-schema.json",
  "title": "AtlasSessionGroundedAnnotationThreadCreateRequest",
  "description": "Create a grounded annotation thread addressed by device session.\n\nThe caller names the session it is driving and a natural-language visual\ntarget; the server resolves the evidence observation (newest screenshot\nfor the session, or for ``action_id``/``screenshot_role`` when given), so\nno Atlas identifiers are required.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/revyl-app-atlas-api-openapi.yml#/components/schemas/AtlasSessionGroundedAnnotationThreadCreateRequest",
  "properties": {
    "action_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Pin to a specific report action's screenshot instead of the session's newest capture.",
      "title": "Action Id"
    },
    "body": {
      "maxLength": 10000,
      "minLength": 1,
      "title": "Body",
      "type": "string"
    },
    "client_request_id": {
      "description": "Client-generated UUID making retried submissions idempotent.",
      "format": "uuid",
      "title": "Client Request Id",
      "type": "string"
    },
    "mentions": {
      "items": {
        "$ref": "#/$defs/AtlasAnnotationMentionInput"
      },
      "maxItems": 10,
      "title": "Mentions",
      "type": "array"
    },
    "preview_receipt": {
      "anyOf": [
        {
          "maxLength": 256,
          "minLength": 32,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Short-lived receipt from the session preview endpoint. When set, creation uses the exact reviewed observation and coordinates.",
      "title": "Preview Receipt"
    },
    "screenshot_role": {
      "default": "after",
      "description": "Which of the action's screenshots to pin; only applied when action_id is given.",
      "enum": [
        "before",
        "after"
      ],
      "title": "Screenshot Role",
      "type": "string"
    },
    "severity": {
      "anyOf": [
        {
          "$ref": "#/$defs/AtlasAnnotationSeverity"
        },
        {
          "type": "null"
        }
      ]
    },
    "target": {
      "maxLength": 500,
      "minLength": 1,
      "title": "Target",
      "type": "string"
    }
  },
  "required": [
    "body",
    "target",
    "client_request_id"
  ],
  "type": "object",
  "$defs": {
    "AtlasAnnotationMentionInput": {
      "properties": {
        "end_utf16": {
          "exclusiveMinimum": 0.0,
          "title": "End Utf16",
          "type": "integer"
        },
        "start_utf16": {
          "minimum": 0.0,
          "title": "Start Utf16",
          "type": "integer"
        },
        "user_id": {
          "maxLength": 200,
          "minLength": 1,
          "title": "User Id",
          "type": "string"
        }
      },
      "required": [
        "user_id",
        "start_utf16",
        "end_utf16"
      ],
      "title": "AtlasAnnotationMentionInput",
      "type": "object"
    },
    "AtlasAnnotationSeverity": {
      "description": "Finding severity. Presence marks a thread as a ranked finding;\na thread without severity is a plain conversation.",
      "enum": [
        "blocker",
        "issue",
        "polish"
      ],
      "title": "AtlasAnnotationSeverity",
      "type": "string"
    }
  }
}