---
title: "Create meter trigger"
method: POST
path: "/metertriggers"
tags: ["Meter Triggers"]
---

# Create meter trigger

`POST /metertriggers`

## Query parameters

- `skipWebhook` boolean

## Headers

- `x-organization-id` integer

## Request body

- object — The meter triger data
  - `meterTrigger` object, required
    - `meterId` integer, required
    - `workOrderTemplateId` integer — Id of an existing work order template. Once this is set, the `workOrderTemplate` object will completely be ignored in favour of the work order template associated with the id. NOTE: If this is set, the name of the meter trigger will match the name of the linked work order template.
    - `amount` number, required
    - `condition` 'DECREMENTED_BY' | 'INCREMENTED_BY' | 'IS_EQUAL' | 'IS_GREATER' | 'IS_LESS' | 'INCREMENTED_BY_BASED_ON_LAST_READING' | 'DECREMENTED_BY_BASED_ON_LAST_READING', required
    - `dataPoints` object
      - `numerator` integer, required — The number of data points out of "denominator" data points to trigger. E.g: 3 points out of 5 must be in a triggering state
      - `denominator` integer, required — The window of points where the condition gets checked
    - `description` string
    - `minDateForProcessing` string, date-time — Date that the trigger will start to be active
    - `name` string, required — Name of the trigger
    - `nextTriggerValue` number — Can be set to override the first trigger value
    - `period` integer, nullable — Window in seconds where the data points can be checked
  - `workOrderTemplate` object
    - `procedureTemplateId` integer, nullable — ID of the procedure template used
    - `saveProcedureAsTemplate` boolean, nullable — Save the procedure in data as a new procedure template
    - `title` string — Title of the work order that will be generated. Use the meter trigger's name instead. If both `workOrderTemplate.title` and `meterTrigger.name` are provided, `meterTrigger.name` will be used.
    - `data` object
      - `assetId` integer, nullable
      - `assigneeIds` number[] — Users IDs assigned to the template
      - `description` string, nullable
      - `dueDate` object, nullable
        - `type` 'OFFSET'
        - `offset` number
      - `locationId` integer, nullable — Global ID of the location assigned to the work order
      - `partsUsed` object[], nullable
        - `partId` integer — Global ID of the part
        - `quantityUsed` integer — Quantity used in the work order.
        - `locationId` integer, nullable — Global ID of the location of the part
        - `copyOnRecurring` 'NoCopy' | 'Copy' | 'Default' — Indicates if the parts will be copied to the next work order in the chain (if applicable).
      - `priority` 'NONE' | 'LOW' | 'MEDIUM' | 'HIGH'
      - `procedure` object, nullable
        - `id` number — You should favor 'procedureTemplateId' to attach a procedure template.
        - `title` string, required — Title of the procedure
        - `fields` object[], required — Steps of a procedure
          - `label` string, required
          - `type` 'NUMBER' | 'AMOUNT' | 'TEXT' | 'UNSUPPORTED' | 'HEADING' | 'FILE' | 'SIGNATURE' | 'MULTIPLE_CHOICE' | 'INSPECTION_CHECK' | 'YES_NO_NA' | 'CHECKBOX' | 'CHECKLIST' | 'METER' | 'DATE' | 'CYCLE_COUNT', required
          - `description` string, nullable
          - `choices` string[]
          - `urls` object[]
            - `label` string — Label of the url
            - `link` string, required — Link
          - `meterId` number, nullable — Id of the meter
          - `isDateAndTime` boolean — Indicate if a DATE field also contains the time
          - `index` number — Order which the row is displayed
      - `tagsIds` number[] — Categories IDs
      - `teamIds` number[] — Teams IDs
      - `title` string — Use the `title` field at the root level. If both `title` and `data.title` are provided, `title` will be used.
      - `vendorIds` number[] — Vendor IDs

## Response `201`

Successfully created the meter trigger

- object
  - `id` number, required — Id of the meter trigger

## Other responses

- `400` — Failed to create the meter trigger
- `401` — Invalid token

---

[API](https://skmtc.net/getmaintainx/apis/maintainx-api.md) · [All operations](https://skmtc.net/getmaintainx/apis/maintainx-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getmaintainx/maintainx-api/revisions/ef9153fcac7c/schema)
