Uoms

Update UOM

Updates a Unit of Measurement.

POST
/uoms.update
AuthorizationBearer <token>

All the DevRev APIs require a token to authenticate the user. Provide Authorization: Bearer <TOKEN> as a header to every API request. How do I find my token?

In: header

aggregation_type?aggregation-detail-aggregation-type

Aggregation type to be used while aggregating the metering data for the UOM. 1] Sum - sum of all the values for the meter in a given period Ex. { M1:2, M1:4 } => {M1:6} 2] Minimum - min of all the values for the meter in a given period Ex. { M1:2, M1:4 } => {M1:2} 3] Maximum - max of all the values for the meter in a given period Ex. { M1:2, M1:4 } => {M1:4} 4] Unique Count - Sum of distinct unique dimension observed for the meter in the given period (not considering the data from the previous billing period) Ex. January {M1:{VM:VM0}}, February {M1:{VM:VM1}, M1:{VM:VM2}, M1:{VM:VM1}} => {M1:2} 5] Running Total - Sum of distinct active unique dimension observed for a meter in the given period, taking into consideration the active data from the previous billing cycle Ex. January {M1:{VM:VM0,on}, {M1:{VM:VM1,off} February {M1:{VM:VM2, on}, M1:{VM:VM2, off}, M1:{VM:VM3, on}} => {M1:3} 6] Duration - Sum of distinct active unique dimension duration for a meter in the given period, taking into consideration the active data from the previous month Ex. January15 {M1:{VM:VM0,on, 4}} February15 {M1:{VM:VM0,off}, February18 {M1:{VM:VM1,on,5} => M1-> 304charge_per_day + 105charge_per_day 7] Latest - consider the latest/last meter in the given period 8] Oldest - consider the oldest/first record in the given period.

Value in"duration" | "latest" | "maximum" | "minimum" | "oldest" | "running_total" | "sum" | "unique_count"
description?string

Description of the Unit of Measurement (UOM).

Formattext
dimensions?uoms-update-request-dimensions
idstring

The Unit of Measurement (UOM)'s DON.

Formatid
is_enabled?boolean

Flag used to enable/disable the Unit of Measurement (UOM). When disabled, any metricsrecords ingested against this UOM will be dropped.

name?string

Human readable name of the Unit of Measurement (UOM).

Formattext
part_id?string

The part ID such as feature or capability for which the Unit of Measurement (UOM) is defined.

Formatid
product_id?string

The product ID for which the Unit of Measurement (UOM) is defined.

Formatid
unit?string

Unit name of the Unit of Measurement (UOM).

Formattext

Response Body

curl -X POST "https://api.devrev.ai/uoms.update" \  -H "Content-Type: application/json" \  -d '{    "id": "string"  }'
{
  "uom": {
    "created_by": {
      "type": "dev_user",
      "display_id": "string",
      "id": "string",
      "display_name": "string",
      "display_picture": {
        "display_id": "string",
        "id": "string",
        "file": {
          "type": "string",
          "name": "string",
          "size": 0
        }
      },
      "email": "string",
      "full_name": "string",
      "state": "active"
    },
    "created_date": "2023-01-01T12:00:00.000Z",
    "display_id": "string",
    "id": "string",
    "modified_by": {
      "type": "dev_user",
      "display_id": "string",
      "id": "string",
      "display_name": "string",
      "display_picture": {
        "display_id": "string",
        "id": "string",
        "file": {
          "type": "string",
          "name": "string",
          "size": 0
        }
      },
      "email": "string",
      "full_name": "string",
      "state": "active"
    },
    "modified_date": "2023-01-01T12:00:00.000Z",
    "aggregation_details": {
      "aggregation_type": "duration",
      "unique_dimension": "string"
    },
    "description": "string",
    "dimensions": [
      "string"
    ],
    "is_enabled": true,
    "metric_name": "string",
    "metric_scope": "org",
    "name": "string",
    "part": {
      "type": "capability",
      "display_id": "string",
      "id": "string",
      "name": "string",
      "owned_by": [
        {
          "type": "dev_user",
          "display_id": "string",
          "id": "string",
          "display_name": "string",
          "display_picture": {
            "display_id": "string",
            "id": "string",
            "file": {
              "type": "string",
              "name": "string",
              "size": 0
            }
          },
          "email": "string",
          "full_name": "string",
          "state": "active"
        }
      ],
      "sync_metadata": {
        "external_reference": "string",
        "origin_system": "string"
      }
    },
    "product": {
      "type": "capability",
      "display_id": "string",
      "id": "string",
      "name": "string",
      "owned_by": [
        {
          "type": "dev_user",
          "display_id": "string",
          "id": "string",
          "display_name": "string",
          "display_picture": {
            "display_id": "string",
            "id": "string",
            "file": {
              "type": "string",
              "name": "string",
              "size": 0
            }
          },
          "email": "string",
          "full_name": "string",
          "state": "active"
        }
      ],
      "sync_metadata": {
        "external_reference": "string",
        "origin_system": "string"
      }
    },
    "unit": {
      "type": "boolean",
      "name": "string"
    }
  }
}
{
  "detail": "string",
  "message": "string",
  "type": "artifact_already_attached_to_a_parent",
  "existing_parent": "string",
  "is_same": true
}
{
  "detail": "string",
  "message": "string",
  "type": "unauthenticated"
}
{
  "detail": "string",
  "message": "string",
  "type": "forbidden"
}
{
  "detail": "string",
  "message": "string",
  "type": "not_found"
}
{
  "detail": "string",
  "message": "string",
  "type": "too_many_requests",
  "retry_after": 0
}
{
  "detail": "string",
  "message": "string",
  "type": "internal_error",
  "reference_id": "string"
}
{
  "detail": "string",
  "message": "string",
  "type": "service_unavailable"
}