Usually, they will ask you to provide these details when you book your flight or check in. Contact your airline if you have any questions about API requirements. Your information will be taken either at the time of booking or by an automated passport reader during check-in.