# Get a funnel report (totals)

POST https://api.close.com/api/v1/report/funnel/opportunity/totals/
Content-Type: application/json

The opportunity funnel "totals" report returns the pipeline funnel's metrics for the selected opportunities, aggregated (JSON format only) and per-user (JSON and CSV formats).

Every report accepts the following parameters:

* `pipeline`: ID of the pipeline defining the funnel statuses.
* `type`: the type of the report. The available values are `created-cohort` and `active-stage-cohort`.
* `report_relative_range`: a relative time range to fetch data for. The allowed values are: `today`, `this-week`, `this-month`, `this-quarter`, `this-year`, `yesterday`, `last-week`, `last-month`, `last-quarter`, `last-year`, and `all-time`.
* `report_datetime_range`: a time range to fetch data for.
* `cohort_relative_range`: a relative time range defining the cohort of created opportunities to fetch data for, by date of creation of those opportunities. The allowed values are: `today`, `this-week`, `this-month`, `this-quarter`, `this-year`, `yesterday`, `last-week`, `last-month`, `last-quarter`, `last-year`, and `all-time`. Either this field or `cohort_datetime_range` needs to be specified for `created-cohort` reports. Its value will be ignored for `active-stage-cohort` reports.
* `cohort_datetime_range`: a time range defining the cohort of created opportunities to fetch data for, by date of creation of those opportunities. Either this field or `cohort_relative_range` needs to be specified for `created-cohort` reports. Its value will be ignored for `active-stage-cohort` reports.
* `compared_relative_range`: a relative time range to fetch comparison data for. Only allowed in combination with `report_relative_range` (for `active-stage-cohort` reports) or `cohort_relative_range` (for `created-cohort` reports). The allowed values are: `today`, `this-week`, `this-month`, `this-quarter`, `this-year`, `yesterday`, `last-week`, `last-month`, `last-quarter`, `last-year`, and `all-time`.
* `compared_datetime_range`: a relative time range to fetch comparison data for. Only allowed in combination with `report_datetime_range` (for `active-stage-cohort` reports) or `cohort_datetime_range` (for `created-cohort` reports). The allowed values are: `same-days-last-week`, `same-days-last-month`, `same-days-last-quarter`, `same-days-last-year`.
* `compared_custom_range`: a time range to fetch comparison data for.
* `query`: a query to apply to the report to filter out data.
  The value of the field is a dictionary with the key `type` and any type-specific keys. For now only the type `saved_search` is allowed which takes the extra key `saved_search_id` to specify the ID of a saved search. This parameter is *optional*.
* `users`: a list of user IDs or group IDs to limit the report results to. When it's empty, the report will include all the available users. This parameter is *optional*.

The report can be requested either in JSON format or in CSV format. The format can be specified with the `accept` header.

In JSON format, it includes aggregated and per-user data. When requested in CSV format, it includes only per-user data.

When `compared_datetime_range`, `compared_relative_range`, or `compared_custom_range` are used, the report returned is the compared one, not the base one.

Reference: https://developer.close.com/api/resources/reporting/get-funnel-totals

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Close API
  version: 1.0.0
paths:
  /report/funnel/opportunity/totals/:
    post:
      operationId: get-funnel-totals
      summary: Get a funnel report (totals)
      description: >-
        The opportunity funnel "totals" report returns the pipeline funnel's
        metrics for the selected opportunities, aggregated (JSON format only)
        and per-user (JSON and CSV formats).


        Every report accepts the following parameters:


        * `pipeline`: ID of the pipeline defining the funnel statuses.

        * `type`: the type of the report. The available values are
        `created-cohort` and `active-stage-cohort`.

        * `report_relative_range`: a relative time range to fetch data for. The
        allowed values are: `today`, `this-week`, `this-month`, `this-quarter`,
        `this-year`, `yesterday`, `last-week`, `last-month`, `last-quarter`,
        `last-year`, and `all-time`.

        * `report_datetime_range`: a time range to fetch data for.

        * `cohort_relative_range`: a relative time range defining the cohort of
        created opportunities to fetch data for, by date of creation of those
        opportunities. The allowed values are: `today`, `this-week`,
        `this-month`, `this-quarter`, `this-year`, `yesterday`, `last-week`,
        `last-month`, `last-quarter`, `last-year`, and `all-time`. Either this
        field or `cohort_datetime_range` needs to be specified for
        `created-cohort` reports. Its value will be ignored for
        `active-stage-cohort` reports.

        * `cohort_datetime_range`: a time range defining the cohort of created
        opportunities to fetch data for, by date of creation of those
        opportunities. Either this field or `cohort_relative_range` needs to be
        specified for `created-cohort` reports. Its value will be ignored for
        `active-stage-cohort` reports.

        * `compared_relative_range`: a relative time range to fetch comparison
        data for. Only allowed in combination with `report_relative_range` (for
        `active-stage-cohort` reports) or `cohort_relative_range` (for
        `created-cohort` reports). The allowed values are: `today`, `this-week`,
        `this-month`, `this-quarter`, `this-year`, `yesterday`, `last-week`,
        `last-month`, `last-quarter`, `last-year`, and `all-time`.

        * `compared_datetime_range`: a relative time range to fetch comparison
        data for. Only allowed in combination with `report_datetime_range` (for
        `active-stage-cohort` reports) or `cohort_datetime_range` (for
        `created-cohort` reports). The allowed values are:
        `same-days-last-week`, `same-days-last-month`, `same-days-last-quarter`,
        `same-days-last-year`.

        * `compared_custom_range`: a time range to fetch comparison data for.

        * `query`: a query to apply to the report to filter out data.
          The value of the field is a dictionary with the key `type` and any type-specific keys. For now only the type `saved_search` is allowed which takes the extra key `saved_search_id` to specify the ID of a saved search. This parameter is *optional*.
        * `users`: a list of user IDs or group IDs to limit the report results
        to. When it's empty, the report will include all the available users.
        This parameter is *optional*.


        The report can be requested either in JSON format or in CSV format. The
        format can be specified with the `accept` header.


        In JSON format, it includes aggregated and per-user data. When requested
        in CSV format, it includes only per-user data.


        When `compared_datetime_range`, `compared_relative_range`, or
        `compared_custom_range` are used, the report returned is the compared
        one, not the base one.
      tags:
        - subpackage_reporting
      parameters:
        - name: Authorization
          in: header
          description: Basic authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/reporting_getFunnelTotals_Response_200'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                description: Any type
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                description: Any type
        '404':
          description: Not found
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              description: Any type
servers:
  - url: https://api.close.com/api/v1
components:
  schemas:
    reporting_getFunnelTotals_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: reporting_getFunnelTotals_Response_200
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: basic
    OAuth2:
      type: http
      scheme: bearer

```