def METHOD_NAME(event):
    """Build record unique identifier."""
    # NOTE: the 'unique_id' is used by the aggregators to know which events
    #       should be aggregated together... since we want to distinguish between
    #       API and UI events, this needs to be incorporated into the 'unique_id'
    prefix = "api" if event.get("via_api") else "ui"
    event["unique_id"] = f"{prefix}_{event['recid']}"
    return event