The South American pileated parrot (Pionopsitta pileata), also known as the red-capped parrot (leading to easy confusion with the Australian Purpureicephalus spurius), is a medium-small species of parrot with a total length of about 22 cms .