{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getoneprofile-ai/json-schema/getoneprofile-ai-thumbs-down-create-schema-schema.json",
  "title": "ThumbsDownCreateSchema",
  "description": "A thumbs down: what was wrong with something an agent wrote.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getoneprofile-ai-agent-learnings-api-openapi.yml#/components/schemas/ThumbsDownCreateSchema",
  "properties": {
    "reason": {
      "description": "What is wrong, in the person's words. Required.",
      "maxLength": 1000,
      "title": "Reason",
      "type": "string"
    },
    "request_id": {
      "description": "The client's key for this thumbs down: sent again (a double click, a retry), it answers what the first one did and writes nothing.",
      "format": "uuid",
      "title": "Request Id",
      "type": "string"
    },
    "subject": {
      "description": "What it was given on. A `hand_edit` is a further note on the learning proposed from an edit (`POST /agent-learnings/hand-edits/`): it sharpens that learning and writes nothing again.",
      "oneOf": [
        {
          "$ref": "#/$defs/TableCellsSubjectSchema"
        },
        {
          "$ref": "#/$defs/AgentPreviewSubjectSchema"
        },
        {
          "$ref": "#/$defs/TaskSubjectSchema"
        },
        {
          "$ref": "#/$defs/WritingPreviewSubjectSchema"
        },
        {
          "$ref": "#/$defs/ReplyDraftSubjectSchema"
        },
        {
          "$ref": "#/$defs/SentMessageSubjectSchema"
        },
        {
          "$ref": "#/$defs/HandEditSubjectSchema"
        }
      ],
      "title": "Subject"
    }
  },
  "required": [
    "reason",
    "request_id",
    "subject"
  ],
  "type": "object",
  "$defs": {
    "AgentPreviewSubjectSchema": {
      "description": "One row of a table agent's Preview.",
      "properties": {
        "kind": {
          "const": "agent_preview",
          "title": "Kind",
          "type": "string"
        },
        "row_id": {
          "format": "uuid",
          "title": "Row Id",
          "type": "string"
        },
        "saved_agent_id": {
          "format": "uuid",
          "title": "Saved Agent Id",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "saved_agent_id",
        "row_id"
      ],
      "title": "AgentPreviewSubjectSchema",
      "type": "object"
    },
    "HandEditSubjectSchema": {
      "description": "A person's own edit of one message the agent wrote, by where the words stand.",
      "properties": {
        "kind": {
          "const": "hand_edit",
          "title": "Kind",
          "type": "string"
        },
        "target": {
          "oneOf": [
            {
              "$ref": "#/$defs/TaskTargetSchema"
            },
            {
              "$ref": "#/$defs/MessageTargetSchema"
            },
            {
              "$ref": "#/$defs/OverrideTargetSchema"
            },
            {
              "$ref": "#/$defs/ReplyDraftTargetSchema"
            }
          ],
          "title": "Target"
        }
      },
      "required": [
        "kind",
        "target"
      ],
      "title": "HandEditSubjectSchema",
      "type": "object"
    },
    "MessageTargetSchema": {
      "description": "One message the agent wrote that has not gone out: a follow-up, or a Builder message.",
      "properties": {
        "message_id": {
          "format": "uuid",
          "title": "Message Id",
          "type": "string"
        },
        "target_kind": {
          "const": "message",
          "title": "Target Kind",
          "type": "string"
        }
      },
      "required": [
        "target_kind",
        "message_id"
      ],
      "title": "MessageTargetSchema",
      "type": "object"
    },
    "OverrideTargetSchema": {
      "description": "One contact's own words for one step, saved over the agent's sample in the Builder.",
      "properties": {
        "record_id": {
          "format": "uuid",
          "title": "Record Id",
          "type": "string"
        },
        "sequence_id": {
          "format": "uuid",
          "title": "Sequence Id",
          "type": "string"
        },
        "step_id": {
          "format": "uuid",
          "title": "Step Id",
          "type": "string"
        },
        "target_kind": {
          "const": "override",
          "title": "Target Kind",
          "type": "string"
        }
      },
      "required": [
        "target_kind",
        "sequence_id",
        "step_id",
        "record_id"
      ],
      "title": "OverrideTargetSchema",
      "type": "object"
    },
    "ReplyDraftSubjectSchema": {
      "description": "A reply draft on the Inbox ribbon.",
      "properties": {
        "draft_id": {
          "format": "uuid",
          "title": "Draft Id",
          "type": "string"
        },
        "kind": {
          "const": "reply_draft",
          "title": "Kind",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "draft_id"
      ],
      "title": "ReplyDraftSubjectSchema",
      "type": "object"
    },
    "ReplyDraftTargetSchema": {
      "description": "A reply draft on the Inbox ribbon, its words edited in the composer.",
      "properties": {
        "draft_id": {
          "format": "uuid",
          "title": "Draft Id",
          "type": "string"
        },
        "target_kind": {
          "const": "reply_draft",
          "title": "Target Kind",
          "type": "string"
        }
      },
      "required": [
        "target_kind",
        "draft_id"
      ],
      "title": "ReplyDraftTargetSchema",
      "type": "object"
    },
    "SentMessageSubjectSchema": {
      "description": "A message the agent wrote that went out.",
      "properties": {
        "kind": {
          "const": "sent_message",
          "title": "Kind",
          "type": "string"
        },
        "message_id": {
          "format": "uuid",
          "title": "Message Id",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "message_id"
      ],
      "title": "SentMessageSubjectSchema",
      "type": "object"
    },
    "TableCellsSubjectSchema": {
      "description": "Cells of one agent column.",
      "properties": {
        "column_id": {
          "format": "uuid",
          "title": "Column Id",
          "type": "string"
        },
        "kind": {
          "const": "table_cells",
          "title": "Kind",
          "type": "string"
        },
        "record_ids": {
          "items": {
            "format": "uuid",
            "type": "string"
          },
          "maxItems": 50,
          "minItems": 1,
          "title": "Record Ids",
          "type": "array"
        },
        "table_id": {
          "format": "uuid",
          "title": "Table Id",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "table_id",
        "column_id",
        "record_ids"
      ],
      "title": "TableCellsSubjectSchema",
      "type": "object"
    },
    "TaskSubjectSchema": {
      "description": "A task's card, and the message on it the person read.",
      "properties": {
        "kind": {
          "const": "task",
          "title": "Kind",
          "type": "string"
        },
        "outbound_message_id": {
          "format": "uuid",
          "title": "Outbound Message Id",
          "type": "string"
        },
        "task_id": {
          "format": "uuid",
          "title": "Task Id",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "task_id",
        "outbound_message_id"
      ],
      "title": "TaskSubjectSchema",
      "type": "object"
    },
    "TaskTargetSchema": {
      "description": "A Tasks card's words, and the agent's message they were written from.",
      "properties": {
        "outbound_message_id": {
          "format": "uuid",
          "title": "Outbound Message Id",
          "type": "string"
        },
        "target_kind": {
          "const": "task",
          "title": "Target Kind",
          "type": "string"
        },
        "task_id": {
          "format": "uuid",
          "title": "Task Id",
          "type": "string"
        }
      },
      "required": [
        "target_kind",
        "task_id",
        "outbound_message_id"
      ],
      "title": "TaskTargetSchema",
      "type": "object"
    },
    "WritingPreviewSubjectSchema": {
      "description": "One contact of a sequence's AI writing Preview.",
      "properties": {
        "kind": {
          "const": "writing_preview",
          "title": "Kind",
          "type": "string"
        },
        "record_id": {
          "format": "uuid",
          "title": "Record Id",
          "type": "string"
        },
        "sequence_id": {
          "format": "uuid",
          "title": "Sequence Id",
          "type": "string"
        },
        "step_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The step whose Preview the note is given on. The contact's session covers every step, so the learner reads the note as about this one; the note itself is kept as typed.",
          "title": "Step Id"
        }
      },
      "required": [
        "kind",
        "sequence_id",
        "record_id"
      ],
      "title": "WritingPreviewSubjectSchema",
      "type": "object"
    }
  }
}