product-usage

Uoms Create

POST
Creates a Unit of Measurement on a part.

Request

This endpoint expects an object.
aggregation_detail
objectRequired
Stores aggregation type and dimension information.
metric_name
stringRequired

Name of the Unit of Measurement (UOM). Unit of Measurement is a unit of measure defined over a part offered by a Dev Org. A single part can have multiple unit of measurements defined over it. For example, a part can be ‘video call’, one UOM defined on this can be ‘number_of_calls’, other UOM can be ‘call_duration’ etc.Metric name should be unique across all UOMs in a Dev Org.Metric name can only contain alphanumeric characters (A-Z, a-z, and 0-9) and underscores (_). Metric name cannot start with a number and is case-insensitive.

name
stringRequired
Human readable name of the Unit of Measurement (UOM).
product_id
stringRequired
The product ID for which the Unit of Measurement (UOM) is defined.
unit
objectRequired

Unit encapsulates the name of the unit and the type of the unit. For example, ‘#Number of API calls’ where name is ‘number_of_api_calls’ and type is ‘number’.

description
stringOptional
Description of the Unit of Measurement (UOM).
dimensions
list of stringsOptional

The list of dimensions that can be emitted as part of metrics data. Dimensions consist of list of key-value pairs. For example, if the UOM is ‘number_of_api_calls’, then dimensions can be [‘api_name’, ‘api_version’].Dimension keys can only contain alphanumeric characters (A-Z, a-z, and 0-9) and underscores (_). Dimension keys cannot start with a number and is case-insensitive.Dimension keys must be unique and it is not allowed to have more than one value with the same key.Metrics data ingested in DevRev metrics format will be grouped and aggregated based on the dimensions specified in UOM.

part_id
stringOptional
The part ID for which the Unit of Measurement (UOM) is defined. When defined, ingested metrics data will be associated with part and product specified in UOM.

Response

This endpoint returns an object
uom
object
POST
1curl -X POST https://api.devrev.ai/uoms.create \
2 -H "Authorization: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "aggregation_detail": {
6 "aggregation_type": "duration"
7 },
8 "metric_name": "string",
9 "name": "string",
10 "product_id": "string",
11 "unit": {
12 "name": "string",
13 "type": "boolean"
14 }
15}'
200
Successful
1{
2 "uom": {
3 "aggregation_details": {
4 "aggregation_type": "duration",
5 "unique_dimension": "string"
6 },
7 "id": "string",
8 "is_enabled": true,
9 "metric_name": "string",
10 "metric_scope": "org",
11 "name": "string",
12 "product": {
13 "type": "capability",
14 "id": "string",
15 "name": "string",
16 "display_id": "string"
17 },
18 "unit": {
19 "name": "string",
20 "type": "boolean"
21 },
22 "created_by": {
23 "type": "dev_user",
24 "id": "string",
25 "display_id": "string",
26 "display_name": "string",
27 "display_picture": {
28 "id": "string",
29 "display_id": "string"
30 },
31 "email": "string",
32 "full_name": "string",
33 "state": "active"
34 },
35 "created_date": "2023-01-01T00:00:00Z",
36 "description": "string",
37 "dimensions": [
38 "string"
39 ],
40 "display_id": "string",
41 "modified_by": {
42 "type": "dev_user",
43 "id": "string",
44 "display_id": "string",
45 "display_name": "string",
46 "display_picture": {
47 "id": "string",
48 "display_id": "string"
49 },
50 "email": "string",
51 "full_name": "string",
52 "state": "active"
53 },
54 "modified_date": "2023-01-01T00:00:00Z",
55 "part": {
56 "type": "capability",
57 "id": "string",
58 "name": "string",
59 "display_id": "string"
60 }
61 }
62}