Nathan Dyer after nine minutes and Pratley on 16 had given Swansea an early lead, but Jay Bothroyd and Mark Hudson levelled it up.
The Swans made two chances with Dyer returning in place of the injured Mark Gower and Federico Bessone replacing Gary Monk despite the skipper being named on the teamsheet.
Craig Beattie had an early chance for the Swans when Joe Allen sent him the clear after only two minutes, but Adam Matthews raced across with a saving tackle to clear the danger.
The Swans went ahead from a Pratley free kick out near the corner flag. The Cardiff defence failed to clear and the unmarked Dyer looped a header into the net.
It was 2-0 in the 16th minute when Bessone crossed, Beattie tried a shot and the ball ran to loose to Pratley, who crashed it home from ten yards out.
The Swans were well on top and, midway through the half, Allen had Cardiff keeper David Marshall scrambling across goal to push his goalbound strike behind.
Out of the blue Cardiff pulled a goal back when Chris Burke sent a ball down the the middle for Bothroyd to race on to before clipping his shot beyond the keeper and into the net.
It was all square two minutes later when Hudson was at the far post to head a Matthews free-kick into the net.
There were no changes when the sides came out after the interval and the game remained open as both went looking for goals.
One almost arrived in the 57th minute when Ross McCormack rattled the Swansea crossbar from a free-kick, but it was the Swans who regained the lead two minutes later.
A cross from Bessone was met by Pratley, who had raced into the danger area before volleying in from close range.
Cardiff rarely threatened the home goal in the closing minutes and the Swans fully deserved their victory.