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 10 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 and six months ended June 30, 2019 , the Company entered into several non-cancelable vendor agreements with terms from one to four years for a total purchase commitment of $9.7 million and $11.1 million , respectively. Additionally, as a result of its acquisition of SendGrid, the Company assumed a non-cancelable cloud services vendor contract that as of June 30, 2019, had a remaining value of $21.8 million and a remaining term of 2.9 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 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.0 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. The court entered a final order and judgment approving the settlement on June 17, 2019. A final compliance hearing has been scheduled for February 25, 2020. 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 June 30, 2019 . 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. On February 22, 2019, the court stayed the case and directed all parties to mediation, which was conducted on May 15, 2019. On May 17, 2019, the original defendants (the “Saxe Defendants”) and the Company entered an agreement, which among other things, obligates the Saxe Defendants to fully fund all monetary and non-monetary aspects of the settlement of the matter and to obtain the dismissal of the plaintiffs’ and the class’s claims against the Company with prejudice. On May 22, 2019 the plaintiffs and the Saxe Defendants filed a motion to stay the case noting that they had reached agreement on the material terms of a settlement and needed additional time to draft a settlement agreement for submission to the court for review and approval. The Company did not oppose that motion. Plaintiffs and the Saxe Defendants continue to negotiate an agreement for submittal to the court. Based on, among other things, the Company’s agreement with the Saxe Defendants, the Company does not believe a loss is reasonably possible or estimable . 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 and in connection with our financing and business combinations transactions, 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 June 30, 2019 and December 31, 2018 , no material 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 June 30, 2019 and December 31, 2018 , the liability recorded for these taxes was $26.1 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. |