Maintenance Plans

Create a maintenance plan

Changed on
post/maintenanceplans

Request

  • Base URL
    https://api.getmaintainx.com/v1
  • Auth
    HTTP bearer

Query parameters

skipWebhookboolean

Set skipWebhook=true, skipWebhook=1 or skipWebhook=yes to skip all webhooks upon successful operation on the endpoint. Learn more about webhooks

Headers

x-organization-idinteger

Required if using a multi organizations token

Request body

namestring required

Name of the maintenance plan.

startDatestring date-time

The first due date for generated work orders.

workOrderBlueprintIdnumber required

ID of the maintenance plan work order blueprint used to generate work orders. These can be created through the /maintenanceplans/workorderblueprints endpoint.

workOrderStartDatePaddingnumber

Hours between the start date and due date of generated work orders. Deprecated: use workOrderStartDateOffset instead.

triggerType'CALENDAR' | 'METER' | 'CALENDAR_OR_METER'

What triggers work order generation. METER and CALENDAR_OR_METER require the meter configuration fields.

intervalStrategy'FIXED' | 'FLOATING'

The interval strategy for the schedule. FLOATING requires a PERIODICALLY recurrence, and CALENDAR_OR_METER plans must use FLOATING.

meterIdinteger nullable

Global ID of the meter driving this plan. Null unless triggerType is METER or CALENDAR_OR_METER.

meterTriggerCondition'INCREASED_BY' | 'DECREASED_BY' nullable

Direction the meter must move to trigger work order generation. INCREASED_BY suits meters that climb (odometer, run hours); DECREASED_BY suits meters that fall (fuel level, coolant).

meterIntervalValueinteger nullable

Usage cycle between work orders, in the meter's own unit.

meterHorizonValueinteger nullable

Lead buffer, in meter units, for generating the work order before the next due value is reached.

meterNextDueValueinteger nullable

Meter reading at which the next work order is due.

nextCycleOccurrencenumber

Which cycle in the multi-cycle sequence comes next.

Example request

{
  "name": "Weekly Conveyor Belt Inspection",
  "startDate": "2022-01-01T00:00:00.000Z",
  "workOrderBlueprintId": 10,
  "workOrderStartDatePadding": 48,
  "workOrderStartDateOffset": {
    "value": 2,
    "unit": "DAY"
  },
  "planningHorizon": {
    "value": 3,
    "unit": "WEEK"
  },
  "triggerType": "CALENDAR",
  "intervalStrategy": "FIXED",
  "meterId": 123,
  "meterTriggerCondition": "INCREASED_BY",
  "meterIntervalValue": 5000,
  "meterHorizonValue": 1000,
  "meterNextDueValue": 10000,
  "meterGenerationStartOffset": {
    "value": 2,
    "unit": "DAY"
  },
  "meterGenerationDueOffset": {
    "value": 4,
    "unit": "DAY"
  },
  "planAssets": [
    {
      "assetId": 100
    }
  ],
  "intervals": [
    {
      "interval": 3,
      "workOrderBlueprintId": 50
    }
  ],
  "nextCycleOccurrence": 2
}

Response

Successfully created the maintenance plan.

idnumber required

ID of the created maintenance plan.

Example response

{
  "id": 1
}

Changes

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added subschema #5: Periodically to the request property oneOf list