> ## Documentation Index
> Fetch the complete documentation index at: https://developer.instantly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Count contacts

> Returns the number of contacts in the workspace, by consent and delivery status. The totals are eventually consistent: a change shows up after a short delay.


Requires one of the following scopes: `lifecycle_contacts:read`, `lifecycle_contacts:all`, `all:read`, `all:all`



## OpenAPI

````yaml https://api.instantly.ai/openapi/api_v2_lifecycle.json get /api/v2/lifecycle/contacts/count
openapi: 3.1.0
info:
  title: API Explorer
  description: >-
    The entire API V2 documentation is interactive and can be tested here. To
    the right side of every endpoint you will see a box with an example request.
    You can click on the "Try it" button to send a request to the server right
    from the docs. You will need to provide an API key by clicking the
    `ApiKeyAuth_token` blue text.
  version: 2.0.0
servers:
  - url: https://api.instantly.ai
    description: Instantly API Server
security:
  - ApiKeyAuth: []
tags:
  - name: Contact
    description: >-
      A contact in the workspace: one email address with its consent, tags and
      custom attributes. Segments, and the broadcasts and journeys that target
      them, read contacts. Optional fields with no value are left out of
      responses. The contact list, contact imports and tags page with `cursor`:
      pass the previous page's `next_cursor` until there is none. A contact's
      emails page with `starting_after` and `next_starting_after`.
    x-group: Contact
  - name: Segment
    description: >-
      A saved set of rules that selects contacts. Membership is worked out each
      time the segment is used. Optional fields with no value are left out of
      responses. Lists page with `cursor`: pass the previous page's
      `next_cursor` until there is none.
    x-group: Segment
  - name: Broadcast
    description: >-
      An email marketing broadcast campaign. Optional fields with no value are
      left out of responses. Lists page with `starting_after`: pass the previous
      page's `next_starting_after` until there is none.
    x-group: Broadcast
  - name: Domain
    description: >-
      An email sending domain. Optional fields with no value are left out of
      responses. Lists page with `starting_after`: pass the previous page's
      `next_starting_after` until there is none.
    x-group: Domain
  - name: Journey
    description: >-
      A customer journey, triggered by an event or by membership of a segment.
      Optional fields with no value are left out of responses. Lists page with
      `starting_after`: pass the previous page's `next_starting_after` until
      there is none. Step contacts page with `cursor` and `next_cursor` instead.
    x-group: Journey
  - name: EventCatalogEntry
    description: >-
      An event type seen in this workspace, which journey triggers and
      conversions can use. Optional fields with no value are left out of
      responses. Lists page with `starting_after`: pass the previous page's
      `next_starting_after` until there is none.
    x-group: Event Catalog Entry
  - name: Template
    description: >-
      An email marketing template. Optional fields with no value are left out of
      responses. Lists page with `starting_after`: pass the previous page's
      `next_starting_after` until there is none.
    x-group: Template
  - name: TemplateAsset
    description: >-
      An image or file uploaded for use in email templates. Optional fields with
      no value are left out of responses. Lists page with `starting_after`: pass
      the previous page's `next_starting_after` until there is none.
    x-group: Template Asset
  - name: EmailMetrics
    description: >-
      Aggregated email marketing metrics including totals, time-series data, and
      metadata.
    x-group: Email Metrics
  - name: Conversion
    description: >-
      A conversion event received for a person, credited to the emails they got
      before it.
    x-group: Conversion
paths:
  /api/v2/lifecycle/contacts/count:
    get:
      tags:
        - Contact
      summary: Count contacts
      description: >-
        Returns the number of contacts in the workspace, by consent and delivery
        status. The totals are eventually consistent: a change shows up after a
        short delay.



        Requires one of the following scopes: `lifecycle_contacts:read`,
        `lifecycle_contacts:all`, `all:read`, `all:all`
      operationId: countContacts
      responses:
        '200':
          description: Contact totals
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                    minimum: 0
                    examples:
                      - 0
                    description: All contacts in the workspace
                    example: 0
                  consent_status:
                    type: object
                    description: Contacts by marketing consent status
                    properties:
                      never_consented:
                        type: integer
                        minimum: 0
                        examples:
                          - 0
                        description: Contacts with no recorded consent
                        example: 0
                      subscribed:
                        type: integer
                        minimum: 0
                        examples:
                          - 0
                        description: Contacts who agreed to marketing email
                        example: 0
                      unsubscribed:
                        type: integer
                        minimum: 0
                        examples:
                          - 0
                        description: Contacts who unsubscribed
                        example: 0
                    required:
                      - never_consented
                      - subscribed
                      - unsubscribed
                    additionalProperties: false
                  delivery_status:
                    type: object
                    description: Contacts by delivery status
                    properties:
                      deliverable:
                        type: integer
                        minimum: 0
                        examples:
                          - 0
                        description: Contacts email can be sent to
                        example: 0
                      hard_bounced:
                        type: integer
                        minimum: 0
                        examples:
                          - 0
                        description: Contacts whose address bounced permanently
                        example: 0
                      complained:
                        type: integer
                        minimum: 0
                        examples:
                          - 0
                        description: Contacts who marked an email as spam
                        example: 0
                      suppressed:
                        type: integer
                        minimum: 0
                        examples:
                          - 0
                        description: Contacts on the suppression list
                        example: 0
                    required:
                      - deliverable
                      - hard_bounced
                      - complained
                      - suppressed
                    additionalProperties: false
                  counted_at:
                    type: string
                    format: date-time
                    examples:
                      - '2026-09-09T09:40:00.000Z'
                    description: When the totals were counted
                    example: '2026-09-09T09:40:00.000Z'
                required:
                  - total
                  - consent_status
                  - delivery_status
                  - counted_at
                additionalProperties: false
        '400':
          description: >-
            The request is invalid. `message` names the field and the problem.
            `code` is `FST_ERR_VALIDATION` when the request does not match this
            schema and `VALIDATION_ERROR` when a value is refused after that. A
            request the resource's current state does not allow, such as pausing
            a broadcast that is not sending, has its own `code` named on that
            operation. `code` is absent on a few request-level checks.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  The request is invalid. `message` names the field and the
                  problem. `code` is `FST_ERR_VALIDATION` when the request does
                  not match this schema and `VALIDATION_ERROR` when a value is
                  refused after that. A request the resource's current state
                  does not allow, such as pausing a broadcast that is not
                  sending, has its own `code` named on that operation. `code` is
                  absent on a few request-level checks.
                properties:
                  statusCode:
                    type: number
                    example: 400
                  error:
                    type: string
                    example: Bad Request
                  message:
                    type: string
                    example: 'limit: must be at most 50'
                  code:
                    type: string
                    description: >-
                      Machine-readable error code. Branch on this, not on the
                      message.
                    example: VALIDATION_ERROR
        '401':
          description: >-
            This request is unauthorized (either the Authorization header is
            missing or invalid, or the API key has been revoked)
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 401
                    examples:
                      - 401
                    example: 401
                  error:
                    type: string
                    enum:
                      - Unauthorized
                    examples:
                      - Unauthorized
                    example: Unauthorized
                  message:
                    type: string
                    examples:
                      - Missing Authorization header
                    example: Missing Authorization header
                required:
                  - statusCode
                  - error
                  - message
        '402':
          description: >-
            This request cannot be fulfilled because the workspace does not have
            an active paid plan
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 402
                    examples:
                      - 402
                    example: 402
                  error:
                    type: string
                    enum:
                      - Payment Required
                    examples:
                      - Payment Required
                    example: Payment Required
                  message:
                    type: string
                    examples:
                      - Workspace does not have an active paid plan
                    example: Workspace does not have an active paid plan
                required:
                  - statusCode
                  - error
                  - message
        '403':
          description: >-
            The workspace may not perform this action, for example while it is
            suspended. A key without the required scope gets a 401.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  The workspace may not perform this action, for example while
                  it is suspended. A key without the required scope gets a 401.
                properties:
                  statusCode:
                    type: number
                    example: 403
                  error:
                    type: string
                    example: Forbidden
                  message:
                    type: string
                    example: >-
                      Workspace suspended due to a high bounce or spam complaint
                      rate. Please contact support.
                  code:
                    type: string
                    description: >-
                      Machine-readable error code. Branch on this, not on the
                      message.
                    example: WORKSPACE_SUSPENDED
        '404':
          description: The resource does not exist in this workspace.
          content:
            application/json:
              schema:
                type: object
                description: The resource does not exist in this workspace.
                properties:
                  statusCode:
                    type: number
                    example: 404
                  error:
                    type: string
                    example: Not Found
                  message:
                    type: string
                    example: Not found
                  code:
                    type: string
                    description: >-
                      Machine-readable error code. Branch on this, not on the
                      message.
                    example: NOT_FOUND
        '408':
          description: >-
            The request timed out. The outcome is unknown: a write may or may
            not have been applied. Read the resource back before retrying.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  The request timed out. The outcome is unknown: a write may or
                  may not have been applied. Read the resource back before
                  retrying.
                properties:
                  statusCode:
                    type: number
                    example: 408
                  error:
                    type: string
                    example: Request Timeout
                  message:
                    type: string
                    example: An internal error occurred
        '409':
          description: The request conflicts with the current state of the resource.
          content:
            application/json:
              schema:
                type: object
                description: The request conflicts with the current state of the resource.
                properties:
                  statusCode:
                    type: number
                    example: 409
                  error:
                    type: string
                    example: Conflict
                  message:
                    type: string
                    example: The resource has changed. Reload it and try again.
                  code:
                    type: string
                    description: >-
                      Machine-readable error code. Branch on this, not on the
                      message.
                    example: CONFLICT
        '429':
          description: >-
            You have exceeded the rate limit. Please check the rate limit docs
            for more information.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 429
                    examples:
                      - 429
                    example: 429
                  error:
                    type: string
                    enum:
                      - Too Many Requests
                    examples:
                      - Too Many Requests
                    example: Too Many Requests
                  message:
                    type: string
                    examples:
                      - Rate limit exceeded
                    example: Rate limit exceeded
                required:
                  - statusCode
                  - error
                  - message
        '500':
          description: >-
            An internal error occurred. The outcome is unknown: a write may or
            may not have been applied. Read the resource back before retrying.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  An internal error occurred. The outcome is unknown: a write
                  may or may not have been applied. Read the resource back
                  before retrying.
                properties:
                  statusCode:
                    type: number
                    example: 500
                  error:
                    type: string
                    example: Internal Server Error
                  message:
                    type: string
                    example: An internal error occurred
        '503':
          description: Contact counts are temporarily unavailable. Retry later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 503
                    examples:
                      - 503
                    example: 503
                  error:
                    type: string
                    enum:
                      - Service Unavailable
                    examples:
                      - Service Unavailable
                    example: Service Unavailable
                  message:
                    type: string
                    examples:
                      - An internal error occurred
                    example: An internal error occurred
                required:
                  - statusCode
                  - error
                  - message
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.