> ## Documentation Index
> Fetch the complete documentation index at: https://developers.hubspot.jp/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Lifecycle Stage metrics for Contacts

> Returns the total number of contacts in the account and the date of the last contact add.

export const ScopesList = ({scopes = [], description = "この API には、次のいずれかのスコープが必要です。"}) => {
  if (!scopes || scopes.length === 0) {
    return null;
  }
  const sortedScopes = scopes.sort((a, b) => a.localeCompare(b));
  return <div>
      <div className="text-sm mb-2">{description}</div>
      <div>
        {sortedScopes.map((scope, index) => <div key={index}>
            <code>
              <span className="text-xs">{scope}</span>
            </code>
          </div>)}
      </div>
    </div>;
};

<Accordion title="Scope requirements">
  <ScopesList scopes={['crm.objects.contacts.read', 'content', 'crm.objects.contacts.write']} />
</Accordion>


## OpenAPI

````yaml specs/legacy/v1/crm-contacts-v1.json GET /contacts/search/v1/external/lifecyclestages
openapi: 3.0.0
info:
  title: CRM Contacts API v1
  version: 1.0.0
  description: Use the contact lists API to create and manage contact lists.
  x-hubspot-introduction: Use the contact lists API to create and manage contact lists.
  x-hubspot-api-use-case: >-
    Retrieve a contact list by ID to bring that contact data into your external
    system.
servers:
  - url: https://api.hubapi.com
    description: HubSpot API Server
security: []
paths:
  /contacts/search/v1/external/lifecyclestages:
    get:
      summary: Get Lifecycle Stage metrics for Contacts
      description: >-
        Returns the total number of contacts in the account and the date of the
        last contact add.
      operationId: getcontactssearchv1externallifecyclestages
      parameters:
        - name: includeTotalContacts
          in: query
          required: false
          description: >-
            A boolean to determine if the number of total contacts should be
            included in the response.
          schema:
            type: string
        - name: includeLastNewContactAt
          in: query
          required: false
          description: >-
            A boolean to determine if the time stamp of the last contact created
            should be included in the response.
          schema:
            type: string
      responses:
        '200':
          description: >-
            Successful response - Returns the total number of contacts in the
            account and the date of the last contact add
          content:
            application/json:
              schema:
                type: object
              examples:
                example1:
                  summary: Get Lifecycle Stage metrics for Contacts - Example 1
                  value: >-
                    [ { "lifecycleStage": "hs_lifecyclestage_lead_date",
                    "count": 34657 }, { "lifecycleStage":
                    "hs_lifecyclestage_opportunity_date", "count": 1 }, {
                    "lifecycleStage":
                    "hs_lifecyclestage_marketingqualifiedlead_date", "count": 3
                    }, { "lifecycleStage":
                    "hs_lifecyclestage_salesqualifiedlead_date", "count": 0 }, {
                    "lifecycleStage": "hs_lifecyclestage_evangelist_date",
                    "count": 0 }, { "lifecycleStage":
                    "hs_lifecyclestage_customer_date", "count": 242 }, {
                    "lifecycleStage": "hs_lifecyclestage_subscriber_date",
                    "count": 39 }, { "lifecycleStage":
                    "hs_lifecyclestage_other_date", "count": 0 } ] Example with
                    aggregation using hs_analytics_source:  [ {
                    "lifecycleStage": "hs_lifecyclestage_lead_date", "count":
                    34657, "aggregation": { "count": 34657, "aggregations": {
                    "hs_analytics_source": [ { "key": "DIRECT_TRAFFIC", "count":
                    30794 }, { "key": "OFFLINE", "count": 3822 }, { "key":
                    "PAID_SOCIAL", "count": 18 } ] } } }, { "lifecycleStage":
                    "hs_lifecyclestage_opportunity_date", "count": 1,
                    "aggregation": { "count": 1, "aggregations": {
                    "hs_analytics_source": [ { "key": "OFFLINE", "count": 1 } ]
                    } } }, { "lifecycleStage":
                    "hs_lifecyclestage_marketingqualifiedlead_date", "count": 3,
                    "aggregation": { "count": 3, "aggregations": {
                    "hs_analytics_source": [ { "key": "DIRECT_TRAFFIC", "count":
                    2 }, { "key": "OFFLINE", "count": 1 } ] } } }, {
                    "lifecycleStage":
                    "hs_lifecyclestage_salesqualifiedlead_date", "count": 0,
                    "aggregation": { "count": 0, "aggregations": {
                    "hs_analytics_source": [] } } }, { "lifecycleStage":
                    "hs_lifecyclestage_evangelist_date", "count": 0,
                    "aggregation": { "count": 0, "aggregations": {
                    "hs_analytics_source": [] } } }, { "lifecycleStage":
                    "hs_lifecyclestage_customer_date", "count": 242,
                    "aggregation": { "count": 242, "aggregations": {
                    "hs_analytics_source": [ { "key": "OFFLINE", "count": 169 },
                    { "key": "DIRECT_TRAFFIC", "count": 73 } ] } } }, {
                    "lifecycleStage": "hs_lifecyclestage_subscriber_date",
                    "count": 39, "aggregation": { "count": 39, "aggregations": {
                    "hs_analytics_source": [ { "key": "DIRECT_TRAFFIC", "count":
                    26 }, { "key": "OFFLINE", "count": 13 } ] } } }, {
                    "lifecycleStage": "hs_lifecyclestage_other_date", "count":
                    0, "aggregation": { "count": 0, "aggregations": {
                    "hs_analytics_source": [] } } } ]
      security:
        - oauth2:
            - crm.objects.contacts.read
        - oauth2_legacy: []
        - private_apps:
            - crm.objects.contacts.read
        - private_apps_legacy: []
components: {}

````