{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/alpaca/json-schema/alpaca-journal-status-event-schema.json",
  "title": "JournalStatusEvent",
  "description": "Represents a change in a Journal's status, sent over the events streaming api.\n",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/alpaca-events-api-openapi.yml#/components/schemas/JournalStatusEvent",
  "type": "object",
  "properties": {
    "at": {
      "type": "string",
      "minLength": 1,
      "description": "Timestamp of event",
      "format": "date-time"
    },
    "entry_type": {
      "$ref": "#/$defs/JournalEntryType"
    },
    "event_id": {
      "type": "integer",
      "description": "Monotonically increasing 64bit integer"
    },
    "journal_id": {
      "type": "string",
      "description": "The UUID of the related Journal",
      "format": "uuid"
    },
    "status_from": {
      "$ref": "#/$defs/JournalStatus"
    },
    "status_to": {
      "$ref": "#/$defs/JournalStatus"
    }
  },
  "required": [
    "at",
    "entry_type",
    "event_id",
    "journal_id",
    "status_from",
    "status_to"
  ],
  "$defs": {
    "JournalEntryType": {
      "type": "string",
      "title": "",
      "description": "This enum represents the various kinds of Journal alpaca supports.\n\nCurrent values are:\n\n- **JNLC**\n\n  Journal Cash between accounts\n\n- **JNLS**\n\n  Journal Securities between accounts",
      "enum": [
        "JNLC",
        "JNLS"
      ]
    },
    "JournalStatus": {
      "type": "string",
      "enum": [
        "pending",
        "canceled",
        "executed",
        "queued",
        "rejected",
        "deleted"
      ],
      "description": "Represents the status that a Journal instance can be in.\n\nCurrent Values:\n  - pending\n  - canceled\n  - executed\n  - queued\n  - rejected\n  - deleted"
    }
  }
}