Net loss per share attributable to common stockholders (Details) - USD ($)
$ / shares in Units, $ in Thousands
3 Months Ended 12 Months Ended
Dec. 31, 2015
Sep. 30, 2015
Jun. 30, 2015
Mar. 31, 2015
Dec. 31, 2014
Sep. 30, 2014
Jun. 30, 2014
Mar. 31, 2014
Dec. 31, 2015
Dec. 31, 2014
Dec. 31, 2013
Net loss per share                      
Net loss $ (24,360) $ (22,527) $ (24,258) $ (18,637) $ (15,305) $ (12,615) $ (10,539) $ (9,033) $ (89,782) $ (47,492) $ (24,838)
Less: dividends on convertible preferred stock                     (151)
Net loss attributable to common stockholders $ (24,360) $ (22,527) $ (24,258) $ (18,637) $ (15,305) $ (12,615) $ (10,539) $ (9,033) $ (89,782) $ (47,492) $ (24,989)
Shares used in computing net loss per share attributable to common stockholders, basic and diluted                 28,213,324 846,027 691,731
Net loss per share, basic and diluted $ (0.76) $ (0.71) $ (0.76) $ (1.09) $ (16.56) $ (14.24) $ (12.81) $ (12.06) $ (3.18) $ (56.14) $ (36.13)
Antidilutive shares excluded from diluted net loss per share                      
Antidilutive Securities Excluded from Computation of Earnings Per Share, Amount                 4,193,153 25,469,124 14,749,326
Options                      
Antidilutive shares excluded from diluted net loss per share                      
Antidilutive Securities Excluded from Computation of Earnings Per Share, Amount                 3,659,713 1,923,332 1,173,019
Restricted stock units                      
Antidilutive shares excluded from diluted net loss per share                      
Antidilutive Securities Excluded from Computation of Earnings Per Share, Amount                 482,818    
ESPP                      
Antidilutive shares excluded from diluted net loss per share                      
Antidilutive Securities Excluded from Computation of Earnings Per Share, Amount                 45,963    
Convertible preferred stock                      
Antidilutive shares excluded from diluted net loss per share                      
Antidilutive Securities Excluded from Computation of Earnings Per Share, Amount                   23,521,889 13,521,900
Unvested early exercise of outstanding options subject to repurchase                      
Antidilutive shares excluded from diluted net loss per share                      
Antidilutive Securities Excluded from Computation of Earnings Per Share, Amount                 4,659 23,903 54,407