{
  "lexicon": 1,
  "id": "tools.ozone.report.assignModerator",
  "defs": {
    "main": {
      "type": "procedure",
      "description": "Assign a report to a user. Defaults to the caller. Admins may assign to any moderator.",
      "input": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": ["reportId"],
          "properties": {
            "reportId": {
              "type": "integer",
              "description": "The ID of the report to assign."
            },
            "queueId": {
              "type": "integer",
              "description": "Optional queue ID to associate the assignment with. If not provided and the report has been assigned on a queue before, it will stay on that queue."
            },
            "did": {
              "type": "string",
              "format": "did",
              "description": "DID to be assigned. Defaults to the caller's DID. Admins may assign to any moderator."
            },
            "isPermanent": {
              "type": "boolean",
              "description": "When true, the assignment has no expiry (endAt is null). Throws AlreadyAssigned if another user already has a permanent assignment on this report."
            }
          }
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "type": "ref",
          "ref": "tools.ozone.report.defs#assignmentView"
        }
      },
      "errors": [
        {
          "name": "AlreadyAssigned",
          "description": "The report is already assigned to another user."
        },
        {
          "name": "InvalidAssignment",
          "description": "The report ID or queue ID is invalid."
        }
      ]
    }
  }
}
