Fair Value Measurements - Assets Measured at Fair Value on a Recurring Basis (Details) - USD ($) $ in Thousands | Jan. 31, 2022 | Apr. 30, 2021 |
Available-for-sale marketable securities: | | |
Total cash equivalents and available-for-sale marketable securities | $ 960,373 | $ 1,021,421 |
Corporate debt securities | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 195,512 | 2,368 |
U.S. treasury securities | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 0 | 57,998 |
Certificates of deposit | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 300,381 | 422,978 |
U.S. government agencies securities | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 14,015 | 0 |
Commercial paper | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 308,208 | 494,676 |
Fair Value, Recurring | | |
Available-for-sale marketable securities: | | |
Total cash equivalents and available-for-sale marketable securities | 960,373 | 1,021,421 |
Fair Value, Recurring | Money market funds | | |
Cash equivalents: | | |
Cash equivalents, fair value | 129,753 | 43,401 |
Fair Value, Recurring | Corporate debt securities | | |
Cash equivalents: | | |
Cash equivalents, fair value | 1,506 | 0 |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 195,512 | 2,368 |
Fair Value, Recurring | U.S. treasury securities | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 0 | 57,998 |
Fair Value, Recurring | Certificates of deposit | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 300,381 | 422,978 |
Fair Value, Recurring | U.S. government agencies securities | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 14,015 | 0 |
Fair Value, Recurring | Commercial paper | | |
Cash equivalents: | | |
Cash equivalents, fair value | 10,998 | 0 |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 308,208 | 494,676 |
Fair Value, Recurring | Level 1 | | |
Available-for-sale marketable securities: | | |
Total cash equivalents and available-for-sale marketable securities | 129,753 | 43,401 |
Fair Value, Recurring | Level 1 | Money market funds | | |
Cash equivalents: | | |
Cash equivalents, fair value | 129,753 | 43,401 |
Fair Value, Recurring | Level 1 | Corporate debt securities | | |
Cash equivalents: | | |
Cash equivalents, fair value | 0 | 0 |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 0 | 0 |
Fair Value, Recurring | Level 1 | U.S. treasury securities | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 0 | 0 |
Fair Value, Recurring | Level 1 | Certificates of deposit | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 0 | 0 |
Fair Value, Recurring | Level 1 | U.S. government agencies securities | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 0 | 0 |
Fair Value, Recurring | Level 1 | Commercial paper | | |
Cash equivalents: | | |
Cash equivalents, fair value | 0 | 0 |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 0 | 0 |
Fair Value, Recurring | Level 2 | | |
Available-for-sale marketable securities: | | |
Total cash equivalents and available-for-sale marketable securities | 830,620 | 978,020 |
Fair Value, Recurring | Level 2 | Money market funds | | |
Cash equivalents: | | |
Cash equivalents, fair value | 0 | 0 |
Fair Value, Recurring | Level 2 | Corporate debt securities | | |
Cash equivalents: | | |
Cash equivalents, fair value | 1,506 | 0 |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 195,512 | 2,368 |
Fair Value, Recurring | Level 2 | U.S. treasury securities | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 0 | 57,998 |
Fair Value, Recurring | Level 2 | Certificates of deposit | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 300,381 | 422,978 |
Fair Value, Recurring | Level 2 | U.S. government agencies securities | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 14,015 | 0 |
Fair Value, Recurring | Level 2 | Commercial paper | | |
Cash equivalents: | | |
Cash equivalents, fair value | 10,998 | 0 |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 308,208 | 494,676 |
Fair Value, Recurring | Level 3 | | |
Available-for-sale marketable securities: | | |
Total cash equivalents and available-for-sale marketable securities | 0 | 0 |
Fair Value, Recurring | Level 3 | Money market funds | | |
Cash equivalents: | | |
Cash equivalents, fair value | 0 | 0 |
Fair Value, Recurring | Level 3 | Corporate debt securities | | |
Cash equivalents: | | |
Cash equivalents, fair value | 0 | 0 |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 0 | 0 |
Fair Value, Recurring | Level 3 | U.S. treasury securities | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 0 | 0 |
Fair Value, Recurring | Level 3 | Certificates of deposit | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 0 | 0 |
Fair Value, Recurring | Level 3 | U.S. government agencies securities | | |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | 0 | 0 |
Fair Value, Recurring | Level 3 | Commercial paper | | |
Cash equivalents: | | |
Cash equivalents, fair value | 0 | 0 |
Available-for-sale marketable securities: | | |
Available-for-sale marketable securities, fair value | $ 0 | $ 0 |