The API to use is action=purge. The page is specified via titles, not pageids or revids. From T227758#5555144, it sounds like we want to specify forcelinkupdate as well.
The progress bar continues to be shown until this is done.
An error in the purge API call may be tracked, but has no other effect (we don’t show it to the user, it doesn’t prevent the rest of the action to proceed).