{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/algotradertools/json-schema/algotradertools-copy-event-list-schema.json",
  "title": "CopyEventList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/algotradertools-copy-events-api-openapi.yml#/components/schemas/CopyEventList",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "list"
      ],
      "description": "Always `list`."
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CopyEvent"
      },
      "description": "Newest first."
    },
    "has_more": {
      "type": "boolean",
      "description": "Whether there's another page: pass `next_cursor` as `cursor`."
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "The cursor of the next page; null on the last one."
    }
  },
  "required": [
    "object",
    "data",
    "has_more",
    "next_cursor"
  ],
  "$defs": {
    "CopyEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "object": {
          "type": "string",
          "enum": [
            "copy_event"
          ],
          "description": "What this object is."
        },
        "follower_id": {
          "type": "string",
          "description": "The follower it happened on.",
          "format": "uuid"
        },
        "account_id": {
          "type": "string",
          "description": "That follower's account.",
          "format": "uuid"
        },
        "master_ticket": {
          "type": "integer",
          "description": "The master position it's about."
        },
        "action": {
          "type": "string",
          "enum": [
            "open",
            "close",
            "partial_close",
            "modify",
            "skip",
            "adopt",
            "place",
            "cancel"
          ],
          "description": "`open`, `close`, `partial_close`, `modify` (stop loss or take profit, or a pending order moved), `skip` (decided not to copy; see `message`), `adopt` (took over a copy it found on the follower after a restart), `place` (placed a pending order for the master's) or `cancel` (cancelled one)."
        },
        "ok": {
          "type": "boolean",
          "description": "Whether it worked."
        },
        "message": {
          "type": "string"
        },
        "detail": {
          "type": "object",
          "additionalProperties": true,
          "description": "The request and the terminal's answer. Keys vary by action, for example `symbol`, `side`, `volume`, `price`, `ticket`, `stopLoss`, `takeProfit`, `retcode` and `outcome`."
        },
        "received_at": {
          "type": "string",
          "description": "When the engine heard about the master's change.",
          "format": "date-time"
        },
        "engine_ms": {
          "type": [
            "number",
            "null"
          ],
          "description": "The engine's own time to the order going out."
        },
        "execution_ms": {
          "type": [
            "number",
            "null"
          ],
          "description": "The follower broker's time to answer the order."
        },
        "total_ms": {
          "type": [
            "number",
            "null"
          ],
          "description": "Both together."
        }
      },
      "description": "One thing the copier engine did, or decided not to do, on a follower.",
      "required": [
        "id",
        "object",
        "follower_id",
        "account_id",
        "master_ticket",
        "action",
        "ok",
        "message",
        "detail",
        "received_at",
        "engine_ms",
        "execution_ms",
        "total_ms"
      ]
    }
  }
}