While Promise.all and Promise.allSettled can wait for promises asynchronously and simultaneously, it's important to note that in most cases API calls start the moment the Promise is created. Just creating all the promises at once and then awaiting them one by one instead of using Promise.all won't solve this issue. The key is to defer the creation of promises to happen sequentially.
To delay the API call for the second document, you must ensure you await the first response before creating the promise for the second response. Following this pattern ensures proper execution, as explained in pzaenger's answer. If you're using then and catch handlers instead of await, make sure each subsequent call to the API happens within the appropriate handler of the previous call.
There are tools available to address the general "throttling" problem, where only a certain number of promises should coexist at once. This strategy is similar to having n = 1, meaning API calls execute in sequence. Consider utilizing a throttling library to handle scenarios where a small finite number (such as n = 3) or time-based throttling (e.g. 1 request per second) is necessary. Implementing this with a library allows for easy modification and scalability in handling different scenarios.