Skip to main content
POST
/
organizations
/
{orgId}
/
meters
Create Meter
curl --request POST \
  --url https://api.m3ter.com/organizations/{orgId}/meters \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "code": "<string>",
  "dataFields": [
    {
      "category": "WHO",
      "code": "<string>",
      "name": "<string>",
      "unit": "<string>"
    }
  ],
  "derivedFields": [
    {
      "category": "WHO",
      "code": "<string>",
      "name": "<string>",
      "calculation": "<string>",
      "unit": "<string>"
    }
  ],
  "version": 123,
  "customFields": "<unknown>",
  "productId": "<string>",
  "groupId": "<string>"
}
'
{
  "id": "<string>",
  "version": 123,
  "customFields": {},
  "productId": "<string>",
  "groupId": "<string>",
  "name": "<string>",
  "code": "<string>",
  "dataFields": [
    {
      "category": "WHO",
      "code": "<string>",
      "name": "<string>",
      "unit": "<string>"
    }
  ],
  "derivedFields": [
    {
      "category": "WHO",
      "code": "<string>",
      "name": "<string>",
      "calculation": "<string>",
      "unit": "<string>"
    }
  ],
  "dtCreated": "2023-11-07T05:31:56Z",
  "dtLastModified": "2023-11-07T05:31:56Z",
  "createdBy": "<string>",
  "lastModifiedBy": "<string>"
}

Authorizations

Authorization
string
header
required

m3ter supports machine to machine authentication using the clientCredentials OAuth2 flow.

The authorizationCode flow controls access for human users via the m3ter Console application.

Path Parameters

orgId
string
required

UUID of the organization. The Organization represents your company as a direct customer of the m3ter service.

Body

application/json
name
string
required

Descriptive name for the Meter.

Required string length: 1 - 200
code
string
required

Code of the Meter - unique short code used to identify the Meter.

NOTE: Code has a maximum length of 80 characters and must not contain non-printable or whitespace characters (except space), and cannot start/end with whitespace.

Required string length: 1 - 80
dataFields
object[]
required

Used to submit categorized raw usage data values for ingest into the platform - either numeric quantitative values or non-numeric data values. At least one required per Meter; maximum 15 per Meter.

Required array length: 1 - 15 elements
derivedFields
object[]
required

Used to submit usage data values for ingest into the platform that are the result of a calculation performed on dataFields, customFields, or system Timestamp fields. Raw usage data is not submitted using derivedFields. Maximum 15 per Meter. (Optional).

Note: Required parameter. If you want to create a Meter without Derived Fields, use an empty array []. If you use a null, you'll receive an error.

Maximum array length: 15
version
integer<int64>

The version number of the entity:

  • Create entity: Not valid for initial insertion of new entity - do not use for Create. On initial Create, version is set at 1 and listed in the response.
  • Update Entity: On Update, version is required and must match the existing version because a check is performed to ensure sequential versioning is preserved. Version is incremented by 1 and listed in the response.
customFields
any
productId
string

UUID of the product the Meter belongs to. (Optional) - if left blank, the Meter is global.

Required string length: 36
groupId
string

UUID of the group the Meter belongs to. (Optional).

Required string length: 36

Response

Return the created Meter

id
string
required

The UUID of the entity.

version
integer<int64>

The version number:

  • Create: On initial Create to insert a new entity, the version is set at 1 in the response.
  • Update: On successful Update, the version is incremented by 1 in the response.
customFields
object

User defined fields enabling you to attach custom data. The value for a custom field can be either a string or a number.

If customFields can also be defined for this entity at the Organizational level,customField values defined at individual level override values of customFields with the same name defined at Organization level.

See Working with Custom Fields in the m3ter documentation for more information.

productId
string

UUID of the Product the Meter belongs to. (Optional) - if blank, the Meter is global.

groupId
string

UUID of the MeterGroup the Meter belongs to. (Optional).

name
string

Descriptive name for the Meter.

code
string

Code of the Meter - unique short code used to identify the Meter.

dataFields
object[]

Used to submit categorized raw usage data values for ingest into the platform - either numeric quantitative values or non-numeric data values. At least one required per Meter; maximum 15 per Meter.

derivedFields
object[]

Used to submit usage data values for ingest into the platform that are the result of a calculation performed on dataFields, customFields, or system Timestamp fields. Raw usage data is not submitted using derivedFields. Maximum 15 per Meter. (Optional).

dtCreated
string<date-time>

The DateTime when the meter was created (in ISO-8601 format).

dtLastModified
string<date-time>

The DateTime when the meter was last modified (in ISO-8601 format).

createdBy
string

The id of the user who created this meter.

lastModifiedBy
string

The id of the user who last modified this meter.