---
title: "Get monthly billing metrics"
method: POST
path: "/api/v2/billing-insights/month-details"
tags: ["BillingInsights"]
---

# Get monthly billing metrics

`POST /api/v2/billing-insights/month-details`

## Request

- Base URL: `https://billing-insights.api.relativity.one/billing-drilldown-api`
- URL: `https://billing-insights.api.relativity.one/billing-drilldown-api/api/v2/billing-insights/month-details`
- Auth: none required
- TypeScript: <https://skmtc.dev/relativity/apis/billing-insights-api/docs/api/v2/billing-insights/month-details/post.ts> (a function with typed inputs; its response is checked against the schema)

Get monthly billing metrics at the specific level (Workspace, Matter, Client, Instance) for a given date. If the requested data does not exist then an empty list will be returned (e.g. instance didn't exist in a given month)

## Request body

- GetMonthDetailsRequest: Request body used in month-details API
  - `dateKey` string, nullable: Specifies the year and the month for which details should be returned. Format: YYYYMM.
  - `metricKeys` string[], nullable: An array of metric keys for which the data should be returned. If no metric keys are provided, no metrics will be returned. List of possible values: - Relativity_Storage_Review - Relativity_Storage_Repository - Relativity_Storage_ColdStorage - Relativity_Users_RelOne - Relativity_Users_Server - Relativity_Users_NonBillable - Relativity_Storage_Staging - Relativity_Translate - Relativity_PI_Detect - Relativity_DB_Response - Relativity_Contracts_Document - aiR_for_Review - aiR_for_Privilege - aiR_for_CaseStrategy.AppInstallation - aiR_for_CaseStrategy.WorkspaceOneTimeFee - aiR_for_CaseStrategy.Document - FOIA_Request - FOIA_DisclosureCenter_Storage - FOIA_ReadingRoom_Storage - MigrationAccelerator_Credit (workspace level only; present for every workspace of a contract in the Migration Accelerator program; workspaces without credit carry comment 'Not migrated')
  - `subMetricsSummaryKeys` string[], nullable: An array of submetric keys for subMetricsSummary fields for which the data should be returned. If no submetric keys are provided, no submetrics will be returned under subMetricsSummary fields. Keep in mind that all submetrics under main metric keys (Review, Repo etc.) will be returned despite this parameter. List of possible values: - Relativity_Storage_TextOnlyDocuments - Relativity_Storage_Linked
  - `selectorLevel` 'Workspace' | 'Matter' | 'Client' | 'Instance' | 'Contract': Specifies the hierarchy level for which _itemSelectors_ should apply. The _itemSelectors_ contract level is not supported.
  - `itemSelectors` HierarchyItemSelector[], nullable: Allows to filter the results. An item selector uniquely identifies element in hierarchy. The following list specifies what property / properties should be set for each level: - Contract: _contractId_ [string] - Instance: _instanceId_[string] - Client: _instanceId_[string], _clientArtifactID_[int] - Matter: _instanceId_[string], _matterArtifactID_[int] - Workspace: _instanceId_[string], _workspaceArtifactID_[int]
    - `contractID` string, nullable
    - `instanceID` string, nullable
    - `clientArtifactID` integer, nullable
    - `matterArtifactID` integer, nullable
    - `workspaceArtifactID` integer, nullable
  - `level` 'Workspace' | 'Matter' | 'Client' | 'Instance' | 'Contract': Specifies the hierarchy level for which the data should be returned
  - `filters` FieldFilter[], nullable: Allows to specify filters that should be applied to the query.
    - `fieldName` string, nullable: Name of a field to which filtering will be applied
    - `operator` string, nullable: Specifies a filtering operator List of possible values: - "=" - "<" - ">" - "<=" - ">="
    - `value` string, nullable: Specifies a filter value
  - `order` FieldOrder: Allows to specify order that should be applied to the query result
    - `fieldName` string, nullable: Specifies the field name which should be used for sorting the results. The field matches the structure of the response payload, with the exception that all the property names should be upper case instead of lower case.
    - `direction` 'Asc' | 'Desc': Specifies the sort direction
  - `pagingRequest` PagingRequest: Specifies paging options - _top_ and _skip_ values need to be either empty or populated. Specifying just a single value is considered a bad request. - if _top_ and _skip_ are specified and _maxItemCount_ is not specified, _continuationToken_ will not be returned.The API guarantees that all the records were populated, and there is no need to fetch additional records. - In all other cases, _continuationToken_ might be returned, indicating there are more records to fetch.
    - `top` integer, nullable: Return top N records
    - `skip` integer, nullable: Exclude first N records
    - `maxItemCount` integer, nullable: Specifies maximum number of records that should be returned from the API - If there are more records to fetch, the _continuationToken_ is returned in the _pagingResponse_
    - `includeCount` boolean, nullable: Specifies that _totalRecordCount_ should be included in the _pagingResponse_
    - `continuationToken` string, nullable
  - `shouldUnhashData` boolean: Specifies if the response should include unhashed data. Default value is false.
  - `includeMaxPrecision` boolean: Specifies if `reportedValueMaxPrecision` should be included on usage metrics that have it. Default value is false. A caller that does not set this stays on the rounded `reportedValue` it already gets today, even after the upstream full-precision data becomes available - the extra field is opt-in, not automatic.

## Response `200`

OK

- GetMonthDetailsResponse
  - `results` GetMonthDetailsResponseItem[], nullable
    - `contract` Contract: Contract information
      - `id` string, nullable: ID of the contract
      - `name` string, nullable: Name of the contract
    - `instance` Instance: Instance information
      - `id` string, nullable: Instance ID (GUID)
      - `name` string, nullable: Instance name
      - `pricingVisibility` 'Visible' | 'HiddenResoldInstance' | 'HiddenFixedContract': Instance pricing visibility: - Visible : pricing details are visible - HiddenResoldInstance : pricing details are hidden due to resold of the instance - HiddenFixedContract : pricing details are hidden because of fixed contracts with zero rates
    - `client` Client: Client information.
      - `artifactID` integer: Artifact ID of the client
      - `name` string, nullable: Name of the client
      - `status` string, nullable: Status of the client
      - `anonymization` string, nullable: Flag that identifies if client data is hashed. If the value is _Hashed_ then value of a _Name_ field is replaced with hash List of possible values: - Hashed - None
      - `anonymizedFields` object, nullable: Dictionary that holds what type of client data is hashed.
      - `number` string, nullable: Number of the client
    - `matter` Matter: Matter information
      - `artifactID` integer: Artifact ID of the matter
      - `name` string, nullable: Name of the matter
      - `anonymization` string, nullable: Flag that identifies if matter data is hashed. If the value is _Hashed_ then value of a _Name_ field is replaced with hash List of possible values: - Hashed - None
      - `anonymizedFields` object, nullable: Object that holds what type of matter data is hashed.
      - `number` string, nullable: Number of the matter
    - `workspace` Workspace: Workspace information
      - `id` string, nullable: ID of the workspace (GUID)
      - `artifactID` integer: Artifact ID of the workspace
      - `name` string, nullable: Name of the workspace
      - `activityStatus` string, nullable: Activity status
      - `workspaceStatus` string, nullable: Workspace status. Could be one of the following: - Active - Inactive - Archived - Deleted
      - `billableStatus` string, nullable: Specifies billable status of the workspace List of possible values: - Billable - Non-billable - Billable Plaintiff
      - `billableComment` string, nullable: Additional information about billable status, populated when _billableStatus_ is _Non-billable_
      - `anonymization` string, nullable: Flag that identifies if workspace data is hashed. If the value is _Hashed_ then value of a _Name_ field is replaced with _ArtifactID_ value. List of possible values: - Hashed - None
      - `billableType` string, nullable: Specifies billable type of the workspace List of possible values: - Repository - Review - Cold Storage
      - `anonymizedFields` object, nullable: Object that holds what type of workspace data is hashed.
      - `projectType` string, nullable: Object that holds what type of use case the workspace has.
    - `usageMetrics` object, nullable: Usage metric represents current usage of the data or in case if previous month is requested it will represent state from the last day of monthly report. Each property in this object is one of the _metricKeys_ specified in the request. If the usage metric does not exist for given item, it will be missing in the object.
    - `pricedMetrics` object, nullable: Priced metric represents billable data on the date when peak of the usage occurred. Each property in this object is one of the _metricKeys_ specified in the request. If the priced metric does not exist for given item, it will be missing in the object.
    - `pricedMetricsSubMetricsSummary` object, nullable: Submetrics related to the priced metric. Each property in this object is one of the _subMetricsSummaryKeys_ specified in the request. If the submetric does not exist for priced item, it will have zero Value in the object.
    - `usageMetricsSubMetricsSummary` object, nullable: Submetrics related to the usage metric. Each property in this object is one of the _subMetricsSummaryKeys_ specified in the request. If the submetric does not exist for usage item, it will have zero Value in the object.
  - `pagingResponse` PagingResponse: Paging information about the response. If the caller wants to obtain the rest of the result set there should be subsequent request made with same parameters and _continuationToken_ included in the _PagingRequest.continuationToken_
    - `totalRecordCount` integer, nullable: If _PagingRequest.includeCount_ was set to true, total number of records will be returned
    - `continuationToken` string, nullable: If the field is present it means that not the whole result set was included in the response and there are additional results to be retrieved
  - `status` 'OK' | 'ContractExpired' | 'ContractNotAvailable' | 'ContractInPreparation' | 'MissingDataForContract' | 'FunctionalityDisabled' | 'MissingMetricsGuid'

---

[API](https://skmtc.dev/relativity/apis/billing-insights-api.md) - [All operations](https://skmtc.dev/relativity/apis/billing-insights-api/llms.txt) - [OpenAPI document](https://skmtc.dev/relativity/apis/billing-insights-api/revisions/f6fa4175d8c9?raw)
