Commitments and Contingencies | Commitments and Contingencies (a) Lease and Other Commitments The Company entered into various non-cancelable operating lease agreements for its facilities that expire over the next ten years. See Note 5 to these condensed consolidated financial statements for additional detail on the Company's operating and finance lease commitments. In the three months ended March 31, 2019, the Company entered into a 24 month non-cancelable agreement with a cloud services vendor for a total commitment of $1.4 million . Additionally, as a result of its acquisition of SendGrid, the Company assumed a non-cancelable cloud services vendor contract with a remaining value of $22.4 million and a remaining term of three years. (b) Legal Matters On April 30, 2015 and March 28, 2016, Telesign Corporation ("Telesign") filed lawsuits (which were subsequently consolidated) against the Company in the United States District Court, Central District of California (“Telesign I/II”). Telesign alleges in Telesign I/II that the Company is infringing four U.S. patents that it holds: U.S. Patent No. 7,945,034 (“034”), U.S. Patent No. 8,462,920 (“920”), U.S. Patent No. 8,687,038 (“038”) and U.S. Patent No. 9,300,792 (“792”). The consolidated Telesign I/II actions have been transferred to the United States District Court, Northern District. The patent infringement allegations in the lawsuit relate to the Company’s two-factor authentication use case, Authy and an API tool to find information about a phone number. Telesign seeks, among other things, to enjoin us from allegedly infringing the patents, along with damages for lost profits and damages based on a reasonable royalty. On March 8, 2017, in response to a petition by the Company, the U.S. Patent and Trademark Officer (“PTO”) issued an order instituting an inter partes review for the ‘792 patent. On March 6, 2018, the PTO found all claims challenged by the Company in the inter partes review unpatentable. Telesign did not appeal the PTO’s decision, and it is final. On October 19, 2018, the district court granted the Company's motion that all remaining asserted claims of the asserted patents are invalid under 35 U.S.C. §101 and entered judgment in the Company’s favor. On November 8, 2018, Telesign appealed the judgment to the United States Court of Appeals for the Federal Circuit where the case is now pending. Based on, among other things, final judgment being entered by the district court in the Company’s favor, the Company does not believe a loss is reasonably possible or estimable. On December 1, 2016, the Company filed a patent infringement lawsuit against Telesign in the United States District Court, Northern District of California (“Telesign III”), alleging indirect infringement of United States Patent No. 8,306,021 (“021”), United States Patent No. 8,837,465 (“465”), United States Patent No. 8,755,376 (“376”), United States Patent No. 8,736,051 (“051”), United States Patent No. 8,737,962 (“962”), United States Patent No. 9,270,833 (“833”), and United States Patent No. 9,226,217 (“217”). Telesign filed a motion to dismiss the complaint on January 25, 2017. In two orders, issued on March 31, 2017 and April 17, 2017, the court granted Telesign’s motion to dismiss with respect to the ‘962, ‘833, ‘051 and ‘217 patents, but denied Telesign’s motion to dismiss as to the ‘021, ‘465 and ‘376 patents. On August 23, 2017, Telesign petitioned the PTO for inter partes review of the ‘021, ‘465, and ‘376 patents. On March 9, 2018, the PTO denied Telesign’s petition for inter partes review of the ‘021 patent and granted Telesign’s petitions for inter partes review of the ‘465 and ‘376 patents. On March 6, 2019, the PTO found all claims challenged by Telesign in the inter partes review unpatentable. The company has appealed the decisions to the United States Court of Appeals for the Federal Circuit. Telesign III is currently stayed pending resolution of the inter partes reviews (and appeals from them) of the ‘465 and ‘376 patents. The Company is seeking a judgment of infringement, a judgment of willful infringement, monetary and injunctive relief, enhanced damages, and an award of costs and expenses against Telesign. On February 18, 2016, a putative class action complaint was filed in the Alameda County Superior Court in California, entitled Angela Flowers v. Twilio Inc. The complaint alleges that the Company’s products permit the interception, recording and disclosure of communications at a customer’s request and are in violation of the California Invasion of Privacy Act. The complaint seeks injunctive relief as well as monetary damages. On January 2, 2018, the court issued an order granting in part and denying in part the plaintiff’s class certification motion. The court certified two classes of individuals who, during specified time periods, allegedly sent or received certain communications involving the accounts of three of the Company’s customers that were recorded. Following mediation, on January 7, 2019, the parties signed a long form settlement agreement, providing for a payment of $10 million into a common fund and injunctive relief involving certain updates to Twilio’s Acceptable Use Policy and customer documentation. On January 15, 2019, the court entered an order granting preliminary approval of the settlement, and the parties signed an amended settlement agreement to conform to the court’s order. A final approval hearing is scheduled for June 11, 2019. Given insurance coverage, the Company continues to estimate its potential liability in the Flowers matter to be $1.7 million and carries this reserved amount in its condensed consolidated balance sheet as of March 31, 2019 , presented elsewhere in this Quarterly Report on Form 10‑Q. On September 1, 2015, Twilio was named as a defendant in a First Amended Complaint in a putative class action captioned Jeremy Bauman v. David Saxe, et al. pending in the United States District Court, District of Nevada relating to the alleged sending of unsolicited text messages to the plaintiffs and putative class members. The Company filed a motion to dismiss, which was granted, and on September 20, 2016 the plaintiff filed a Second Amended Complaint with additional allegations that the Company violated the Telephone Consumer Protection Act (“TCPA”), and the Nevada Deceptive Trade Practices Act (“NDTPA”), NRS 41.600(2)(e). On January 10, 2019, the court granted Plaintiffs’ motion for class certification under the TCPA and denied plaintiff’s request to certify a class under the NDTPA. On February 13, 2019, the court issued an order denying the Company’s motion to dismiss as to Plaintiffs’ TCPA claim and granting dismissal as to Plaintiffs’ NDTPA claim. The Company intends to vigorously defend itself against and believes it has meritorious defenses to this lawsuit. It is too early in these matters to reasonably predict the probability of the outcomes or to estimate the range of possible loss, if any. SendGrid Stockholder Litigation On December 5, 2018, purported stockholders of SendGrid filed putative class action complaints in the United States District Court for the District of Delaware, Rosenblatt v. SendGrid, Inc., et al., Case No. 1:18‑cv‑01931‑UNA (the “Rosenblatt Complaint”), and in the United States District Court for the District of Colorado, Chen v. SendGrid, Inc., et al., Case No. 1:18‑cv‑03131‑MEH (the “Chen Complaint”), against SendGrid, the individual members of the SendGrid board of directors (the “Individual Defendants”), Twilio and Topaz Merger Subsidiary, Inc. Thereafter, on December 19, 2018 and January 3, 2019, purported stockholders of SendGrid filed putative class action complaints against SendGrid and the Individual Defendants in the United States District Court for the District of Colorado, respectively, Bushansky v. SendGrid, Inc., et al., 1:18‑cv‑03260‑SKC (the “Bushansky Complaint”), and Conner v. SendGrid, Inc., et al., 1:19‑cv‑00016‑PAB‑SKC (the “Conner Complaint”). As of February 11, 2019, all four complaints have been voluntarily dismissed. Among other things, the Rosenblatt Complaint alleged that SendGrid and the Individual Defendants misrepresented and/or omitted material information in a registration statement on Form S‑4, rendering it false and misleading and in violation of the Exchange Act and related regulations. In addition, the Rosenblatt Complaint alleged that the Individual Defendants and Twilio acted as controlling persons within the meaning and in violation of Section 20(a) of the Exchange Act to influence and control the dissemination of the allegedly defective registration statement on Form S‑4. The Rosenblatt Complaint sought, among other things, rescission of the merger or rescissory damages, an order directing the SendGrid board of directors to file a registration statement on Form S‑4 that does not contain any untrue statements of material fact and states all material facts, a declaration that the defendants violated Sections 14(a) and/or 20(a) of the Exchange Act and Rule 14a‑9 promulgated thereunder and an award of plaintiff costs, including reasonable attorneys’ and experts’ fees. On February 11, 2019, the Rosenblatt Complaint was voluntarily dismissed. Among other things, the Chen Complaint alleged that the defendants misrepresented and/or omitted material information in a registration statement on Form S‑4, rendering it false and misleading and in violation of the Exchange Act and related regulations. In addition, the Chen Complaint alleged that the Individual Defendants acted as controlling persons within the meaning and in violation of Section 20(a) of the Exchange Act to influence and control the dissemination of the allegedly defective Form S‑4. The Chen Complaint also alleged that the Individual Defendants breached their fiduciary duties to SendGrid stockholders, and that the other defendants aided and abetted such breaches, by seeking to sell SendGrid through an allegedly unfair process and for an unfair price and on unfair terms, and by failing to disclose all material information. The Chen Complaint sought, among other things, rescission of the merger or rescissory damages, an order directing the SendGrid board of directors to commence a new sale process, a declaration that the merger agreement was agreed to in breach of the Individual Defendants’ fiduciary duties and is therefore unlawful and unenforceable, an order directing the defendants to account to the putative class for damages allegedly sustained, and an award of plaintiff costs, including reasonable attorneys’ and experts’ fees. On February 4, 2019, the Chen Complaint was voluntarily dismissed. Among other things, the Bushansky and Conner Complaints alleged that SendGrid and the Individual Defendants misrepresented and/or omitted material information in a Schedule 14A Definitive Proxy Statement, rendering it false and misleading and in violation of the Exchange Act and related regulations. In addition, the Bushansky and Conner Complaints alleged that the Individual Defendants acted as controlling persons within the meaning and in violation of Section 20(a) of the Exchange Act to influence and control the dissemination of the allegedly defective Schedule 14A Definitive Proxy Statement. The Bushansky and Conner Complaints sought, among other things, rescission of the merger or rescissory damages, and an award of plaintiff costs, including reasonable attorneys’ and experts’ fees. On February 4, 2019, the Bushansky Complaint was voluntarily dismissed. On February 11, 2019, the Conner Complaint was voluntarily dismissed. In addition to the litigation discussed above, from time to time, the Company may be subject to legal actions and claims in the ordinary course of business. The Company has received, and may in the future continue to receive, claims from third parties asserting, among other things, infringement of their intellectual property rights. Future litigation may be necessary to defend itself, its partners and its customers by determining the scope, enforceability and validity of third‑party proprietary rights, or to establish its proprietary rights. The results of any current or future litigation cannot be predicted with certainty, and regardless of the outcome, litigation can have an adverse impact on the Company because of defense and settlement costs, diversion of management resources, and other factors. Legal fees and other costs related to litigation and other legal proceedings are expensed as incurred and are included in general and administrative expenses in the accompanying condensed consolidated statements of operations. (c) Indemnification Agreements The Company has signed indemnification agreements with all of its board members and executive officers. The agreements indemnify the board members and executive officers from claims and expenses on actions brought against the individuals separately or jointly with the Company for certain indemnifiable events. Indemnifiable Events generally mean any event or occurrence related to the fact that the board member or the executive officer was or is acting in his or her capacity as a board member or an executive officer for the Company or was or is acting or representing the interests of the Company. In the ordinary course of business, the Company enters into contractual arrangements under which it agrees to provide indemnification of varying scope and terms to business partners, customers and other parties with respect to certain matters, including, but not limited to, losses arising out of the breach of such agreements, intellectual property infringement claims made by third parties and other liabilities relating to or arising from the Company’s various products, or its acts or omissions. In these circumstances, payment may be conditional on the other party making a claim pursuant to the procedures specified in the particular contract. Further, the Company’s obligations under these agreements may be limited in terms of time and/or amount, and in some instances, the Company may have recourse against third parties for certain payments. The terms of such obligations may vary. As of March 31, 2019 and December 31, 2018 , no amounts were accrued. (d) Other Taxes The Company conducts operations in many tax jurisdictions throughout the United States. In many of these jurisdictions, non-income-based taxes, such as sales and use and telecommunications taxes are assessed on the Company’s operations. Prior to March 2017, the Company had not billed nor collected these taxes from its customers and, in accordance with U.S. GAAP, recorded a provision for its tax exposure in these jurisdictions when it was both probable that a liability had been incurred and the amount of the exposure could be reasonably estimated. These estimates included several key assumptions including, but not limited to, the taxability of the Company’s services, the jurisdictions in which its management believes it has nexus, and the sourcing of revenues to those jurisdictions. Starting in March 2017, the Company began collecting these taxes from customers in certain jurisdictions, and since then, has expanded the number of jurisdictions where these taxes are being collected. Effective January 2018, the Company began to collect taxes in one additional jurisdiction and accordingly, from January 2018, the Company is not recording an additional provision for its exposure for new activities in that jurisdiction. The Company expects to continue to expand the number of jurisdictions where these taxes will be collected in the future. Simultaneously, the Company was and continues to be in discussions with certain states regarding its prior state sales and other taxes, if any, that the Company may owe. As of March 31, 2019 and December 31, 2018 , the liability recorded for these taxes was $25.2 million and $22.6 million , respectively. In the event other jurisdictions challenge management’s assumptions and analysis, the actual exposure could differ materially from the current estimates. |