{
  "lexicon": 1,
  "id": "tools.ozone.moderation.getAccountTimeline",
  "defs": {
    "main": {
      "type": "query",
      "description": "Get timeline of all available events of an account. This includes moderation events, account history and did history.",
      "parameters": {
        "type": "params",
        "required": ["did"],
        "properties": {
          "did": {
            "type": "string",
            "format": "did"
          }
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": ["timeline"],
          "properties": {
            "timeline": {
              "type": "array",
              "items": {
                "type": "ref",
                "ref": "#timelineItem"
              }
            }
          }
        }
      },
      "errors": [
        {
          "name": "RepoNotFound"
        }
      ]
    },
    "timelineItem": {
      "type": "object",
      "required": ["day", "summary"],
      "properties": {
        "day": {
          "type": "string"
        },
        "summary": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#timelineItemSummary"
          }
        }
      }
    },
    "timelineItemSummary": {
      "type": "object",
      "required": ["eventSubjectType", "eventType", "count"],
      "properties": {
        "eventSubjectType": {
          "type": "string",
          "knownValues": ["account", "record", "chat"]
        },
        "eventType": {
          "type": "string",
          "knownValues": [
            "tools.ozone.moderation.defs#modEventTakedown",
            "tools.ozone.moderation.defs#modEventReverseTakedown",
            "tools.ozone.moderation.defs#modEventComment",
            "tools.ozone.moderation.defs#modEventReport",
            "tools.ozone.moderation.defs#modEventLabel",
            "tools.ozone.moderation.defs#modEventAcknowledge",
            "tools.ozone.moderation.defs#modEventEscalate",
            "tools.ozone.moderation.defs#modEventMute",
            "tools.ozone.moderation.defs#modEventUnmute",
            "tools.ozone.moderation.defs#modEventMuteReporter",
            "tools.ozone.moderation.defs#modEventUnmuteReporter",
            "tools.ozone.moderation.defs#modEventEmail",
            "tools.ozone.moderation.defs#modEventResolveAppeal",
            "tools.ozone.moderation.defs#modEventDivert",
            "tools.ozone.moderation.defs#modEventTag",
            "tools.ozone.moderation.defs#accountEvent",
            "tools.ozone.moderation.defs#identityEvent",
            "tools.ozone.moderation.defs#recordEvent",
            "tools.ozone.moderation.defs#modEventPriorityScore",
            "tools.ozone.moderation.defs#revokeAccountCredentialsEvent",
            "tools.ozone.moderation.defs#ageAssuranceEvent",
            "tools.ozone.moderation.defs#ageAssuranceOverrideEvent",
            "tools.ozone.moderation.defs#timelineEventPlcCreate",
            "tools.ozone.moderation.defs#timelineEventPlcOperation",
            "tools.ozone.moderation.defs#timelineEventPlcTombstone",
            "tools.ozone.hosting.getAccountHistory#accountCreated",
            "tools.ozone.hosting.getAccountHistory#emailConfirmed",
            "tools.ozone.hosting.getAccountHistory#passwordUpdated",
            "tools.ozone.hosting.getAccountHistory#handleUpdated",
            "tools.ozone.moderation.defs#scheduleTakedownEvent",
            "tools.ozone.moderation.defs#cancelScheduledTakedownEvent"
          ]
        },
        "count": {
          "type": "integer"
        }
      }
    }
  }
}
