When you fall, you can use a Reaction to attempt to grab a ledge. You make a Dexterity resistance roll or Strength (Athletics) roll. The DC is equal to the DC of the effect that pushed you down or DC15, whichever is greater.

Thereafter, you can make a Dexterity resistance roll or Dexterity (Acrobatics) roll to slow your fall by a number of feet equal to your check result. If you hit the ground, reduce the damage by your roll result.

The first round a creature falls, they fall only up to 250 feet. Thereafter, they fall 500 feet per round.

A creature that falls takes bludgeoning damage equal to 2d10 + half the number of feet they fell (max 1,000 damage). They take +2d10 additional falling damage for every size they are larger than Medium and reduce the die size by 1 per size smaller than medium (small 2d8, tiny 2d6, diminutive 2d4, fine 2d2). This damage is converted to nonlethal if you small on something soft.

Note that a creature cannot have more nonlethal damage than their maximum health pool. All additional damage is taken as lethal damage.