Stock plans - Stock incentive plans (Details) - USD ($)
1 Months Ended 12 Months Ended
Jan. 31, 2015
Dec. 31, 2015
Dec. 31, 2014
Dec. 31, 2013
Activity under the plan        
Shares available for grant   2,268,938 276,805  
Additional shares reserved   6,253,651 25,722,026  
Balance at the beginning of the period 1,923,332 1,923,332    
Balance at the end of the period   3,659,713 1,923,332  
Restricted stock units        
Stock incentive plan        
Vesting period   3 years    
Activity under the plan        
Units granted   (493,068)    
Vested and expected to vest        
Weighted-average grant date fair value (in dollars per share)   $ 10.72 $ 0.00 $ 0.00
Restricted stock units | First anniversary        
Stock incentive plan        
Vesting rate upon anniversaries (as a percent)   33.33%    
Restricted stock units | Second anniversary        
Stock incentive plan        
Vesting rate upon anniversaries (as a percent)   33.33%    
Restricted stock units | Third anniversary        
Stock incentive plan        
Vesting rate upon anniversaries (as a percent)   33.33%    
Stock incentive plans        
Stock incentive plan        
Vesting period   4 years    
Vesting rate upon anniversaries (as a percent)   25.00%    
Monthly vesting rate thereafter (as a percent)   2.08%    
Activity under the plan        
Additional shares reserved 120,452   4,370,452  
Stock incentive plans | Minimum        
Stock incentive plan        
Employees holding voting rights of all classes of stock (as a percent)   10.00%    
Exercise price of options on common stock (as a percent)   110.00%    
Stock incentive plans | Maximum        
Stock incentive plan        
Term of options granted   10 years    
Stock incentive plans | Options        
Activity under the plan        
Shares available for grant   2,268,938 276,805 873,233
Additional shares reserved   4,370,452 333,333  
Repurchase of unvested early exercise shares     1,959  
Balance at the beginning of the period 1,923,332 1,923,332 1,173,019  
Options granted (in shares)   2,103,304 1,164,990  
Option cancelled (in shares)   (218,053) (233,270)  
Options exercised (in shares)   (148,870) (181,407)  
Balance at the end of the period   3,659,713 1,923,332 1,173,019
Weighted-average exercise price        
Balance at the beginning of the period (in dollars per share) $ 4.37 $ 4.37 $ 1.40  
Options granted (in dollars per share)   9.78 6.21  
Options cancelled (in dollars per share)   7.73 2.07  
Options exercised (in dollars per share)   1.98 1.15  
Balance at the end of the period (in dollars per share)   $ 7.38 $ 4.37 $ 1.40
Additional information        
Weighted-average remaining contractual life   8 years 10 months 21 days 8 years 10 months 24 days 9 years
Aggregate intrinsic value   $ 7,099,000 $ 15,946,000 $ 2,155,000
Exercisable, Number of shares   833,787    
Exercisable, weighted-average exercise price (in dollars per share)   $ 3.54    
Exercisable, weighted-average remaining contractual life   7 years 6 months 26 days    
Exercisable, aggregate intrinsic value   $ 4,054,000    
Vested and expected to vest        
Number of shares   3,553,680    
Weighted-average exercise price (in dollars per share)   $ 7.33    
Weighted-average remaining contractual life   8 years 10 months 13 days    
Aggregate intrinsic value   $ 7,017,000    
Weighted-average grant date fair value (in dollars per share)   $ 6.26 $ 4.68 $ 1.83
Fair value of options granted   $ 2,128,000 $ 494,000 $ 204,000
Exercised, aggregate intrinsic value   $ 1,285,000 $ 644,000 $ 60,000
Stock incentive plans | Restricted stock units        
Activity under the plan        
Units granted   (493,068)    
ESPP        
Stock incentive plan        
Purchase price of common stock of the lesser of fair market value on the purchase date or the last trading day preceding the offering date (as a percent) 85.00%      
Activity under the plan        
Additional shares reserved 325,000 325,000    
Vested and expected to vest        
Weighted-average grant date fair value (in dollars per share)   $ 2.17