latestOpenAPI 3.0.02026-08-2217901.1 MB

ef9153fcac7c

Work Orders

Create new work order

post/workorders

Query parameters

skipWebhookboolean

Set skipWebhook=true to skip all webhooks upon successful work order creation.

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

assetIdinteger nullable
estimatedTimeinteger nullable

The estimated time taken in seconds to complete the work order

workRequestIdinteger nullable

ID of the Work Request that will be approved by the creation of this work order

workOrderTemplateIdinteger nullable

ID of the Work Order Template that will be used to create this work order. Note that data from the payload will overwrite the Template data. Also, restrictions defined by the Template (EG: Required/Hidden/Read-Only fields) will apply.

categoriesstring[]

List of categories that identify the work order

descriptionstring nullable
dueDatestring date-time nullable

Date & time at which the work order is due

isParentboolean nullable

Whether the work order is a parent work order. A parent work order has only a subset of the standard work order fields. It also has fields that aren't included in a standard work order. <a href='https://help.getmaintainx.com/multi-asset-work-orders?utm_source=mx-api-docs&utm_medium=web&utm_campaign=multi-asset-work-orders&utm_id=maintainx' target='_blank'>Learn more</a></br>Mutually exclusive with parentId

startDatestring date-time nullable

Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set

locationIdinteger nullable

Global ID of the location assigned to the work order

priority'NONE' | 'LOW' | 'MEDIUM' | 'HIGH'
procedureTemplateIdnumber nullable

ID of the procedure template to attach

skipRestHookboolean

When work order is created, will not trigger any rest hook that is subscribed

titlestring required
type'OTHER' | 'REACTIVE' | 'PREVENTIVE'

Valid types of Work Orders.

extraFieldsobject

Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: "Estimated Time Allotted")

vendorIdsnumber[]

Vendor IDs

parentIdnumber nullable

ID of the parent work order. If provided, the work order will be created as a sub-work order under this parent work order. Sub-work orders inherit most of their fields from the parent work order. <a href='https://help.getmaintainx.com/create-and-manage-sub-work-orders?utm_source=mx-api-docs&utm_medium=web&utm_campaign=create-and-manage-sub-work-orders&utm_id=maintainx' target='_blank'>Learn more</a></br>Mutually exclusive with isParent

Example request

{
  "assignees": [
    {
      "type": "USER"
    }
  ],
  "estimatedTime": 3600,
  "categories": [
    "Cleaning"
  ],
  "description": "A work order sample description",
  "dueDate": "2022-01-01T00:00:00.000Z",
  "externalData": {
    "popularErpSolutionId": "asd732da"
  },
  "startDate": "2022-01-01T00:00:00.000Z",
  "priority": "MEDIUM",
  "procedure": {
    "id": 1234,
    "title": "Control dashboard audit",
    "fields": [
      {
        "label": "Metal Parts: broken, loose, dented, rusty, missing",
        "type": "INSPECTION_CHECK",
        "choices": [
          "Partially"
        ],
        "urls": [
          {
            "label": "MaintainX Website",
            "link": "www.getmaintainx.com"
          }
        ],
        "meterId": 1,
        "index": 1
      }
    ]
  },
  "repeatability": {
    "automationMeterTrigger": {
      "newDueDateOffsetSeconds": 86400
    }
  },
  "extraFields": {
    "Estimated Time Allotted": "24 Hours"
  },
  "vendorIds": [
    1
  ],
  "partsUsed": [
    {
      "partId": 963,
      "quantityUsed": 120,
      "locationId": 852
    }
  ]
}

Response

Successfully created work order

idnumber required

Example response

{
  "id": 159
}