Work Requests

Create or update work request by external ID

Changed on

Idempotent upsert keyed on the external ID in the path. If a work request has this external ID, it will be updated (and undeleted, if the work request was previously deleted). Otherwise, a new work request will be created with this external ID.

patch/workrequests/external/{externalId}

Request

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

Path parameters

externalIdstring required

External ID of the work request

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

titlestring
descriptionstring nullable
priority'NONE' | 'LOW' | 'MEDIUM' | 'HIGH'
assetIdnumber nullable
locationIdnumber nullable
extraFieldsobject

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

approverTeamIdnumber nullable

ID of the team that is reponsible for approving the request.

creatorContactInfostring nullable

The creator's contact information associated with this work order request. Possible types are EMAIL, PHONE, and OTHER, which will be inferred from the string provided

Example request

{
  "title": "Forklift Preventive Maintenance Form",
  "description": "A forklift that needs to be reviewed for any potential problems",
  "priority": "MEDIUM",
  "assetId": 843,
  "locationId": 852,
  "extraFields": {
    "Request Type": "Water Leak"
  },
  "approverTeamId": 254,
  "creatorContactInfo": "james@example.com"
}

Response

Successfully updated work request

Example response

{
  "workRequest": {
    "id": 963,
    "title": "Forklift Preventive Maintenance Form",
    "attachments": [
      {
        "id": 12345,
        "mimeType": "image/png",
        "fileName": "image.png",
        "url": "http://example.com/image.png",
        "createdAt": "2022-01-01T00:00:00.000Z",
        "width": 220,
        "height": 100
      }
    ],
    "thumbnail": {
      "id": 12345,
      "mimeType": "image/png",
      "fileName": "image.png",
      "url": "http://example.com/image.png",
      "createdAt": "2022-01-01T00:00:00.000Z",
      "width": 220,
      "height": 100
    },
    "priority": "MEDIUM",
    "description": "A forklift that needs to be reviewed for any potential problems",
    "requestStatus": "PENDING",
    "assetId": 843,
    "locationId": 852,
    "workOrderId": 254,
    "sendEmailNotification": true,
    "extraFields": {
      "Request Type": "Water Leak"
    },
    "approverTeamId": 254,
    "creatorContactInfo": {
      "type": "EMAIL",
      "value": "james@example.com"
    },
    "createdAt": "2022-01-01T00:00:00.000Z",
    "updatedAt": "2022-01-01T00:00:00.000Z",
    "externalId": "ext-workrequest-001"
  }
}

Changes