<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.24.1.1.u2</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>162</ContextCount>
  <ElementCount>362</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>61</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>6</UnitCount>
  <MyReports>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0000001 - Document - Cover</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/Cover</Role>
      <ShortName>Cover</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>0000002 - Statement - Consolidated Balance Sheets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/ConsolidatedBalanceSheets</Role>
      <ShortName>Consolidated Balance Sheets</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>0000003 - Statement - Consolidated Balance Sheets (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/ConsolidatedBalanceSheetsParenthetical</Role>
      <ShortName>Consolidated Balance Sheets (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>0000004 - Statement - Unaudited Consolidated Statements of Operations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/UnauditedConsolidatedStatementsofOperations</Role>
      <ShortName>Unaudited Consolidated Statements of Operations</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>0000005 - Statement - Unaudited Consolidated Statements of Comprehensive Loss</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/UnauditedConsolidatedStatementsofComprehensiveLoss</Role>
      <ShortName>Unaudited Consolidated Statements of Comprehensive Loss</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>0000006 - Statement - Unaudited Consolidated Statements of Stockholders' Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/UnauditedConsolidatedStatementsofStockholdersEquity</Role>
      <ShortName>Unaudited Consolidated Statements of Stockholders' Equity</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>0000007 - Statement - Unaudited Consolidated Statements of Cash Flows</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/UnauditedConsolidatedStatementsofCashFlows</Role>
      <ShortName>Unaudited Consolidated Statements of Cash Flows</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>0000008 - Disclosure - Background and liquidity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/Backgroundandliquidity</Role>
      <ShortName>Background and liquidity</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>0000009 - Disclosure - Basis of presentation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/Basisofpresentation</Role>
      <ShortName>Basis of presentation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>0000010 - Disclosure - Summary of significant accounting policies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/Summaryofsignificantaccountingpolicies</Role>
      <ShortName>Summary of significant accounting policies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>0000011 - Disclosure - Composition of certain financial statement captions</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/Compositionofcertainfinancialstatementcaptions</Role>
      <ShortName>Composition of certain financial statement captions</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>0000012 - Disclosure - Revenue and contract costs</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/Revenueandcontractcosts</Role>
      <ShortName>Revenue and contract costs</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>0000013 - Disclosure - Finance leases and other debt</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/Financeleasesandotherdebt</Role>
      <ShortName>Finance leases and other debt</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>0000014 - Disclosure - Stockholders' Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/StockholdersEquity</Role>
      <ShortName>Stockholders' Equity</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>0000015 - Disclosure - Equity-based compensation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/Equitybasedcompensation</Role>
      <ShortName>Equity-based compensation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>0000016 - Disclosure - Fair value measurements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/Fairvaluemeasurements</Role>
      <ShortName>Fair value measurements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>0000017 - Disclosure - Leases</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/Leases</Role>
      <ShortName>Leases</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>0000018 - Disclosure - Commitments and contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/Commitmentsandcontingencies</Role>
      <ShortName>Commitments and contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>0000019 - Disclosure - Income taxes</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/Incometaxes</Role>
      <ShortName>Income taxes</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>0000020 - Disclosure - Net loss per share attributable to common stockholders</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/Netlosspershareattributabletocommonstockholders</Role>
      <ShortName>Net loss per share attributable to common stockholders</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>0000021 - Disclosure - Related party transactions</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/Relatedpartytransactions</Role>
      <ShortName>Related party transactions</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>21</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>0000022 - Disclosure - Other events</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/Otherevents</Role>
      <ShortName>Other events</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>22</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>995410 - Disclosure - Pay vs Performance Disclosure</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/ecd/role/PvpDisclosure</Role>
      <ShortName>Pay vs Performance Disclosure</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>23</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>995445 - Disclosure - Insider Trading Arrangements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/ecd/role/InsiderTradingArrangements</Role>
      <ShortName>Insider Trading Arrangements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>24</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>9954471 - Disclosure - Summary of significant accounting policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/SummaryofsignificantaccountingpoliciesPolicies</Role>
      <ShortName>Summary of significant accounting policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <Position>25</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>9954472 - Disclosure - Composition of certain financial statement captions (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/CompositionofcertainfinancialstatementcaptionsTables</Role>
      <ShortName>Composition of certain financial statement captions (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.phreesia.com/role/Compositionofcertainfinancialstatementcaptions</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>9954473 - Disclosure - Revenue and contract costs (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/RevenueandcontractcostsTables</Role>
      <ShortName>Revenue and contract costs (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.phreesia.com/role/Revenueandcontractcosts</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>9954474 - Disclosure - Finance leases and other debt (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/FinanceleasesandotherdebtTables</Role>
      <ShortName>Finance leases and other debt (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.phreesia.com/role/Financeleasesandotherdebt</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>9954475 - Disclosure - Stockholders' Equity (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/StockholdersEquityTables</Role>
      <ShortName>Stockholders' Equity (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.phreesia.com/role/StockholdersEquity</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>9954476 - Disclosure - Equity-based compensation (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/EquitybasedcompensationTables</Role>
      <ShortName>Equity-based compensation (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.phreesia.com/role/Equitybasedcompensation</ParentRole>
      <Position>30</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>9954477 - Disclosure - Fair value measurements (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/FairvaluemeasurementsTables</Role>
      <ShortName>Fair value measurements (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.phreesia.com/role/Fairvaluemeasurements</ParentRole>
      <Position>31</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>9954478 - Disclosure - Leases (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/LeasesTables</Role>
      <ShortName>Leases (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.phreesia.com/role/Leases</ParentRole>
      <Position>32</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>9954479 - Disclosure - Net loss per share attributable to common stockholders (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/NetlosspershareattributabletocommonstockholdersTables</Role>
      <ShortName>Net loss per share attributable to common stockholders (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.phreesia.com/role/Netlosspershareattributabletocommonstockholders</ParentRole>
      <Position>33</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>9954480 - Disclosure - Background and liquidity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/BackgroundandliquidityDetails</Role>
      <ShortName>Background and liquidity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.phreesia.com/role/Backgroundandliquidity</ParentRole>
      <Position>34</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>9954481 - Disclosure - Summary of significant accounting policies (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/SummaryofsignificantaccountingpoliciesDetails</Role>
      <ShortName>Summary of significant accounting policies (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.phreesia.com/role/SummaryofsignificantaccountingpoliciesPolicies</ParentRole>
      <Position>35</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>9954482 - Disclosure - Composition of certain financial statement captions - Schedule of Accrued Expenses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/CompositionofcertainfinancialstatementcaptionsScheduleofAccruedExpensesDetails</Role>
      <ShortName>Composition of certain financial statement captions - Schedule of Accrued Expenses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>9954483 - Disclosure - Composition of certain financial statement captions - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/CompositionofcertainfinancialstatementcaptionsNarrativeDetails</Role>
      <ShortName>Composition of certain financial statement captions - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.phreesia.com/role/CompositionofcertainfinancialstatementcaptionsTables</ParentRole>
      <Position>37</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>9954484 - Disclosure - Composition of certain financial statement captions - Schedule of Property and Equipment (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/CompositionofcertainfinancialstatementcaptionsScheduleofPropertyandEquipmentDetails</Role>
      <ShortName>Composition of certain financial statement captions - Schedule of Property and Equipment (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>9954485 - Disclosure - Composition of certain financial statement captions - Schedule of Intangible Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/CompositionofcertainfinancialstatementcaptionsScheduleofIntangibleAssetsDetails</Role>
      <ShortName>Composition of certain financial statement captions - Schedule of Intangible Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>9954486 - Disclosure - Composition of certain financial statement captions - Schedule of Estimated Amortization Expense for Intangible Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/CompositionofcertainfinancialstatementcaptionsScheduleofEstimatedAmortizationExpenseforIntangibleAssetsDetails</Role>
      <ShortName>Composition of certain financial statement captions - Schedule of Estimated Amortization Expense for Intangible Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>9954487 - Disclosure - Composition of certain financial statement captions - Schedule of Accounts Receivable (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/CompositionofcertainfinancialstatementcaptionsScheduleofAccountsReceivableDetails</Role>
      <ShortName>Composition of certain financial statement captions - Schedule of Accounts Receivable (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>9954488 - Disclosure - Composition of certain financial statement captions - Schedule of Allowance for Doubtful Accounts (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/CompositionofcertainfinancialstatementcaptionsScheduleofAllowanceforDoubtfulAccountsDetails</Role>
      <ShortName>Composition of certain financial statement captions - Schedule of Allowance for Doubtful Accounts (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>42</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>9954489 - Disclosure - Composition of certain financial statement captions - Schedule of Prepaid and Other Current Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/CompositionofcertainfinancialstatementcaptionsScheduleofPrepaidandOtherCurrentAssetsDetails</Role>
      <ShortName>Composition of certain financial statement captions - Schedule of Prepaid and Other Current Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>9954490 - Disclosure - Revenue and contract costs - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/RevenueandcontractcostsNarrativeDetails</Role>
      <ShortName>Revenue and contract costs - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>9954491 - Disclosure - Revenue and contract costs - Schedule of Rollforward of Contract Assets and Contract Liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/RevenueandcontractcostsScheduleofRollforwardofContractAssetsandContractLiabilitiesDetails</Role>
      <ShortName>Revenue and contract costs - Schedule of Rollforward of Contract Assets and Contract Liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>9954492 - Disclosure - Revenue and contract costs - Schedule of Deferred Contract Acquisition Costs (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/RevenueandcontractcostsScheduleofDeferredContractAcquisitionCostsDetails</Role>
      <ShortName>Revenue and contract costs - Schedule of Deferred Contract Acquisition Costs (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>9954493 - Disclosure - Finance leases and other debt - Schedule of Outstanding Finance Lease Liabilities and Other Debt (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/FinanceleasesandotherdebtScheduleofOutstandingFinanceLeaseLiabilitiesandOtherDebtDetails</Role>
      <ShortName>Finance leases and other debt - Schedule of Outstanding Finance Lease Liabilities and Other Debt (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>9954494 - Disclosure - Finance leases and other debt - Amended and Restated Loan and Security Agreement (Narrative) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/FinanceleasesandotherdebtAmendedandRestatedLoanandSecurityAgreementNarrativeDetails</Role>
      <ShortName>Finance leases and other debt - Amended and Restated Loan and Security Agreement (Narrative) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>9954495 - Disclosure - Finance leases and other debt - Schedule of Maturities of Finance Leases and Other Debt (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/FinanceleasesandotherdebtScheduleofMaturitiesofFinanceLeasesandOtherDebtDetails</Role>
      <ShortName>Finance leases and other debt - Schedule of Maturities of Finance Leases and Other Debt (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>9954496 - Disclosure - Finance leases and other debt - Schedule of Components of Interest Income (Expense), Net (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/FinanceleasesandotherdebtScheduleofComponentsofInterestIncomeExpenseNetDetails</Role>
      <ShortName>Finance leases and other debt - Schedule of Components of Interest Income (Expense), Net (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>9954497 - Disclosure - Stockholders' Equity - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/StockholdersEquityNarrativeDetails</Role>
      <ShortName>Stockholders' Equity - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>9954498 - Disclosure - Stockholders' Equity - Schedule of Accumulated Other Comprehensive Income (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/StockholdersEquityScheduleofAccumulatedOtherComprehensiveIncomeDetails</Role>
      <ShortName>Stockholders' Equity - Schedule of Accumulated Other Comprehensive Income (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>9954499 - Disclosure - Equity-based compensation - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/EquitybasedcompensationNarrativeDetails</Role>
      <ShortName>Equity-based compensation - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>9954500 - Disclosure - Equity-based compensation - Schedule of Stock - Based Compensation by Type of Award (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/EquitybasedcompensationScheduleofStockBasedCompensationbyTypeofAwardDetails</Role>
      <ShortName>Equity-based compensation - Schedule of Stock - Based Compensation by Type of Award (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>54</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>9954501 - Disclosure - Equity-based compensation - Schedule of Stock-Based Compensation in Financial Statements (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/EquitybasedcompensationScheduleofStockBasedCompensationinFinancialStatementsDetails</Role>
      <ShortName>Equity-based compensation - Schedule of Stock-Based Compensation in Financial Statements (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>55</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>9954502 - Disclosure - Equity-based compensation - Schedule of Restricted Stock Units and Performance Stock Units (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/EquitybasedcompensationScheduleofRestrictedStockUnitsandPerformanceStockUnitsDetails</Role>
      <ShortName>Equity-based compensation - Schedule of Restricted Stock Units and Performance Stock Units (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>56</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>9954503 - Disclosure - Equity-based compensation - Schedule of Stock Option Activity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/EquitybasedcompensationScheduleofStockOptionActivityDetails</Role>
      <ShortName>Equity-based compensation - Schedule of Stock Option Activity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>57</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>9954504 - Disclosure - Fair value measurements (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/FairvaluemeasurementsDetails</Role>
      <ShortName>Fair value measurements (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.phreesia.com/role/FairvaluemeasurementsTables</ParentRole>
      <Position>58</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>9954505 - Disclosure - Leases - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/LeasesNarrativeDetails</Role>
      <ShortName>Leases - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>59</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>9954506 - Disclosure - Leases - Schedule of Lease Expense (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/LeasesScheduleofLeaseExpenseDetails</Role>
      <ShortName>Leases - Schedule of Lease Expense (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>60</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>9954507 - Disclosure - Leases - Schedule of Maturities of Operating and Finance Leases (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/LeasesScheduleofMaturitiesofOperatingandFinanceLeasesDetails</Role>
      <ShortName>Leases - Schedule of Maturities of Operating and Finance Leases (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>61</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>9954508 - Disclosure - Leases - Schedule of Supplemental Cash Flow Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/LeasesScheduleofSupplementalCashFlowInformationDetails</Role>
      <ShortName>Leases - Schedule of Supplemental Cash Flow Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>62</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>9954509 - Disclosure - Commitments and contingencies (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/CommitmentsandcontingenciesDetails</Role>
      <ShortName>Commitments and contingencies (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.phreesia.com/role/Commitmentsandcontingencies</ParentRole>
      <Position>63</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>9954510 - Disclosure - Income taxes (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/IncometaxesDetails</Role>
      <ShortName>Income taxes (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.phreesia.com/role/Incometaxes</ParentRole>
      <Position>64</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>9954511 - Disclosure - Net loss per share attributable to common stockholders - Schedule of Earnings Per Share, Basic and Diluted (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/NetlosspershareattributabletocommonstockholdersScheduleofEarningsPerShareBasicandDilutedDetails</Role>
      <ShortName>Net loss per share attributable to common stockholders - Schedule of Earnings Per Share, Basic and Diluted (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>65</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>9954512 - Disclosure - Net loss per share attributable to common stockholders - Schedule of Shares Excluded from Computation of Diluted Net Loss Per Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/NetlosspershareattributabletocommonstockholdersScheduleofSharesExcludedfromComputationofDilutedNetLossPerShareDetails</Role>
      <ShortName>Net loss per share attributable to common stockholders - Schedule of Shares Excluded from Computation of Diluted Net Loss Per Share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>66</Position>
    </Report>
    <Report instance="phr-20240430.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.htm</HtmlFileName>
      <LongName>9954513 - Disclosure - Related party transactions (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.phreesia.com/role/RelatedpartytransactionsDetails</Role>
      <ShortName>Related party transactions (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.phreesia.com/role/Relatedpartytransactions</ParentRole>
      <Position>67</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <Logs>
    <Log type="Warning">[ix-0514-Hidden-Fact-Eligible-For-Transform] WARN: 7 fact(s) appearing in ix:hidden were eligible for transformation: ecd:TrdArrDuration, phr:SettlementAssetsSettlementPeriod, us-gaap:CapitalizedContractCostAmortizationPeriod, us-gaap:LesseeFinanceLeaseTermOfContract1 -  phr-20240430.htm 4</Log>
  </Logs>
  <InputFiles>
    <File doctype="10-Q" isDefinitelyFs="true" isUsgaap="true" original="phr-20240430.htm">phr-20240430.htm</File>
    <File>phr-20240430.xsd</File>
    <File>phr-20240430_cal.xml</File>
    <File>phr-20240430_def.xml</File>
    <File>phr-20240430_lab.xml</File>
    <File>phr-20240430_pre.xml</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy items="673">http://fasb.org/us-gaap/2024</BaseTaxonomy>
    <BaseTaxonomy items="30">http://xbrl.sec.gov/dei/2024</BaseTaxonomy>
    <BaseTaxonomy items="24">http://xbrl.sec.gov/ecd/2024</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
