Illegal as in without UN Security Council approval.
https://news.un.org/en/story/2022/04/1115592
https://en.wikipedia.org/wiki/Legality_of_the_Iraq_War
Here's a 2015 piece discussing some conflicts and UN approval or lack thereof.
https://theweek.com/articles/460549/does-un-ever-actually-war