Uoms

Create UOM

Creates a Unit of Measurement on a part.

POST
/uoms.create
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_detailaggregation-detail

Stores aggregation type and dimension information.

description?string

Description of the Unit of Measurement (UOM).

Formattext
dimensions?array<string>

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.

Length1 <= length <= 64
Itemsitems <= 12
metric_namestring

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.

Formattext
Length1 <= length <= 64
namestring

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

Formattext
part_id?string

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.

Formatid
product_idstring

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

Formatid
unitunit

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'.

Response Body

curl -X POST "https://api.devrev.ai/uoms.create" \  -H "Content-Type: application/json" \  -d '{    "aggregation_detail": {      "aggregation_type": "duration"    },    "metric_name": "string",    "name": "string",    "product_id": "PROD-12345",    "unit": {      "type": "boolean",      "name": "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": "too_many_requests",
  "retry_after": 0
}
{
  "detail": "string",
  "message": "string",
  "type": "internal_error",
  "reference_id": "string"
}
{
  "detail": "string",
  "message": "string",
  "type": "service_unavailable"
}