I have done it once, on request from the team management at my first job. A secret API to delete QA accounts. They needed to create 100 accounts everyday, they were running out of emails and hence asked to me make a token secured, QA only access API to delete accounts. Hated doing it and would never recommend doing it.
At my second job and here at Hashnode, never. :)