Action potential may be defined as the change of the membrane potential of the cell with response to the stimulus. The different ions enter and exit the cells.
Action potential generates in the cell when the threshold voltage - gated channel reaches and opens the voltage gate channel. The opening of voltage gated channel changes the membrane potential of the cell.