Twilio's (TWLO -1.84%) stock price surged 18% during after-hours trading on Feb. 9 after the cloud-based communications company posted its fourth-quarter earnings report.

Twilio's revenue rose 54% year over year to $842.7 million, which beat estimates by $73.3 million. Its adjusted net loss of $36.3 million marked a significant drop from its net profit of $6.5 million a year ago, but its adjusted loss of $0.20 per share still cleared estimates by two cents.

Those headline numbers look decent, but Twilio's stock remains nearly 50% below its all-time high of $457.30 a share, which it hit during the Reddit-fueled rally last February. Does Twilio's earnings beat indicate it's finally time to buy?

A person uses a smartphone.

Image source: Getty Images.

Twilio's main strengths

Twilio's cloud-based platform handles integrated voice calls, text messages, videos, and other features for mobile apps. Building those features from scratch can be buggy, time consuming, and tough to scale for developers, so it's easier to outsource those services to Twilio with a few lines of code.

Twilio established a first-mover's advantage in this niche market, and companies like Lyft, Airbnb, and eBay all use its services today.

It ended the fourth quarter of 2021 with 256,000 active customer accounts, representing 16% growth from a year earlier. Here's how rapidly it grew over the past three years:

Growth (YOY)

FY 2019

FY 2020

FY 2021

Active Accounts

178%

23%

16%

Revenue

75%

55%

61%

Data source: Twilio. YOY = Year over year.

Twilio's main weaknesses

Twilio's momentum seems impressive, but a lot of its growth actually came from acquisitions. Its triple-digit percentage active account growth in 2019 mainly came from its acquisition of SendGrid, while its revenue growth in 2021 was boosted by its acquisitions of Segment and Zipwhip. On an organic basis, which excludes Segment and Zipwhip, Twilio's revenue rose 42% in 2021.

That's still a solid growth rate, but two of Twilio's other core growth metrics -- its dollar-based net expansion rate (DBNER), which gauges its revenue growth per existing customer, and adjusted gross margin -- have been declining:

Growth (YOY)

FY 2019

FY 2020

FY 2021

DBNER

136%

137%

131%

Gross Margin*

58%

56%

51%

Data source: Twilio. *Non-GAAP basis.YOY = Year over year.

A DBNER above 100% is still very healthy, but its decline in 2021 suggests that Twilio will need to continuously expand its ecosystem with fresh investments, acquisitions, and features to boost its customers' usage rates.

Meanwhile, Twilio's gross margin was squeezed by new fees at major wireless carriers like Verizon. These application-to-person (A2P) fees are now charged whenever a third-party application accesses their wireless networks.

Competition from other similar platforms -- including Vonage's Nexmo, Bandwidth, and MessageBird -- could also throttle Twilio's long-term pricing power. In addition, Twilio's larger customers could still build their own in-house alternatives if it's more economical than paying Twilio's usage-based fees.

Twilio also remains deeply unprofitable. On a generally accepted accounting principles (GAAP) basis, its net loss widened from $491 million in 2020 to $950 million in 2021. On a non-GAAP basis, which excludes its hefty stock-based compensation expenses and other one-time expenses, it also posted a net loss of $43 million, compared to a net profit of $36 million in 2020.

All that red ink makes Twilio a risky stock to hold as rising interest rates boost borrowing costs for unprofitable companies.

A bright outlook for the future

Twilio expects its revenue to rise 45%-47% year over year (32%-34% on an organic basis) in the first quarter of 2022. That's significantly higher than analysts' expectations for 36% growth on a reported basis.

As for its soft spots, Twilio still believes its gross margin will rise above 60% over the long term as it cross-sells more services and locks in more customers, and economies of scale kick in across its cloud infrastructure. It also believes it can achieve non-GAAP operating profitability in 2023.

Analysts expect Twilio's revenue to rise 29% in 2022 and 30% in 2023, assuming it doesn't make any more big acquisitions. Twilio expects to generate at least 30% annual revenue growth for the next few years.

Based on those expectations, Twilio's stock trades at about 10 times this year's sales -- which is a reasonable price-to-sales ratio compared to those of other cloud-based software companies.

Salesforce (CRM -1.37%), which is growing at a slower rate than Twilio, trades at eight times this year's sales. Adobe (ADBE -3.03%), which generates even slower revenue growth than Salesforce, trades at 14 times this year's sales.

Is it time to buy Twilio?

I wasn't a fan of Twilio last October when it was still trading at about 20 times its projected 2021 sales. But after its sell-off over the past few months, I think it's a much more compelling buy.

Twilio still has some glaring weaknesses, but it will likely dominate its high-growth niche for the foreseeable future. Therefore, I believe investors can gradually accumulate shares of Twilio at these levels -- but the stock will likely remain volatile as long as rising interest rates keep rattling the tech sector.