{"openapi":"3.0.0","info":{"description":"\n<h1>REST API V1</h1>\n<p>Support: <a href=\"mailto:support@getmaintainx.com\">support@getmaintainx.com</a> | <a href=\"https://www.getmaintainx.com/\" target=\"_blank\">https://www.getmaintainx.com/</a></p>\n<p>This is the MaintainX REST API reference. It provides detailed documentation for endpoints, request parameters, response schemas, and error codes available.</p>\n<p>For setup guides, authentication walkthroughs, how-tos, etc., see the <a href=\"https://help.getmaintainx.com/build/build-with-maintainx\" target=\"_blank\">Build With MaintainX guide</a>.</p>\n\n<strong>What's in this reference:</strong>\n<ul>\n  <li>Full endpoint listings across all MaintainX entities (Work Orders, Assets, Parts, Locations, Users, and more)</li>\n  <li>Request and response schemas with field-level detail</li>\n  <li>Query parameters, filters, and pagination behavior</li>\n  <li>Authentication requirements and error codes</li>\n  <li>Subscriptions and webhooks for event-driven integrations</li>\n</ul>\n<strong>Base URL:</strong> <code>https://api.getmaintainx.com/v1</code>\n\n<p>All requests must be authenticated with a Bearer token (see <a href=\"https://app.getmaintainx.com/settings/integrations/apiKeys\">Settings &gt; Integrations &gt; API Keys</a> to generate a key).</p>\n<p>API access is available on Premium and Enterprise plans.</p>\n","version":"1","title":"MaintainX API","contact":{"url":"https://www.getmaintainx.com/","name":"Support","email":"support@getmaintainx.com"},"x-logo":{"url":"https://maintainx-static.s3.us-west-2.amazonaws.com/logo/adsk-maintainx-logo.svg","backgroundColor":"#FFFFFF","altText":"MaintainX, an Autodesk company"}},"servers":[{"url":"https://api.getmaintainx.com/v1","description":"Endpoint"}],"tags":[{"name":"Assets","description":"Operations on Assets","x-traitTag":false},{"name":"Asset Criticalities","description":"Operations on Asset Criticalities","x-traitTag":false},{"name":"Asset Statuses","description":"Operations on Asset Statuses","x-traitTag":false},{"name":"Asset Custom Statuses","description":"Operations on Asset Custom Statuses","x-traitTag":false},{"name":"Categories","description":"Operations on Categories","x-traitTag":false},{"name":"Conversations","description":"Operations on Conversations","x-traitTag":false},{"name":"Custom Fields","description":"Operations on Custom Fields","x-traitTag":false},{"name":"Locations","description":"Operations on Locations","x-traitTag":false},{"name":"Maintenance Plans","description":"Operations on Preventive Maintenance Plans","x-traitTag":false},{"name":"Meters","description":"Operations on Meters","x-traitTag":false},{"name":"Meter Readings","description":"Operations on Meter Readings","x-traitTag":false},{"name":"Meter Triggers","description":"Operations on Meter Triggers","x-traitTag":false},{"name":"Manufacturers","description":"Operations on Manufacturers and Models","x-traitTag":false},{"name":"Organizations","description":"Operations on Organizations","x-traitTag":false},{"name":"Parts","description":"Operations on Parts","x-traitTag":false},{"name":"Part Transfer Requests","description":"Operations on Part Transfer Requests","x-traitTag":false},{"name":"Procedure Templates","description":"Operations on Procedure Templates","x-traitTag":false},{"name":"Procedure Template Rows","description":"Operations on Procedure Template Rows","x-traitTag":false},{"name":"Purchase Orders","description":"Operations on Purchase Orders","x-traitTag":false},{"name":"Root Cause Analysis Reports","description":"Operations on Root Cause Analysis Reports","x-traitTag":false},{"name":"Subscriptions & Webhooks","description":"\n<p>This section is the technical reference for the MaintainX subscriptions and webhooks system. It provides detailed documentation for endpoints, payload schemas, event types, and delivery behavior.</p>\n\n<p>For guides on how to set up and use webhooks, including:</p>\n<ul>\n  <li>How to register a webhook URL.</li>\n  <li>Choosing the right events to subscribe to.</li>\n  <li>Handling incoming payloads in your application</li>\n</ul>\n<p>See the <a href=\"https://help.getmaintainx.com/build/webhooks\" target=\"_blank\">Webhooks guide</a> in the MaintainX Help Center.</p>\n\n<p>Every webhook payload includes an <code>eventType</code> field matching the event type of the subscription that triggered it, so you can discriminate which event produced a given delivery without relying on the destination URL.</p>\n\n<b>What's in this section:</b>\n<ul>\n  <li>Endpoint reference for subscriptions</li>\n  <li>Full event type catalog</li>\n  <li>Webhook payload structure and field definitions</li>\n  <li>Retry and delivery behavior</li>\n</ul>\n","x-traitTag":false},{"name":"Teams","description":"Operations on Teams","x-traitTag":false},{"name":"Users","description":"Operations on Users","x-traitTag":false},{"name":"Vendors","description":"Operations on Vendors","x-traitTag":false},{"name":"Work Orders","description":"Operations on Work Orders","x-traitTag":false},{"name":"Work Requests","description":"Operations on Work Requests","x-traitTag":false},{"name":"Work Request Portals","description":"Operations on Work Request Portals","x-traitTag":false},{"name":"Work Permits","description":"Operations for Work Permits","x-traitTag":false},{"name":"OpenAPI Documentation","description":"OpenAPI Specification Documentation","x-traitTag":false}],"paths":{"/assets":{"post":{"summary":"Create new asset","requestBody":{"description":"Asset to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"Forklift"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"teamIds":{"type":"array","items":{"type":"integer"},"description":"List of teams responsible for the asset","example":[123,456]},"assetTypes":{"type":"array","items":{"type":"string"},"example":["manual","tool"],"description":"List of asset types"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"My Custom Field\")","additionalProperties":{"type":"string"},"example":{"My Custom Field":"000000000"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"depreciation":{"type":"object","nullable":true,"description":"Depreciation information of the asset","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset depreciation."},"accumulatedDepreciation":{"type":"number","description":"Accumulated depreciation of the asset.","format":"decimal","nullable":true,"example":"5000.00"},"annualDepreciation":{"type":"number","description":"Annual depreciation of the asset.","format":"decimal","nullable":true,"example":"1000.00"},"depreciationStartDate":{"type":"string","description":"Date at which the asset depreciation started.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"currentBookValue":{"type":"number","description":"Current book value of the asset.","format":"decimal","nullable":true,"example":"7500.00"},"purchasePrice":{"type":"number","description":"Purchase price of the asset.","format":"decimal","nullable":true,"example":"12500.00"},"purchaseDate":{"type":"string","description":"Date & time at which the asset was purchased.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"salvageValue":{"type":"number","description":"Salvage value of the asset.","format":"decimal","nullable":true,"example":"2500.00"},"usefulLifeYears":{"type":"number","description":"Useful life of the asset in years.","format":"decimal","nullable":true,"example":10},"yearsDepreciated":{"type":"number","description":"Years depreciated of the asset.","format":"decimal","nullable":true,"example":5},"createdAt":{"type":"string","description":"Date & time at which the asset depreciation was created.","format":"date-time","example":"2022-01-01T00:00:00.000Z","nullable":true},"archivedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset depreciation was archived.","example":"2022-01-01T00:00:00.000Z","nullable":true}}},"externalId":{"type":"string","nullable":true,"description":"External ID for this asset, unique per organization.","example":"ext-asset-001"},"manufacturer":{"type":"object","nullable":true,"description":"Manufacturer information for the asset. Set to null to clear manufacturer and model.","properties":{"id":{"type":"integer","nullable":true,"description":"ID of an existing manufacturer. If provided, the manufacturer must be either global or belong to your organization. If not provided, the manufacturer will be looked up by name.","example":123},"name":{"type":"string","nullable":true,"description":"Name of the manufacturer. Required if id is not provided. When searching by name, the manufacturer must be either global or belong to your organization.","example":"ACME Corporation"}}},"model":{"type":"object","nullable":true,"description":"Model information for the asset. Set to null to clear model.","properties":{"id":{"type":"integer","nullable":true,"description":"ID of an existing model. If provided, the model must be linked to the specified manufacturer and be either global or belong to your organization. If not provided, the model will be looked up by name.","example":456},"name":{"type":"string","nullable":true,"description":"Name of the model. Required if id is not provided. When searching by name, the model must be linked to the specified manufacturer and be either global or belong to your organization.","example":"X-2000"}}}}}}}},"responses":{"201":{"description":"Successfully created asset","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"409":{"description":"Conflict with existing asset","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"conflictingMxId":{"type":"integer"},"isDeleted":{"type":"boolean"}},"required":["error","conflictingMxId","isDeleted"],"example":{"error":"Asset with externalId 'ext-123' already exists in this organization.","conflictingMxId":456,"isDeleted":false}}}}}},"tags":["Assets"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]},"get":{"summary":"List assets","description":"Endpoint used to list asset resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Assets returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"locationId","schema":{"type":"integer","description":"Will only show assets that are related to the location"},"in":"query"},{"name":"manufacturer","schema":{"type":"array","items":{"type":"string"},"description":"Filter assets by their manufacturer name"},"in":"query"},{"name":"model","schema":{"type":"array","items":{"type":"string"},"description":"Filter assets by their manufacturer model name"},"in":"query"},{"name":"updatedAt[gte]","schema":{"type":"string","format":"date-time","description":"Return records whose updatedAt is at or after this ISO 8601 date-time (UTC).","example":"2024-01-01T00:00:00.000Z"},"in":"query"},{"name":"updatedAt[lte]","schema":{"type":"string","format":"date-time","description":"Return records whose updatedAt is at or before this ISO 8601 date-time (UTC).","example":"2024-12-31T23:59:59.999Z"},"in":"query"},{"name":"createdAt[gte]","schema":{"type":"string","format":"date-time","description":"Return records whose createdAt is at or after this ISO 8601 date-time (UTC).","example":"2024-01-01T00:00:00.000Z"},"in":"query"},{"name":"createdAt[lte]","schema":{"type":"string","format":"date-time","description":"Return records whose createdAt is at or before this ISO 8601 date-time (UTC).","example":"2024-12-31T23:59:59.999Z"},"in":"query"},{"name":"customFieldName","schema":{"type":"array","items":{"type":"string"},"description":"Filter assets by custom field value. Your query parameter should be your custom field name. (ie: To filter by a custom field named \"Industry\" with the value \"Construction\", you would do this \"/assets?Industry=Construction\").\n                    <br><br>Adding multiple instance of the same custom field act as an <code>OR</code> and adding a different custom field act as an <code>AND</code>. (ie: To filter by a custom field named <code>Industry</code> with the value <code>Construction</code> OR <code>Transportation</code> AND the custom field <code>Manufacturer</code> with the value <code>ACME</code>, you would do this <code>/assets?Industry=Construction&Industry=Transportation&Manufacturer=ACME</code>).\n                    <br><br>If your custom field label is the same as a reserved query parameter such as <code>limit</code>, <code>sort</code>, <code>expand</code>, etc, you can add <code>__c</code> to your custom field filtering (ie: To filter by a custom field named <code>limit</code> with the value <code>ten</code>, you would do this <code>/assets?limit__c=ten</code>).\n                    <br><br>Note that your custom field needs to be created beforehand. Only number and single line text custom field types are supported."},"in":"query"},{"in":"query","name":"sort","schema":{"description":"Attribute on which to sort the list. (for descending order, prefix attribute with '-'). ","type":"string","enum":["id","createdAt","updatedAt","-id","-createdAt","-updatedAt"]}},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","description":"To expand multiple fields: `expand=barcode&expand=team_ids`","type":"array","items":{"type":"string","enum":["barcode","team_ids","asset_types","extra_fields","vendor_ids","depreciation","status","manufacturer","model"]}}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"},{"schema":{"type":"string"},"description":"Required if using a multi organizations token and doing an operation on resources from multiple organizations. This is mutually exclusive with the x-organization-id header (use one or the other).","name":"x-organization-ids","in":"header","required":false,"example":"1,2,3"}],"responses":{"200":{"description":"Successfully fetched Assets list","content":{"application/json":{"schema":{"type":"object","required":["assets","nextCursor","nextPageUrl"],"properties":{"assets":{"type":"array","items":{"type":"object","required":["id","name","description","parentId","criticalityId","locationId","serialNumber","createdAt","updatedAt","creatorId"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"},"name":{"type":"string","example":"Forklift"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the asset creator"},"organizationId":{"type":"integer","example":1,"description":"ID of the organization that owns this resource"},"externalId":{"type":"string","nullable":true,"description":"External ID for this asset, unique per organization.","example":"ext-asset-001"},"barcode":{"type":"string","nullable":false,"example":"BWFPBNRHAW54CG","description":"String encoded barcode (expand with query parameter)"},"teamIds":{"type":"array","items":{"type":"integer"},"description":"List of teams responsible for the asset (expand with query parameter)","example":[123,456],"nullable":false},"assetTypes":{"type":"array","items":{"type":"string"},"example":["manual","tool"],"description":"List of asset types (expand with query parameter)","nullable":false},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"My Custom Field\") (expand with query parameter)","additionalProperties":{"type":"string"},"example":{"My Custom Field":"000000000"},"nullable":false},"vendorIds":{"type":"array","description":"Vendor IDs (expand with query parameter)","items":{"type":"number","example":1},"nullable":false},"depreciation":{"type":"object","nullable":false,"description":"Depreciation information of the asset (expand with query parameter)","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset depreciation."},"accumulatedDepreciation":{"type":"number","description":"Accumulated depreciation of the asset.","format":"decimal","nullable":true,"example":"5000.00"},"annualDepreciation":{"type":"number","description":"Annual depreciation of the asset.","format":"decimal","nullable":true,"example":"1000.00"},"depreciationStartDate":{"type":"string","description":"Date at which the asset depreciation started.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"currentBookValue":{"type":"number","description":"Current book value of the asset.","format":"decimal","nullable":true,"example":"7500.00"},"purchasePrice":{"type":"number","description":"Purchase price of the asset.","format":"decimal","nullable":true,"example":"12500.00"},"purchaseDate":{"type":"string","description":"Date & time at which the asset was purchased.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"salvageValue":{"type":"number","description":"Salvage value of the asset.","format":"decimal","nullable":true,"example":"2500.00"},"usefulLifeYears":{"type":"number","description":"Useful life of the asset in years.","format":"decimal","nullable":true,"example":10},"yearsDepreciated":{"type":"number","description":"Years depreciated of the asset.","format":"decimal","nullable":true,"example":5},"createdAt":{"type":"string","description":"Date & time at which the asset depreciation was created.","format":"date-time","example":"2022-01-01T00:00:00.000Z","nullable":true},"archivedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset depreciation was archived.","example":"2022-01-01T00:00:00.000Z","nullable":true}}},"status":{"type":"object","nullable":false,"description":"Status information of the asset (expand with query parameter)","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset status."},"status":{"type":"string","example":"OFFLINE","description":"Asset status value.","enum":["IGNORE","OFFLINE","ONLINE"]},"downtimeType":{"type":"string","nullable":true,"example":"PLANNED","enum":["PLANNED","UNPLANNED"]},"startedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective start date."},"endedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective end date.","nullable":true},"description":{"type":"string","example":"Overheated - needs servicing.","nullable":true},"createdAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was created."},"updatedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was last updated."},"deletedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was deleted.","nullable":true},"customStatus":{"type":"object","required":["label"],"properties":{"id":{"type":"number","example":"Global ID of the custom asset status."},"label":{"type":"string","example":"Decommissioned"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was created.","example":"2022-01-01T12:34:56.123Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was last updated.","example":"2022-01-01T12:34:56.123Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the asset custom status was deleted.","format":"date-time","example":"2022-01-01T12:34:56.123Z"}},"description":"Custom status assigned to asset.","nullable":true}}},"manufacturer":{"type":"string","nullable":false,"description":"Name of the manufacturer of the asset (expand with query parameter)","example":"Manufacturer"},"model":{"type":"string","nullable":false,"description":"Name of the model of the asset (expand with query parameter)","example":"Model"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Assets.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Assets.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Assets"]}},"/assets/external/{externalId}":{"get":{"summary":"Get asset by external ID","parameters":[{"name":"externalId","in":"path","required":true,"description":"External ID of the asset","schema":{"type":"string","maxLength":255}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully retrieved asset","content":{"application/json":{"schema":{"type":"object","required":["asset"],"properties":{"asset":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"},"name":{"type":"string","example":"Forklift"},"globalUuid":{"type":"string","nullable":true,"description":"Global unique identifier of the asset used to identify assets as they are being transferred","example":"e2eb31cb-dd28-495a-92dd-6a435514f5ae"},"currentOwnerId":{"type":"number","description":"Organization id that currently has the active version of this asset","example":1},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"teamIds":{"type":"array","items":{"type":"integer"},"description":"List of teams responsible for the asset","example":[123,456]},"assetTypes":{"type":"array","items":{"type":"string"},"example":["manual","tool"],"description":"List of asset types"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"childrenIds":{"type":"array","nullable":true,"items":{"type":"number"},"example":[321,987],"description":"IDs of the asset's children"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the asset","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"My Custom Field\")","additionalProperties":{"type":"string"},"example":{"My Custom Field":"000000000"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the asset was deleted","format":"date-time"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the asset creator"},"depreciation":{"type":"object","nullable":true,"description":"Depreciation information of the asset","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset depreciation."},"accumulatedDepreciation":{"type":"number","description":"Accumulated depreciation of the asset.","format":"decimal","nullable":true,"example":"5000.00"},"annualDepreciation":{"type":"number","description":"Annual depreciation of the asset.","format":"decimal","nullable":true,"example":"1000.00"},"depreciationStartDate":{"type":"string","description":"Date at which the asset depreciation started.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"currentBookValue":{"type":"number","description":"Current book value of the asset.","format":"decimal","nullable":true,"example":"7500.00"},"purchasePrice":{"type":"number","description":"Purchase price of the asset.","format":"decimal","nullable":true,"example":"12500.00"},"purchaseDate":{"type":"string","description":"Date & time at which the asset was purchased.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"salvageValue":{"type":"number","description":"Salvage value of the asset.","format":"decimal","nullable":true,"example":"2500.00"},"usefulLifeYears":{"type":"number","description":"Useful life of the asset in years.","format":"decimal","nullable":true,"example":10},"yearsDepreciated":{"type":"number","description":"Years depreciated of the asset.","format":"decimal","nullable":true,"example":5},"createdAt":{"type":"string","description":"Date & time at which the asset depreciation was created.","format":"date-time","example":"2022-01-01T00:00:00.000Z","nullable":true},"archivedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset depreciation was archived.","example":"2022-01-01T00:00:00.000Z","nullable":true}}},"manufacturer":{"type":"string","nullable":true,"description":"Name of the manufacturer of the asset","example":"Manufacturer"},"model":{"type":"string","nullable":true,"description":"Name of the model of the asset","example":"Model"},"externalId":{"type":"string","nullable":true,"description":"External ID for this asset, unique per organization.","example":"ext-asset-001"},"status":{"type":"object","nullable":true,"description":"Status information of the asset","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset status."},"status":{"type":"string","example":"OFFLINE","description":"Asset status value.","enum":["IGNORE","OFFLINE","ONLINE"]},"downtimeType":{"type":"string","nullable":true,"example":"PLANNED","enum":["PLANNED","UNPLANNED"]},"startedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective start date."},"endedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective end date.","nullable":true},"description":{"type":"string","example":"Overheated - needs servicing.","nullable":true},"createdAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was created."},"updatedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was last updated."},"deletedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was deleted.","nullable":true},"customStatus":{"type":"object","required":["label"],"properties":{"id":{"type":"number","example":"Global ID of the custom asset status."},"label":{"type":"string","example":"Decommissioned"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was created.","example":"2022-01-01T12:34:56.123Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was last updated.","example":"2022-01-01T12:34:56.123Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the asset custom status was deleted.","format":"date-time","example":"2022-01-01T12:34:56.123Z"},"downtimeType":{"type":"string","nullable":true,"example":null,"enum":["PLANNED","UNPLANNED"],"deprecated":true,"description":"Downtime type on asset custom statuses will always return null. Use downtime type on asset status instead."}},"description":"Custom status assigned to asset.","nullable":true},"customStatusId":{"type":"number","deprecated":true,"description":"Please use customStatus instead.","nullable":true,"example":53}}}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified asset.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"asset Not Found"}}}}}}},"tags":["Assets"]},"patch":{"summary":"Create or update asset by external ID","description":"Idempotent upsert keyed on the external ID in the path. If an asset has this external ID, it will be updated (and undeleted, if the asset was previously deleted). Otherwise, a new asset will be created with this external ID.","parameters":[{"name":"externalId","in":"path","required":true,"description":"External ID of the asset","schema":{"type":"string","maxLength":255}},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"requestBody":{"description":"Asset to create or update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"Forklift"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"teamIds":{"type":"array","items":{"type":"integer"},"description":"List of teams responsible for the asset","example":[123,456]},"assetTypes":{"type":"array","items":{"type":"string"},"example":["manual","tool"],"description":"List of asset types"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"My Custom Field\")","additionalProperties":{"type":"string"},"example":{"My Custom Field":"000000000"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"depreciation":{"type":"object","nullable":true,"description":"Depreciation information of the asset","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset depreciation."},"accumulatedDepreciation":{"type":"number","description":"Accumulated depreciation of the asset.","format":"decimal","nullable":true,"example":"5000.00"},"annualDepreciation":{"type":"number","description":"Annual depreciation of the asset.","format":"decimal","nullable":true,"example":"1000.00"},"depreciationStartDate":{"type":"string","description":"Date at which the asset depreciation started.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"currentBookValue":{"type":"number","description":"Current book value of the asset.","format":"decimal","nullable":true,"example":"7500.00"},"purchasePrice":{"type":"number","description":"Purchase price of the asset.","format":"decimal","nullable":true,"example":"12500.00"},"purchaseDate":{"type":"string","description":"Date & time at which the asset was purchased.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"salvageValue":{"type":"number","description":"Salvage value of the asset.","format":"decimal","nullable":true,"example":"2500.00"},"usefulLifeYears":{"type":"number","description":"Useful life of the asset in years.","format":"decimal","nullable":true,"example":10},"yearsDepreciated":{"type":"number","description":"Years depreciated of the asset.","format":"decimal","nullable":true,"example":5},"createdAt":{"type":"string","description":"Date & time at which the asset depreciation was created.","format":"date-time","example":"2022-01-01T00:00:00.000Z","nullable":true},"archivedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset depreciation was archived.","example":"2022-01-01T00:00:00.000Z","nullable":true}}},"manufacturer":{"type":"object","nullable":true,"description":"Manufacturer information for the asset. Set to null to clear manufacturer and model.","properties":{"id":{"type":"integer","nullable":true,"description":"ID of an existing manufacturer. If provided, the manufacturer must be either global or belong to your organization. If not provided, the manufacturer will be looked up by name.","example":123},"name":{"type":"string","nullable":true,"description":"Name of the manufacturer. Required if id is not provided. When searching by name, the manufacturer must be either global or belong to your organization.","example":"ACME Corporation"}}},"model":{"type":"object","nullable":true,"description":"Model information for the asset. Set to null to clear model.","properties":{"id":{"type":"integer","nullable":true,"description":"ID of an existing model. If provided, the model must be linked to the specified manufacturer and be either global or belong to your organization. If not provided, the model will be looked up by name.","example":456},"name":{"type":"string","nullable":true,"description":"Name of the model. Required if id is not provided. When searching by name, the model must be linked to the specified manufacturer and be either global or belong to your organization.","example":"X-2000"}}}}}}}},"responses":{"200":{"description":"Successfully updated asset","content":{"application/json":{"schema":{"type":"object","required":["asset"],"properties":{"asset":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"},"name":{"type":"string","example":"Forklift"},"globalUuid":{"type":"string","nullable":true,"description":"Global unique identifier of the asset used to identify assets as they are being transferred","example":"e2eb31cb-dd28-495a-92dd-6a435514f5ae"},"currentOwnerId":{"type":"number","description":"Organization id that currently has the active version of this asset","example":1},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"teamIds":{"type":"array","items":{"type":"integer"},"description":"List of teams responsible for the asset","example":[123,456]},"assetTypes":{"type":"array","items":{"type":"string"},"example":["manual","tool"],"description":"List of asset types"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"childrenIds":{"type":"array","nullable":true,"items":{"type":"number"},"example":[321,987],"description":"IDs of the asset's children"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the asset","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"My Custom Field\")","additionalProperties":{"type":"string"},"example":{"My Custom Field":"000000000"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the asset was deleted","format":"date-time"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the asset creator"},"depreciation":{"type":"object","nullable":true,"description":"Depreciation information of the asset","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset depreciation."},"accumulatedDepreciation":{"type":"number","description":"Accumulated depreciation of the asset.","format":"decimal","nullable":true,"example":"5000.00"},"annualDepreciation":{"type":"number","description":"Annual depreciation of the asset.","format":"decimal","nullable":true,"example":"1000.00"},"depreciationStartDate":{"type":"string","description":"Date at which the asset depreciation started.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"currentBookValue":{"type":"number","description":"Current book value of the asset.","format":"decimal","nullable":true,"example":"7500.00"},"purchasePrice":{"type":"number","description":"Purchase price of the asset.","format":"decimal","nullable":true,"example":"12500.00"},"purchaseDate":{"type":"string","description":"Date & time at which the asset was purchased.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"salvageValue":{"type":"number","description":"Salvage value of the asset.","format":"decimal","nullable":true,"example":"2500.00"},"usefulLifeYears":{"type":"number","description":"Useful life of the asset in years.","format":"decimal","nullable":true,"example":10},"yearsDepreciated":{"type":"number","description":"Years depreciated of the asset.","format":"decimal","nullable":true,"example":5},"createdAt":{"type":"string","description":"Date & time at which the asset depreciation was created.","format":"date-time","example":"2022-01-01T00:00:00.000Z","nullable":true},"archivedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset depreciation was archived.","example":"2022-01-01T00:00:00.000Z","nullable":true}}},"manufacturer":{"type":"string","nullable":true,"description":"Name of the manufacturer of the asset","example":"Manufacturer"},"model":{"type":"string","nullable":true,"description":"Name of the model of the asset","example":"Model"},"externalId":{"type":"string","nullable":true,"description":"External ID for this asset, unique per organization.","example":"ext-asset-001"}}}}}}}},"201":{"description":"Successfully created asset","content":{"application/json":{"schema":{"type":"object","required":["asset"],"properties":{"asset":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"},"name":{"type":"string","example":"Forklift"},"globalUuid":{"type":"string","nullable":true,"description":"Global unique identifier of the asset used to identify assets as they are being transferred","example":"e2eb31cb-dd28-495a-92dd-6a435514f5ae"},"currentOwnerId":{"type":"number","description":"Organization id that currently has the active version of this asset","example":1},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"teamIds":{"type":"array","items":{"type":"integer"},"description":"List of teams responsible for the asset","example":[123,456]},"assetTypes":{"type":"array","items":{"type":"string"},"example":["manual","tool"],"description":"List of asset types"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"childrenIds":{"type":"array","nullable":true,"items":{"type":"number"},"example":[321,987],"description":"IDs of the asset's children"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the asset","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"My Custom Field\")","additionalProperties":{"type":"string"},"example":{"My Custom Field":"000000000"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the asset was deleted","format":"date-time"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the asset creator"},"depreciation":{"type":"object","nullable":true,"description":"Depreciation information of the asset","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset depreciation."},"accumulatedDepreciation":{"type":"number","description":"Accumulated depreciation of the asset.","format":"decimal","nullable":true,"example":"5000.00"},"annualDepreciation":{"type":"number","description":"Annual depreciation of the asset.","format":"decimal","nullable":true,"example":"1000.00"},"depreciationStartDate":{"type":"string","description":"Date at which the asset depreciation started.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"currentBookValue":{"type":"number","description":"Current book value of the asset.","format":"decimal","nullable":true,"example":"7500.00"},"purchasePrice":{"type":"number","description":"Purchase price of the asset.","format":"decimal","nullable":true,"example":"12500.00"},"purchaseDate":{"type":"string","description":"Date & time at which the asset was purchased.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"salvageValue":{"type":"number","description":"Salvage value of the asset.","format":"decimal","nullable":true,"example":"2500.00"},"usefulLifeYears":{"type":"number","description":"Useful life of the asset in years.","format":"decimal","nullable":true,"example":10},"yearsDepreciated":{"type":"number","description":"Years depreciated of the asset.","format":"decimal","nullable":true,"example":5},"createdAt":{"type":"string","description":"Date & time at which the asset depreciation was created.","format":"date-time","example":"2022-01-01T00:00:00.000Z","nullable":true},"archivedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset depreciation was archived.","example":"2022-01-01T00:00:00.000Z","nullable":true}}},"manufacturer":{"type":"string","nullable":true,"description":"Name of the manufacturer of the asset","example":"Manufacturer"},"model":{"type":"string","nullable":true,"description":"Name of the model of the asset","example":"Model"},"externalId":{"type":"string","nullable":true,"description":"External ID for this asset, unique per organization.","example":"ext-asset-001"}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified asset.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"asset Not Found"}}}}}},"409":{"description":"Conflict with existing asset","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"conflictingMxId":{"type":"integer"},"isDeleted":{"type":"boolean"}},"required":["error","conflictingMxId","isDeleted"],"example":{"error":"Asset with externalId 'ext-123' already exists in this organization.","conflictingMxId":456,"isDeleted":false}}}}}},"tags":["Assets"]},"delete":{"summary":"Delete asset by external ID","parameters":[{"name":"externalId","in":"path","required":true,"description":"External ID of the asset","schema":{"type":"string","maxLength":255}},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"204":{"description":"Successfully deleted the asset"},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified asset.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"asset Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Assets"]}},"/assets/{id}":{"get":{"summary":"Get asset","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the asset","example":"1"}],"responses":{"200":{"description":"Successfully retrieved asset's information","content":{"application/json":{"schema":{"type":"object","required":["asset"],"properties":{"asset":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"},"name":{"type":"string","example":"Forklift"},"globalUuid":{"type":"string","nullable":true,"description":"Global unique identifier of the asset used to identify assets as they are being transferred","example":"e2eb31cb-dd28-495a-92dd-6a435514f5ae"},"currentOwnerId":{"type":"number","description":"Organization id that currently has the active version of this asset","example":1},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"teamIds":{"type":"array","items":{"type":"integer"},"description":"List of teams responsible for the asset","example":[123,456]},"assetTypes":{"type":"array","items":{"type":"string"},"example":["manual","tool"],"description":"List of asset types"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"childrenIds":{"type":"array","nullable":true,"items":{"type":"number"},"example":[321,987],"description":"IDs of the asset's children"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the asset","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"My Custom Field\")","additionalProperties":{"type":"string"},"example":{"My Custom Field":"000000000"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the asset was deleted","format":"date-time"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the asset creator"},"depreciation":{"type":"object","nullable":true,"description":"Depreciation information of the asset","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset depreciation."},"accumulatedDepreciation":{"type":"number","description":"Accumulated depreciation of the asset.","format":"decimal","nullable":true,"example":"5000.00"},"annualDepreciation":{"type":"number","description":"Annual depreciation of the asset.","format":"decimal","nullable":true,"example":"1000.00"},"depreciationStartDate":{"type":"string","description":"Date at which the asset depreciation started.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"currentBookValue":{"type":"number","description":"Current book value of the asset.","format":"decimal","nullable":true,"example":"7500.00"},"purchasePrice":{"type":"number","description":"Purchase price of the asset.","format":"decimal","nullable":true,"example":"12500.00"},"purchaseDate":{"type":"string","description":"Date & time at which the asset was purchased.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"salvageValue":{"type":"number","description":"Salvage value of the asset.","format":"decimal","nullable":true,"example":"2500.00"},"usefulLifeYears":{"type":"number","description":"Useful life of the asset in years.","format":"decimal","nullable":true,"example":10},"yearsDepreciated":{"type":"number","description":"Years depreciated of the asset.","format":"decimal","nullable":true,"example":5},"createdAt":{"type":"string","description":"Date & time at which the asset depreciation was created.","format":"date-time","example":"2022-01-01T00:00:00.000Z","nullable":true},"archivedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset depreciation was archived.","example":"2022-01-01T00:00:00.000Z","nullable":true}}},"manufacturer":{"type":"string","nullable":true,"description":"Name of the manufacturer of the asset","example":"Manufacturer"},"model":{"type":"string","nullable":true,"description":"Name of the model of the asset","example":"Model"},"externalId":{"type":"string","nullable":true,"description":"External ID for this asset, unique per organization.","example":"ext-asset-001"},"status":{"type":"object","nullable":true,"description":"Status information of the asset","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset status."},"status":{"type":"string","example":"OFFLINE","description":"Asset status value.","enum":["IGNORE","OFFLINE","ONLINE"]},"downtimeType":{"type":"string","nullable":true,"example":"PLANNED","enum":["PLANNED","UNPLANNED"]},"startedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective start date."},"endedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective end date.","nullable":true},"description":{"type":"string","example":"Overheated - needs servicing.","nullable":true},"createdAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was created."},"updatedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was last updated."},"deletedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was deleted.","nullable":true},"customStatus":{"type":"object","required":["label"],"properties":{"id":{"type":"number","example":"Global ID of the custom asset status."},"label":{"type":"string","example":"Decommissioned"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was created.","example":"2022-01-01T12:34:56.123Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was last updated.","example":"2022-01-01T12:34:56.123Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the asset custom status was deleted.","format":"date-time","example":"2022-01-01T12:34:56.123Z"},"downtimeType":{"type":"string","nullable":true,"example":null,"enum":["PLANNED","UNPLANNED"],"deprecated":true,"description":"Downtime type on asset custom statuses will always return null. Use downtime type on asset status instead."}},"description":"Custom status assigned to asset.","nullable":true},"customStatusId":{"type":"number","deprecated":true,"description":"Please use customStatus instead.","nullable":true,"example":53}}}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified asset or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Assets"]},"patch":{"summary":"Update asset","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the asset","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Asset to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"Forklift"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"teamIds":{"type":"array","items":{"type":"integer"},"description":"List of teams responsible for the asset","example":[123,456]},"assetTypes":{"type":"array","items":{"type":"string"},"example":["manual","tool"],"description":"List of asset types"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"My Custom Field\")","additionalProperties":{"type":"string"},"example":{"My Custom Field":"000000000"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"depreciation":{"type":"object","nullable":true,"description":"Depreciation information of the asset","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset depreciation."},"accumulatedDepreciation":{"type":"number","description":"Accumulated depreciation of the asset.","format":"decimal","nullable":true,"example":"5000.00"},"annualDepreciation":{"type":"number","description":"Annual depreciation of the asset.","format":"decimal","nullable":true,"example":"1000.00"},"depreciationStartDate":{"type":"string","description":"Date at which the asset depreciation started.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"currentBookValue":{"type":"number","description":"Current book value of the asset.","format":"decimal","nullable":true,"example":"7500.00"},"purchasePrice":{"type":"number","description":"Purchase price of the asset.","format":"decimal","nullable":true,"example":"12500.00"},"purchaseDate":{"type":"string","description":"Date & time at which the asset was purchased.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"salvageValue":{"type":"number","description":"Salvage value of the asset.","format":"decimal","nullable":true,"example":"2500.00"},"usefulLifeYears":{"type":"number","description":"Useful life of the asset in years.","format":"decimal","nullable":true,"example":10},"yearsDepreciated":{"type":"number","description":"Years depreciated of the asset.","format":"decimal","nullable":true,"example":5},"createdAt":{"type":"string","description":"Date & time at which the asset depreciation was created.","format":"date-time","example":"2022-01-01T00:00:00.000Z","nullable":true},"archivedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset depreciation was archived.","example":"2022-01-01T00:00:00.000Z","nullable":true}}},"externalId":{"type":"string","nullable":true,"description":"External ID for this asset, unique per organization.","example":"ext-asset-001"},"manufacturer":{"type":"object","nullable":true,"description":"Manufacturer information for the asset. Set to null to clear manufacturer and model.","properties":{"id":{"type":"integer","nullable":true,"description":"ID of an existing manufacturer. If provided, the manufacturer must be either global or belong to your organization. If not provided, the manufacturer will be looked up by name.","example":123},"name":{"type":"string","nullable":true,"description":"Name of the manufacturer. Required if id is not provided. When searching by name, the manufacturer must be either global or belong to your organization.","example":"ACME Corporation"}}},"model":{"type":"object","nullable":true,"description":"Model information for the asset. Set to null to clear model.","properties":{"id":{"type":"integer","nullable":true,"description":"ID of an existing model. If provided, the model must be linked to the specified manufacturer and be either global or belong to your organization. If not provided, the model will be looked up by name.","example":456},"name":{"type":"string","nullable":true,"description":"Name of the model. Required if id is not provided. When searching by name, the model must be linked to the specified manufacturer and be either global or belong to your organization.","example":"X-2000"}}}}}}}},"responses":{"200":{"description":"Successfully edited asset","content":{"application/json":{"schema":{"type":"object","required":["asset"],"properties":{"asset":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"},"name":{"type":"string","example":"Forklift"},"globalUuid":{"type":"string","nullable":true,"description":"Global unique identifier of the asset used to identify assets as they are being transferred","example":"e2eb31cb-dd28-495a-92dd-6a435514f5ae"},"currentOwnerId":{"type":"number","description":"Organization id that currently has the active version of this asset","example":1},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"teamIds":{"type":"array","items":{"type":"integer"},"description":"List of teams responsible for the asset","example":[123,456]},"assetTypes":{"type":"array","items":{"type":"string"},"example":["manual","tool"],"description":"List of asset types"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"childrenIds":{"type":"array","nullable":true,"items":{"type":"number"},"example":[321,987],"description":"IDs of the asset's children"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the asset","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"My Custom Field\")","additionalProperties":{"type":"string"},"example":{"My Custom Field":"000000000"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the asset was deleted","format":"date-time"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the asset creator"},"depreciation":{"type":"object","nullable":true,"description":"Depreciation information of the asset","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset depreciation."},"accumulatedDepreciation":{"type":"number","description":"Accumulated depreciation of the asset.","format":"decimal","nullable":true,"example":"5000.00"},"annualDepreciation":{"type":"number","description":"Annual depreciation of the asset.","format":"decimal","nullable":true,"example":"1000.00"},"depreciationStartDate":{"type":"string","description":"Date at which the asset depreciation started.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"currentBookValue":{"type":"number","description":"Current book value of the asset.","format":"decimal","nullable":true,"example":"7500.00"},"purchasePrice":{"type":"number","description":"Purchase price of the asset.","format":"decimal","nullable":true,"example":"12500.00"},"purchaseDate":{"type":"string","description":"Date & time at which the asset was purchased.","format":"date-time","nullable":true,"example":"2022-01-01T00:00:00.000Z"},"salvageValue":{"type":"number","description":"Salvage value of the asset.","format":"decimal","nullable":true,"example":"2500.00"},"usefulLifeYears":{"type":"number","description":"Useful life of the asset in years.","format":"decimal","nullable":true,"example":10},"yearsDepreciated":{"type":"number","description":"Years depreciated of the asset.","format":"decimal","nullable":true,"example":5},"createdAt":{"type":"string","description":"Date & time at which the asset depreciation was created.","format":"date-time","example":"2022-01-01T00:00:00.000Z","nullable":true},"archivedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset depreciation was archived.","example":"2022-01-01T00:00:00.000Z","nullable":true}}},"manufacturer":{"type":"string","nullable":true,"description":"Name of the manufacturer of the asset","example":"Manufacturer"},"model":{"type":"string","nullable":true,"description":"Name of the model of the asset","example":"Model"},"externalId":{"type":"string","nullable":true,"description":"External ID for this asset, unique per organization.","example":"ext-asset-001"}}}}}}}},"400":{"description":"Failed to edit the asset","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"parentId is not valid"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified asset.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"asset Not Found"}}}}}},"409":{"description":"Conflict with existing asset","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"conflictingMxId":{"type":"integer"},"isDeleted":{"type":"boolean"}},"required":["error","conflictingMxId","isDeleted"],"example":{"error":"Asset with externalId 'ext-123' already exists in this organization.","conflictingMxId":456,"isDeleted":false}}}}}},"tags":["Assets"]},"delete":{"summary":"Delete asset","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the asset","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the asset"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified asset.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"asset Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Assets"]}},"/assets/{id}/attachments/{filename}":{"put":{"summary":"Update asset attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the asset.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"datasheet.pdf"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the attachment.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"application/x-indesign":{"schema":{"type":"object","format":"binary"}},"application/epub+zip":{"schema":{"type":"object","format":"binary"}},"application/x-xpinstall":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"schema":{"type":"object","format":"binary"}},"application/zip":{"schema":{"type":"object","format":"binary"}},"application/x-tar":{"schema":{"type":"object","format":"binary"}},"application/x-rar-compressed":{"schema":{"type":"object","format":"binary"}},"application/gzip":{"schema":{"type":"object","format":"binary"}},"application/x-bzip2":{"schema":{"type":"object","format":"binary"}},"application/x-7z-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-apple-diskimage":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.arrow.file":{"schema":{"type":"object","format":"binary"}},"video/mp4":{"schema":{"type":"object","format":"binary"}},"audio/midi":{"schema":{"type":"object","format":"binary"}},"video/matroska":{"schema":{"type":"object","format":"binary"}},"video/webm":{"schema":{"type":"object","format":"binary"}},"video/quicktime":{"schema":{"type":"object","format":"binary"}},"video/vnd.avi":{"schema":{"type":"object","format":"binary"}},"audio/wav":{"schema":{"type":"object","format":"binary"}},"audio/qcelp":{"schema":{"type":"object","format":"binary"}},"audio/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"video/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-asf":{"schema":{"type":"object","format":"binary"}},"video/mpeg":{"schema":{"type":"object","format":"binary"}},"video/3gpp":{"schema":{"type":"object","format":"binary"}},"audio/mpeg":{"schema":{"type":"object","format":"binary"}},"audio/mp4":{"schema":{"type":"object","format":"binary"}},"video/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg; codecs=opus":{"schema":{"type":"object","format":"binary"}},"application/ogg":{"schema":{"type":"object","format":"binary"}},"audio/flac":{"schema":{"type":"object","format":"binary"}},"audio/ape":{"schema":{"type":"object","format":"binary"}},"audio/wavpack":{"schema":{"type":"object","format":"binary"}},"audio/amr":{"schema":{"type":"object","format":"binary"}},"application/pdf":{"schema":{"type":"object","format":"binary"}},"application/x-elf":{"schema":{"type":"object","format":"binary"}},"application/x-mach-binary":{"schema":{"type":"object","format":"binary"}},"application/x-msdownload":{"schema":{"type":"object","format":"binary"}},"application/x-shockwave-flash":{"schema":{"type":"object","format":"binary"}},"application/rtf":{"schema":{"type":"object","format":"binary"}},"application/wasm":{"schema":{"type":"object","format":"binary"}},"font/woff":{"schema":{"type":"object","format":"binary"}},"font/woff2":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-fontobject":{"schema":{"type":"object","format":"binary"}},"font/ttf":{"schema":{"type":"object","format":"binary"}},"font/otf":{"schema":{"type":"object","format":"binary"}},"font/collection":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"video/x-flv":{"schema":{"type":"object","format":"binary"}},"application/postscript":{"schema":{"type":"object","format":"binary"}},"application/eps":{"schema":{"type":"object","format":"binary"}},"application/x-xz":{"schema":{"type":"object","format":"binary"}},"application/x-sqlite3":{"schema":{"type":"object","format":"binary"}},"application/x-nintendo-nes-rom":{"schema":{"type":"object","format":"binary"}},"application/x-google-chrome-extension":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-cab-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-deb":{"schema":{"type":"object","format":"binary"}},"application/x-unix-archive":{"schema":{"type":"object","format":"binary"}},"application/x-rpm":{"schema":{"type":"object","format":"binary"}},"application/x-compress":{"schema":{"type":"object","format":"binary"}},"application/lzip":{"schema":{"type":"object","format":"binary"}},"application/x-cfb":{"schema":{"type":"object","format":"binary"}},"application/x-mie":{"schema":{"type":"object","format":"binary"}},"application/mxf":{"schema":{"type":"object","format":"binary"}},"video/mp2t":{"schema":{"type":"object","format":"binary"}},"application/x-blender":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"audio/aiff":{"schema":{"type":"object","format":"binary"}},"application/xml":{"schema":{"type":"object","format":"binary"}},"application/x-mobipocket-ebook":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"application/dicom":{"schema":{"type":"object","format":"binary"}},"audio/x-musepack":{"schema":{"type":"object","format":"binary"}},"text/calendar":{"schema":{"type":"object","format":"binary"}},"text/vcard":{"schema":{"type":"object","format":"binary"}},"text/vtt":{"schema":{"type":"object","format":"binary"}},"model/gltf-binary":{"schema":{"type":"object","format":"binary"}},"application/vnd.tcpdump.pcap":{"schema":{"type":"object","format":"binary"}},"audio/x-dsf":{"schema":{"type":"object","format":"binary"}},"application/x-ms-shortcut":{"schema":{"type":"object","format":"binary"}},"application/x-ft-apple.alias":{"schema":{"type":"object","format":"binary"}},"audio/x-voc":{"schema":{"type":"object","format":"binary"}},"audio/vnd.dolby.dd-raw":{"schema":{"type":"object","format":"binary"}},"audio/x-m4a":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"video/x-m4v":{"schema":{"type":"object","format":"binary"}},"video/3gpp2":{"schema":{"type":"object","format":"binary"}},"application/x-esri-shape":{"schema":{"type":"object","format":"binary"}},"audio/aac":{"schema":{"type":"object","format":"binary"}},"audio/x-it":{"schema":{"type":"object","format":"binary"}},"audio/x-s3m":{"schema":{"type":"object","format":"binary"}},"audio/x-xm":{"schema":{"type":"object","format":"binary"}},"video/mp1s":{"schema":{"type":"object","format":"binary"}},"video/mp2p":{"schema":{"type":"object","format":"binary"}},"application/vnd.sketchup.skp":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"application/x-lzh-compressed":{"schema":{"type":"object","format":"binary"}},"application/pgp-encrypted":{"schema":{"type":"object","format":"binary"}},"application/x-asar":{"schema":{"type":"object","format":"binary"}},"model/stl":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-htmlhelp":{"schema":{"type":"object","format":"binary"}},"model/3mf":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"application/zstd":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-outlook":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.parquet":{"schema":{"type":"object","format":"binary"}},"application/java-vm":{"schema":{"type":"object","format":"binary"}},"application/x-arj":{"schema":{"type":"object","format":"binary"}},"application/x-cpio":{"schema":{"type":"object","format":"binary"}},"application/x-ace-compressed":{"schema":{"type":"object","format":"binary"}},"application/avro":{"schema":{"type":"object","format":"binary"}},"application/vnd.iccprofile":{"schema":{"type":"object","format":"binary"}},"application/x-ft-fbx":{"schema":{"type":"object","format":"binary"}},"application/vnd.visio":{"schema":{"type":"object","format":"binary"}},"application/vnd.android.package-archive":{"schema":{"type":"object","format":"binary"}},"application/x-ft-draco":{"schema":{"type":"object","format":"binary"}},"application/x-lz4":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.sheet.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.document.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/java-archive":{"schema":{"type":"object","format":"binary"}},"application/vnd.rn-realmedia":{"schema":{"type":"object","format":"binary"}},"application/x-spss-sav":{"schema":{"type":"object","format":"binary"}},"application/x-ms-regedit":{"schema":{"type":"object","format":"binary"}},"application/x-ft-windows-registry-hive":{"schema":{"type":"object","format":"binary"}},"application/x-jmp-data":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.keynote":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.numbers":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.pages":{"schema":{"type":"object","format":"binary"}},"application/x-apache-arrow":{"schema":{"type":"object","format":"binary"}},"application/x-lzip":{"schema":{"type":"object","format":"binary"}},"application/x.apple.alias":{"schema":{"type":"object","format":"binary"}},"application/x.ms.shortcut":{"schema":{"type":"object","format":"binary"}},"audio/opus":{"schema":{"type":"object","format":"binary"}},"audio/vnd.wave":{"schema":{"type":"object","format":"binary"}},"audio/x-flac":{"schema":{"type":"object","format":"binary"}},"video/x-matroska":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated asset's attachment.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified asset.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"asset Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Assets"]},"delete":{"summary":"Remove asset attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the asset.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"attachment.xls"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully removed asset's attachment."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Attachment.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment Not Found"}}}}}}},"tags":["Assets"]}},"/assets/{id}/thumbnail/{filename}":{"put":{"summary":"Update asset's thumbnail","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the asset.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the asset thumbnail, including the extension.","example":"motor.png"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the thumbnail.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated asset's thumbnail.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"You cannot edit this entity.","fieldPath":"organizationId","fieldValue":"1"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Asset.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Asset Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Assets"]}},"/assets/{assetId}/status":{"post":{"summary":"Create a new asset status","parameters":[{"schema":{"type":"integer"},"name":"assetId","in":"path","required":true,"description":"ID of the asset","example":"5678"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"requestBody":{"description":"Asset Status to set","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"OFFLINE","description":"Asset status value.","enum":["IGNORE","OFFLINE","ONLINE"]},"customStatusId":{"type":"number","description":"Id of the custom status assigned to asset.","nullable":true,"example":53},"downtimeType":{"type":"string","nullable":true,"example":"PLANNED","enum":["PLANNED","UNPLANNED"]},"startedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective start date."},"endedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective end date.","nullable":true},"description":{"type":"string","example":"Overheated - needs servicing.","nullable":true}}}}}},"responses":{"201":{"description":"Successfully set a new asset status","content":{"application/json":{"schema":{"type":"object","required":["assetStatus"],"properties":{"assetStatus":{"type":"object","required":["id","status","startedAt"],"properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset status."},"downtimeType":{"type":"string","nullable":true,"example":"PLANNED","enum":["PLANNED","UNPLANNED"]},"status":{"type":"string","example":"OFFLINE","description":"Asset status value.","enum":["IGNORE","OFFLINE","ONLINE"]},"startedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective start date."},"customStatusId":{"type":"number","description":"Id of the custom status assigned to asset.","nullable":true,"example":53},"updatedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was last updated."}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified asset.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"asset Not Found"}}}}}}},"tags":["Assets"]}},"/assetstatuses":{"get":{"summary":"List asset statuses","description":"Endpoint used to list assetStatuses resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Asset Statuses returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"assetId","schema":{"type":"array","title":"assetId ID filters","description":"To filter by multiple assetId IDs: `assetIds=630`","items":{"type":"integer"}},"in":"query"},{"in":"query","name":"sort","schema":{"description":"Attribute on which to sort the list. (for descending order, prefix attribute with '-'). The default sorting key is : created_at and direction descending","type":"string","enum":["createdAt","updatedAt","startedAt","endedAt","-createdAt","-updatedAt","-startedAt","-endedAt"]}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Asset Statuses list","content":{"application/json":{"schema":{"type":"object","required":["assetStatuses","nextCursor","nextPageUrl"],"properties":{"assetStatuses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset status."},"customStatusId":{"type":"number","description":"Id of the custom status assigned to asset.","nullable":true,"example":53},"assetId":{"type":"number","example":51,"description":"Global Parent asset ID of the asset status."},"status":{"type":"string","example":"OFFLINE","description":"Asset status value.","enum":["IGNORE","OFFLINE","ONLINE"]},"downtimeType":{"type":"string","nullable":true,"example":"PLANNED","enum":["PLANNED","UNPLANNED"],"description":"Downtime type of the asset status."},"startedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Date & time at which the asset status was started at."},"endedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Date & time at which the asset status ended at. Null means this status is still active, and is the current one.","nullable":true},"organizationId":{"type":"number","example":51,"description":"The Organization ID of the asset status."},"creatorId":{"type":"number","example":51,"description":"The Creator ID of the asset status."},"updaterId":{"type":"number","example":51,"nullable":true,"description":"The Updater ID of the asset status."},"createdAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Date & time at which the asset status was created. This is the default sort by field, by descending (newest firsts)"},"updatedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Date & time at which the asset status was last updated."},"deletedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","nullable":true,"description":"Date & time at which the asset status was deleted."},"description":{"type":"string","example":"Overheated - needs servicing.","nullable":true,"description":"Description of the asset status."}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Asset Statuses.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Asset Statuses.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Asset Statuses"]}},"/assetstatuses/{id}":{"patch":{"summary":"Update asset status","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the asset status","example":"5678"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"requestBody":{"description":"Asset status to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"OFFLINE","description":"Asset status value.","enum":["IGNORE","OFFLINE","ONLINE"]},"customStatusId":{"type":"number","description":"Id of the custom status assigned to asset.","nullable":true,"example":53},"downtimeType":{"type":"string","nullable":true,"example":"PLANNED","enum":["PLANNED","UNPLANNED"]},"startedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective start date."},"endedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective end date.","nullable":true},"description":{"type":"string","example":"Overheated - needs servicing.","nullable":true}}}}}},"responses":{"200":{"description":"Successfully edited asset status","content":{"application/json":{"schema":{"type":"object","required":["assetStatus"],"properties":{"assetStatus":{"type":"object","required":["id","startedAt"],"properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset status."},"customStatusId":{"type":"number","description":"Id of the custom status assigned to asset.","nullable":true,"example":53},"status":{"type":"string","example":"OFFLINE","description":"Asset status value.","enum":["IGNORE","OFFLINE","ONLINE"]},"downtimeType":{"type":"string","nullable":true,"example":"PLANNED","enum":["PLANNED","UNPLANNED"]},"startedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective start date."},"endedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective end date.","nullable":true},"description":{"type":"string","example":"Overheated - needs servicing.","nullable":true},"createdAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was created."},"updatedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was last updated."},"deletedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was deleted.","nullable":true}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Failed to edit the asset status","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"User don't have the right permissions"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified assetstatus.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"assetstatus Not Found"}}}}}}},"tags":["Asset Statuses"]}},"/assetcriticalities":{"get":{"summary":"List asset criticalities","description":"Endpoint used to list asset criticality resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Asset Criticalities returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"label","schema":{"type":"string","description":"Will only show asset importances that match the label"},"in":"query"},{"name":"level","schema":{"type":"integer","description":"Will only show asset importances that match the level"},"in":"query"},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Asset Criticalities list","content":{"application/json":{"schema":{"type":"object","required":["assetCriticalities","nextCursor","nextPageUrl"],"properties":{"assetCriticalities":{"type":"array","items":{"type":"object","required":["id","label","level"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the criticality. <a href='https://help.getmaintainx.com/about-assets#criticality' target='_blank'>Learn more</a>"},"label":{"type":"string","description":"The label of the criticality. <a href='https://help.getmaintainx.com/about-assets#criticality' target='_blank'>Learn more</a>","example":"Normal"},"level":{"type":"integer","description":"The level of the criticality. <a href='https://help.getmaintainx.com/about-assets#criticality' target='_blank'>Learn more</a>","example":3}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Asset Criticalities.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Asset Criticalities.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Asset Criticalities"]}},"/assetcriticalities/{id}":{"get":{"summary":"Get asset criticality","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the assetCriticality","example":"1"}],"responses":{"200":{"description":"Successfully retrieved assetCriticality's information","content":{"application/json":{"schema":{"type":"object","required":["assetCriticality"],"properties":{"assetCriticality":{"type":"object","required":["id","label","level"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the criticality. <a href='https://help.getmaintainx.com/about-assets#criticality' target='_blank'>Learn more</a>"},"label":{"type":"string","description":"The label of the criticality. <a href='https://help.getmaintainx.com/about-assets#criticality' target='_blank'>Learn more</a>","example":"Normal"},"level":{"type":"integer","description":"The level of the criticality. <a href='https://help.getmaintainx.com/about-assets#criticality' target='_blank'>Learn more</a>","example":3}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified assetCriticality or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Asset Criticalities"]}},"/assetcustomstatuses":{"post":{"summary":"Create new asset custom status type","requestBody":{"description":"AssetCustomStatus to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["baseAssetStatus","label"],"properties":{"label":{"type":"string","example":"Decommissioned"},"baseAssetStatus":{"type":"string","example":"OFFLINE","enum":["IGNORE","OFFLINE","ONLINE"]}}}}}},"responses":{"201":{"description":"Successfully created asset custom status","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number","example":"Global ID of the custom asset status."}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Asset Custom Statuses"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]},"get":{"summary":"List asset custom statuses","description":"Endpoint used to list asset custom status resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Asset Custom Statuses returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Asset Custom Statuses list","content":{"application/json":{"schema":{"type":"object","required":["assetCustomStatuses","nextCursor","nextPageUrl"],"properties":{"assetCustomStatuses":{"type":"array","items":{"type":"object","required":["id","label","baseAssetStatus"],"properties":{"id":{"type":"number","example":"Global ID of the custom asset status."},"label":{"type":"string","example":"Decommissioned"},"baseAssetStatus":{"type":"string","example":"OFFLINE","enum":["IGNORE","OFFLINE","ONLINE"]},"downtimeType":{"type":"string","nullable":true,"example":null,"enum":["PLANNED","UNPLANNED"],"deprecated":true,"description":"Downtime type on asset custom statuses will always return null. Use downtime type on asset status instead."},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was created.","example":"2022-01-01T12:34:56.123Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was last updated.","example":"2022-01-01T12:34:56.123Z"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Asset Custom Statuses.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Asset Custom Statuses.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Asset Custom Statuses"]}},"/assetcustomstatuses/{id}":{"get":{"summary":"Get asset custom status","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the assetCustomStatus","example":"1"}],"responses":{"200":{"description":"Successfully retrieved assetCustomStatus's information","content":{"application/json":{"schema":{"type":"object","required":["assetCustomStatus"],"properties":{"assetCustomStatus":{"type":"object","required":["baseAssetStatus","label"],"properties":{"id":{"type":"number","example":"Global ID of the custom asset status."},"baseAssetStatus":{"type":"string","example":"OFFLINE","enum":["IGNORE","OFFLINE","ONLINE"]},"label":{"type":"string","example":"Decommissioned"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was created.","example":"2022-01-01T12:34:56.123Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was last updated.","example":"2022-01-01T12:34:56.123Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the asset custom status was deleted.","format":"date-time","example":"2022-01-01T12:34:56.123Z"},"downtimeType":{"type":"string","nullable":true,"example":null,"enum":["PLANNED","UNPLANNED"],"deprecated":true,"description":"Downtime type on asset custom statuses will always return null. Use downtime type on asset status instead."}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified assetCustomStatus or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Asset Custom Statuses"]},"patch":{"summary":"Update asset custom status","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the assetCustomStatus","example":"4242"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"requestBody":{"description":"AssetCustomStatus to update","required":true,"content":{"application/json":{"schema":{"type":"object","required":["label"],"properties":{"label":{"type":"string","example":"Decommissioned"}}}}}},"responses":{"200":{"description":"Successfully edited asset custom status","content":{"application/json":{"schema":{"type":"object","properties":{"assetcustomstatus":{"type":"object","required":["id"],"properties":{"id":{"type":"number","example":"Global ID of the custom asset status."},"baseAssetStatus":{"type":"string","example":"OFFLINE","enum":["IGNORE","OFFLINE","ONLINE"]},"label":{"type":"string","example":"Decommissioned"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was created.","example":"2022-01-01T12:34:56.123Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was last updated.","example":"2022-01-01T12:34:56.123Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the asset custom status was deleted.","format":"date-time","example":"2022-01-01T12:34:56.123Z"}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified assetcustomstatus.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"assetcustomstatus Not Found"}}}}}}},"tags":["Asset Custom Statuses"]},"delete":{"summary":"Delete asset custom status","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the assetCustomStatus","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the assetCustomStatus"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified assetCustomStatus.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"assetCustomStatus Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Asset Custom Statuses"]}},"/categories":{"post":{"summary":"Create new category","requestBody":{"description":"Category to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["label"],"properties":{"label":{"type":"string","example":"Safety","description":"Label used when displaying the category."},"description":{"type":"string","example":"Used for everything related to Safety","description":"Description field for additional information."}}}}}},"responses":{"201":{"description":"Successfully created category","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the category."}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Categories"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]},"get":{"summary":"List categories","description":"Endpoint used to list category resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Categories returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Categories list","content":{"application/json":{"schema":{"type":"object","required":["categories","nextCursor","nextPageUrl"],"properties":{"categories":{"type":"array","items":{"type":"object","required":["id","label"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the category."},"label":{"type":"string","example":"Safety","description":"Label used when displaying the category."},"description":{"type":"string","example":"Used for everything related to Safety","description":"Description field for additional information."}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Categories.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Categories.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Categories"]}},"/categories/{id}":{"get":{"summary":"Get category","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the category","example":"1"}],"responses":{"200":{"description":"Successfully retrieved category's information","content":{"application/json":{"schema":{"type":"object","required":["category"],"properties":{"category":{"type":"object","required":["id","label"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the category."},"label":{"type":"string","example":"Safety","description":"Label used when displaying the category."},"description":{"type":"string","example":"Used for everything related to Safety","description":"Description field for additional information."},"workOrderCount":{"type":"integer","example":3,"description":"The amount of work order using that category in your organization."},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the category was last updated.","example":"2022-01-01T00:00:00.000Z"}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified category or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Categories"]},"patch":{"summary":"Update category","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the category","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Category to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","example":"Safety","description":"Label used when displaying the category."},"description":{"type":"string","example":"Used for everything related to Safety","description":"Description field for additional information."}}}}}},"responses":{"200":{"description":"Successfully edited category","content":{"application/json":{"schema":{"type":"object","required":["category"],"properties":{"category":{"type":"object","required":["label"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the category."},"label":{"type":"string","example":"Safety","description":"Label used when displaying the category."},"description":{"type":"string","example":"Used for everything related to Safety","description":"Description field for additional information."},"workOrderCount":{"type":"integer","example":3,"description":"The amount of work order using that category in your organization."},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the category was last updated.","example":"2022-01-01T00:00:00.000Z"}}}}}}}},"400":{"description":"Failed to edit the category","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"parentId is not valid"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified category.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"category Not Found"}}}}}}},"tags":["Categories"]},"delete":{"summary":"Delete category","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the category","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the category"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified category.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"category Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Categories"]}},"/conversations":{"get":{"summary":"List conversations","description":"Endpoint used to list conversation resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Conversations returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"type","schema":{"type":"array","items":{"type":"string","enum":["GROUP","DM","TEAM"],"title":"conversation type filters","description":"To filter by multiple type: `type=GROUP&type=TEAM`"}},"in":"query"},{"name":"onlyNamed","schema":{"type":"boolean","description":"Will only show named group conversations and team conversation"},"in":"query"},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Conversations list","content":{"application/json":{"schema":{"type":"object","required":["conversations","nextCursor","nextPageUrl"],"properties":{"conversations":{"type":"array","items":{"type":"object","required":["id","type"],"properties":{"id":{"type":"number","description":"Global ID of the conversation"},"type":{"type":"string","description":"Type of conversation","enum":["GROUP","DM","TEAM"]},"name":{"type":"string","nullable":true,"description":"Display name of the conversation"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Conversations.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Conversations.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Conversations"]}},"/conversations/{id}/members":{"get":{"summary":"List conversation members","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Members returned","type":"integer","minimum":1,"maximum":200,"default":100}}],"responses":{"200":{"description":"Successfully fetched Members list","content":{"application/json":{"schema":{"type":"object","required":["members","nextCursor","nextPageUrl"],"properties":{"members":{"type":"array","items":{"type":"object","required":["id","firstName","lastName"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the user"},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Members.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Members.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Cannot find the parent resource","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}}},"tags":["Conversations"]}},"/conversations/{id}/messages":{"post":{"summary":"Create new message in a conversation","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the conversation","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Message to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"string","description":"Content of the message to post"}}}}}},"responses":{"201":{"description":"Successfully created the message","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number","description":"Global ID of the message"}}}}}},"400":{"description":"Failed to create the message","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"should have required property 'content'","fieldPath":"content"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified conversation.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"conversation Not Found"}}}}}}},"tags":["Conversations"]}},"/versions":{"get":{"summary":"Get list of available API versions","responses":{"200":{"description":"Successfully retrieved list of available versions","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["version"],"properties":{"version":{"type":"string","example":"1"}}}}}}}},"security":[],"tags":["OpenAPI Documentation"],"servers":[{"url":"https://api.getmaintainx.com","description":"Endpoint"}]}},"/locations":{"post":{"summary":"Create new location","requestBody":{"description":"Location to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Department\")","additionalProperties":{"type":"string"},"example":{"Department":"Electrical"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":2}},"externalId":{"type":"string","nullable":true,"description":"External ID for this location, unique per organization.","example":"ext-location-001"}}}}}},"responses":{"200":{"description":"Successfully created location","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the location"}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"409":{"description":"Conflict with existing location","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"conflictingMxId":{"type":"integer"},"isDeleted":{"type":"boolean"}},"required":["error","conflictingMxId","isDeleted"],"example":{"error":"Asset with externalId 'ext-123' already exists in this organization.","conflictingMxId":456,"isDeleted":false}}}}}},"tags":["Locations"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]},"get":{"summary":"List locations","description":"Endpoint used to list location resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Locations returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"name","schema":{"type":"string","description":"Will only show locations that have a name starting with this."},"in":"query"},{"name":"customFieldName","schema":{"type":"array","items":{"type":"string"},"description":"Filter locations by custom field value. Your query parameter should be your custom field name. (ie: To filter by a custom field named \"Industry\" with the value \"Construction\", you would do this \"/locations?Industry=Construction\").\n                    <br><br>Adding multiple instance of the same custom field act as an <code>OR</code> and adding a different custom field act as an <code>AND</code>. (ie: To filter by a custom field named <code>Industry</code> with the value <code>Construction</code> OR <code>Transportation</code> AND the custom field <code>Manufacturer</code> with the value <code>ACME</code>, you would do this <code>/locations?Industry=Construction&Industry=Transportation&Manufacturer=ACME</code>).\n                    <br><br>If your custom field label is the same as a reserved query parameter such as <code>limit</code>, <code>sort</code>, <code>expand</code>, etc, you can add <code>__c</code> to your custom field filtering (ie: To filter by a custom field named <code>limit</code> with the value <code>ten</code>, you would do this <code>/locations?limit__c=ten</code>).\n                    <br><br>Note that your custom field needs to be created beforehand. Only number and single line text custom field types are supported."},"in":"query"},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","description":"To expand multiple fields: `expand=extra_fields&expand=team_ids`","type":"array","items":{"type":"string","enum":["extra_fields","team_ids","vendor_ids","barcode"]}}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"},{"schema":{"type":"string"},"description":"Required if using a multi organizations token and doing an operation on resources from multiple organizations. This is mutually exclusive with the x-organization-id header (use one or the other).","name":"x-organization-ids","in":"header","required":false,"example":"1,2,3"}],"responses":{"200":{"description":"Successfully fetched Locations list","content":{"application/json":{"schema":{"type":"object","required":["locations","nextCursor","nextPageUrl"],"properties":{"locations":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the location"},"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the location was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the location was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"organizationId":{"type":"integer","example":1,"description":"ID of the organization that owns this resource"},"externalId":{"type":"string","nullable":true,"description":"External ID for this location, unique per organization.","example":"ext-location-001"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Department\") (expand with query parameter)","additionalProperties":{"type":"string"},"example":{"Department":"Electrical"},"nullable":false},"teamIds":{"type":"array","description":"Team IDs (expand with query parameter)","items":{"type":"number","example":2},"nullable":false},"vendorIds":{"type":"array","description":"Vendor IDs (expand with query parameter)","items":{"type":"number","example":2},"nullable":false},"barcode":{"type":"string","nullable":false,"example":"BWFPBNRHAW54CG","description":"String encoded barcode (expand with query parameter)"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Locations.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Locations.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Locations"]}},"/locations/external/{externalId}":{"get":{"summary":"Get location by external ID","parameters":[{"name":"externalId","in":"path","required":true,"description":"External ID of the location","schema":{"type":"string","maxLength":255}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully retrieved location","content":{"application/json":{"schema":{"type":"object","required":["location"],"properties":{"location":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the location"},"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"childrenIds":{"type":"array","nullable":true,"items":{"type":"number"},"example":[342,521],"description":"IDs of the location's children"},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the location","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Department\")","additionalProperties":{"type":"string"},"example":{"Department":"Electrical"}},"teamIds":{"type":"array","description":"Team IDs","items":{"type":"number","example":2}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":2}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the location was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the location was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the location was deleted","format":"date-time"},"externalId":{"type":"string","nullable":true,"description":"External ID for this location, unique per organization.","example":"ext-location-001"}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified location.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"location Not Found"}}}}}}},"tags":["Locations"]},"patch":{"summary":"Create or update location by external ID","description":"Idempotent upsert keyed on the external ID in the path. If a location has this external ID, it will be updated (and undeleted, if the location was previously deleted). Otherwise, a new location will be created with this external ID.","parameters":[{"name":"externalId","in":"path","required":true,"description":"External ID of the location","schema":{"type":"string","maxLength":255}},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"requestBody":{"description":"Location to create or update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Department\")","additionalProperties":{"type":"string"},"example":{"Department":"Electrical"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":2}}}}}}},"responses":{"200":{"description":"Successfully updated location","content":{"application/json":{"schema":{"type":"object","required":["location"],"properties":{"location":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the location"},"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"childrenIds":{"type":"array","nullable":true,"items":{"type":"number"},"example":[342,521],"description":"IDs of the location's children"},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the location","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Department\")","additionalProperties":{"type":"string"},"example":{"Department":"Electrical"}},"teamIds":{"type":"array","description":"Team IDs","items":{"type":"number","example":2}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":2}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the location was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the location was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the location was deleted","format":"date-time"},"externalId":{"type":"string","nullable":true,"description":"External ID for this location, unique per organization.","example":"ext-location-001"}}}}}}}},"201":{"description":"Successfully created location","content":{"application/json":{"schema":{"type":"object","required":["location"],"properties":{"location":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the location"},"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"childrenIds":{"type":"array","nullable":true,"items":{"type":"number"},"example":[342,521],"description":"IDs of the location's children"},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the location","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Department\")","additionalProperties":{"type":"string"},"example":{"Department":"Electrical"}},"teamIds":{"type":"array","description":"Team IDs","items":{"type":"number","example":2}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":2}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the location was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the location was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the location was deleted","format":"date-time"},"externalId":{"type":"string","nullable":true,"description":"External ID for this location, unique per organization.","example":"ext-location-001"}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified location.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"location Not Found"}}}}}},"409":{"description":"Conflict with existing location","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"conflictingMxId":{"type":"integer"},"isDeleted":{"type":"boolean"}},"required":["error","conflictingMxId","isDeleted"],"example":{"error":"Asset with externalId 'ext-123' already exists in this organization.","conflictingMxId":456,"isDeleted":false}}}}}},"tags":["Locations"]},"delete":{"summary":"Delete location by external ID","parameters":[{"name":"externalId","in":"path","required":true,"description":"External ID of the location","schema":{"type":"string","maxLength":255}},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"204":{"description":"Successfully deleted the location"},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified location.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"location Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Locations"]}},"/locations/{id}":{"get":{"summary":"Get location","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the location","example":"1"}],"responses":{"200":{"description":"Successfully retrieved location's information","content":{"application/json":{"schema":{"type":"object","required":["location"],"properties":{"location":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the location"},"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"childrenIds":{"type":"array","nullable":true,"items":{"type":"number"},"example":[342,521],"description":"IDs of the location's children"},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the location","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Department\")","additionalProperties":{"type":"string"},"example":{"Department":"Electrical"}},"teamIds":{"type":"array","description":"Team IDs","items":{"type":"number","example":2}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":2}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the location was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the location was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the location was deleted","format":"date-time"},"externalId":{"type":"string","nullable":true,"description":"External ID for this location, unique per organization.","example":"ext-location-001"}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified location or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Locations"]},"patch":{"summary":"Update location","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the location","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Location to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Department\")","additionalProperties":{"type":"string"},"example":{"Department":"Electrical"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":2}},"externalId":{"type":"string","nullable":true,"description":"External ID for this location, unique per organization.","example":"ext-location-001"}}}}}},"responses":{"200":{"description":"Successfully edited location","content":{"application/json":{"schema":{"type":"object","required":["location"],"properties":{"location":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the location"},"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"childrenIds":{"type":"array","nullable":true,"items":{"type":"number"},"example":[342,521],"description":"IDs of the location's children"},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the location","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Department\")","additionalProperties":{"type":"string"},"example":{"Department":"Electrical"}},"teamIds":{"type":"array","description":"Team IDs","items":{"type":"number","example":2}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":2}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the location was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the location was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the location was deleted","format":"date-time"},"externalId":{"type":"string","nullable":true,"description":"External ID for this location, unique per organization.","example":"ext-location-001"}}}}}}}},"400":{"description":"Failed to edit the location","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"parentId is not valid"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified location.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"location Not Found"}}}}}},"409":{"description":"Conflict with existing location","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"conflictingMxId":{"type":"integer"},"isDeleted":{"type":"boolean"}},"required":["error","conflictingMxId","isDeleted"],"example":{"error":"Asset with externalId 'ext-123' already exists in this organization.","conflictingMxId":456,"isDeleted":false}}}}}},"tags":["Locations"]},"delete":{"summary":"Delete location","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the location","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the location"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified location.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"location Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Locations"]}},"/locations/{id}/attachments/{filename}":{"put":{"summary":"Update location attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the location.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"datasheet.pdf"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the attachment.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"application/x-indesign":{"schema":{"type":"object","format":"binary"}},"application/epub+zip":{"schema":{"type":"object","format":"binary"}},"application/x-xpinstall":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"schema":{"type":"object","format":"binary"}},"application/zip":{"schema":{"type":"object","format":"binary"}},"application/x-tar":{"schema":{"type":"object","format":"binary"}},"application/x-rar-compressed":{"schema":{"type":"object","format":"binary"}},"application/gzip":{"schema":{"type":"object","format":"binary"}},"application/x-bzip2":{"schema":{"type":"object","format":"binary"}},"application/x-7z-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-apple-diskimage":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.arrow.file":{"schema":{"type":"object","format":"binary"}},"video/mp4":{"schema":{"type":"object","format":"binary"}},"audio/midi":{"schema":{"type":"object","format":"binary"}},"video/matroska":{"schema":{"type":"object","format":"binary"}},"video/webm":{"schema":{"type":"object","format":"binary"}},"video/quicktime":{"schema":{"type":"object","format":"binary"}},"video/vnd.avi":{"schema":{"type":"object","format":"binary"}},"audio/wav":{"schema":{"type":"object","format":"binary"}},"audio/qcelp":{"schema":{"type":"object","format":"binary"}},"audio/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"video/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-asf":{"schema":{"type":"object","format":"binary"}},"video/mpeg":{"schema":{"type":"object","format":"binary"}},"video/3gpp":{"schema":{"type":"object","format":"binary"}},"audio/mpeg":{"schema":{"type":"object","format":"binary"}},"audio/mp4":{"schema":{"type":"object","format":"binary"}},"video/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg; codecs=opus":{"schema":{"type":"object","format":"binary"}},"application/ogg":{"schema":{"type":"object","format":"binary"}},"audio/flac":{"schema":{"type":"object","format":"binary"}},"audio/ape":{"schema":{"type":"object","format":"binary"}},"audio/wavpack":{"schema":{"type":"object","format":"binary"}},"audio/amr":{"schema":{"type":"object","format":"binary"}},"application/pdf":{"schema":{"type":"object","format":"binary"}},"application/x-elf":{"schema":{"type":"object","format":"binary"}},"application/x-mach-binary":{"schema":{"type":"object","format":"binary"}},"application/x-msdownload":{"schema":{"type":"object","format":"binary"}},"application/x-shockwave-flash":{"schema":{"type":"object","format":"binary"}},"application/rtf":{"schema":{"type":"object","format":"binary"}},"application/wasm":{"schema":{"type":"object","format":"binary"}},"font/woff":{"schema":{"type":"object","format":"binary"}},"font/woff2":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-fontobject":{"schema":{"type":"object","format":"binary"}},"font/ttf":{"schema":{"type":"object","format":"binary"}},"font/otf":{"schema":{"type":"object","format":"binary"}},"font/collection":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"video/x-flv":{"schema":{"type":"object","format":"binary"}},"application/postscript":{"schema":{"type":"object","format":"binary"}},"application/eps":{"schema":{"type":"object","format":"binary"}},"application/x-xz":{"schema":{"type":"object","format":"binary"}},"application/x-sqlite3":{"schema":{"type":"object","format":"binary"}},"application/x-nintendo-nes-rom":{"schema":{"type":"object","format":"binary"}},"application/x-google-chrome-extension":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-cab-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-deb":{"schema":{"type":"object","format":"binary"}},"application/x-unix-archive":{"schema":{"type":"object","format":"binary"}},"application/x-rpm":{"schema":{"type":"object","format":"binary"}},"application/x-compress":{"schema":{"type":"object","format":"binary"}},"application/lzip":{"schema":{"type":"object","format":"binary"}},"application/x-cfb":{"schema":{"type":"object","format":"binary"}},"application/x-mie":{"schema":{"type":"object","format":"binary"}},"application/mxf":{"schema":{"type":"object","format":"binary"}},"video/mp2t":{"schema":{"type":"object","format":"binary"}},"application/x-blender":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"audio/aiff":{"schema":{"type":"object","format":"binary"}},"application/xml":{"schema":{"type":"object","format":"binary"}},"application/x-mobipocket-ebook":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"application/dicom":{"schema":{"type":"object","format":"binary"}},"audio/x-musepack":{"schema":{"type":"object","format":"binary"}},"text/calendar":{"schema":{"type":"object","format":"binary"}},"text/vcard":{"schema":{"type":"object","format":"binary"}},"text/vtt":{"schema":{"type":"object","format":"binary"}},"model/gltf-binary":{"schema":{"type":"object","format":"binary"}},"application/vnd.tcpdump.pcap":{"schema":{"type":"object","format":"binary"}},"audio/x-dsf":{"schema":{"type":"object","format":"binary"}},"application/x-ms-shortcut":{"schema":{"type":"object","format":"binary"}},"application/x-ft-apple.alias":{"schema":{"type":"object","format":"binary"}},"audio/x-voc":{"schema":{"type":"object","format":"binary"}},"audio/vnd.dolby.dd-raw":{"schema":{"type":"object","format":"binary"}},"audio/x-m4a":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"video/x-m4v":{"schema":{"type":"object","format":"binary"}},"video/3gpp2":{"schema":{"type":"object","format":"binary"}},"application/x-esri-shape":{"schema":{"type":"object","format":"binary"}},"audio/aac":{"schema":{"type":"object","format":"binary"}},"audio/x-it":{"schema":{"type":"object","format":"binary"}},"audio/x-s3m":{"schema":{"type":"object","format":"binary"}},"audio/x-xm":{"schema":{"type":"object","format":"binary"}},"video/mp1s":{"schema":{"type":"object","format":"binary"}},"video/mp2p":{"schema":{"type":"object","format":"binary"}},"application/vnd.sketchup.skp":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"application/x-lzh-compressed":{"schema":{"type":"object","format":"binary"}},"application/pgp-encrypted":{"schema":{"type":"object","format":"binary"}},"application/x-asar":{"schema":{"type":"object","format":"binary"}},"model/stl":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-htmlhelp":{"schema":{"type":"object","format":"binary"}},"model/3mf":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"application/zstd":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-outlook":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.parquet":{"schema":{"type":"object","format":"binary"}},"application/java-vm":{"schema":{"type":"object","format":"binary"}},"application/x-arj":{"schema":{"type":"object","format":"binary"}},"application/x-cpio":{"schema":{"type":"object","format":"binary"}},"application/x-ace-compressed":{"schema":{"type":"object","format":"binary"}},"application/avro":{"schema":{"type":"object","format":"binary"}},"application/vnd.iccprofile":{"schema":{"type":"object","format":"binary"}},"application/x-ft-fbx":{"schema":{"type":"object","format":"binary"}},"application/vnd.visio":{"schema":{"type":"object","format":"binary"}},"application/vnd.android.package-archive":{"schema":{"type":"object","format":"binary"}},"application/x-ft-draco":{"schema":{"type":"object","format":"binary"}},"application/x-lz4":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.sheet.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.document.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/java-archive":{"schema":{"type":"object","format":"binary"}},"application/vnd.rn-realmedia":{"schema":{"type":"object","format":"binary"}},"application/x-spss-sav":{"schema":{"type":"object","format":"binary"}},"application/x-ms-regedit":{"schema":{"type":"object","format":"binary"}},"application/x-ft-windows-registry-hive":{"schema":{"type":"object","format":"binary"}},"application/x-jmp-data":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.keynote":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.numbers":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.pages":{"schema":{"type":"object","format":"binary"}},"application/x-apache-arrow":{"schema":{"type":"object","format":"binary"}},"application/x-lzip":{"schema":{"type":"object","format":"binary"}},"application/x.apple.alias":{"schema":{"type":"object","format":"binary"}},"application/x.ms.shortcut":{"schema":{"type":"object","format":"binary"}},"audio/opus":{"schema":{"type":"object","format":"binary"}},"audio/vnd.wave":{"schema":{"type":"object","format":"binary"}},"audio/x-flac":{"schema":{"type":"object","format":"binary"}},"video/x-matroska":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated location's attachment.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified location.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"location Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Locations"]},"delete":{"summary":"Remove location attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the location.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"attachment.xls"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully removed location's attachment."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Attachment.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment Not Found"}}}}}}},"tags":["Locations"]}},"/locations/{id}/thumbnail/{filename}":{"put":{"summary":"Update location's thumbnail","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the location.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the location thumbnail, including the extension.","example":"motor.png"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the thumbnail.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated location's thumbnail.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"You cannot edit this entity.","fieldPath":"organizationId","fieldValue":"1"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Location.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Location Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Locations"]}},"/maintenanceplans":{"post":{"summary":"Create a maintenance plan","requestBody":{"description":"The maintenance plan to create.","required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","recurrence","workOrderBlueprintId","planningHorizon"],"properties":{"name":{"type":"string","description":"Name of the maintenance plan.","example":"Weekly Conveyor Belt Inspection"},"recurrence":{"type":"object","example":{"type":"WEEKLY","interval":2,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"oneOf":[{"type":"object","title":"Daily","required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]}}},{"type":"object","title":"Weekly","required":["type","interval","days"],"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between occurrences","minimum":1,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"]}}}},{"type":"object","title":"Monthly","required":["type","interval","day"],"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between occurrences","minimum":1,"default":1},"day":{"type":"integer","description":"Day of the month the event will occur","minimum":1,"maximum":31}}},{"type":"object","title":"Yearly","required":["type","interval"],"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between occurrences","minimum":1,"default":1}}},{"type":"object","title":"Periodically","required":["type","interval"],"properties":{"type":{"type":"string","pattern":"PERIODICALLY","enum":["PERIODICALLY"]},"interval":{"type":"integer","description":"Number of seconds after the previous due date. Required for plans whose intervalStrategy is FLOATING, and rejected for any other interval strategy.","minimum":1}}}],"description":"The recurrence schedule configuration."},"startDate":{"type":"string","format":"date-time","description":"The first due date for generated work orders.","example":"2022-01-01T00:00:00.000Z"},"workOrderBlueprintId":{"type":"number","description":"ID of the maintenance plan work order blueprint used to generate work orders. These can be created through the /maintenanceplans/workorderblueprints endpoint.","example":10},"workOrderStartDatePadding":{"type":"number","deprecated":true,"description":"Hours between the start date and due date of generated work orders. Deprecated: use workOrderStartDateOffset instead.","example":48},"workOrderStartDateOffset":{"type":"object","required":["value","unit"],"properties":{"value":{"type":"number","description":"The numeric value of the offset between the work order start date and the due date. Must be >= 1. Per-unit caps: HOUR <= 8760, DAY <= 365, WEEK <= 52.","example":2},"unit":{"type":"string","enum":["HOUR","DAY","WEEK"],"description":"The unit of the work order start date offset.","example":"DAY"}},"description":"Offset between the work order start date and the due date, expressed as a (value, unit) pair."},"planningHorizon":{"type":"object","required":["value","unit"],"properties":{"value":{"type":"number","description":"The numeric value of the planning horizon.","example":3},"unit":{"type":"string","enum":["DAY","WEEK","MONTH","YEAR"],"description":"The unit of the planning horizon.","example":"WEEK"}},"description":"How far ahead to generate work orders."},"planAssets":{"type":"array","items":{"type":"object","required":["assetId"],"properties":{"assetId":{"type":"number","description":"ID of the asset.","example":100}}},"description":"Assets to associate with this plan."},"intervals":{"type":"array","items":{"type":"object","required":["interval","workOrderBlueprintId"],"properties":{"interval":{"type":"number","description":"The cycle number at which this interval's blueprint is used.","example":3},"workOrderBlueprintId":{"type":"number","description":"ID of the maintenance plan work order blueprint for this cycle. These can be created through the /maintenanceplans/workorderblueprints endpoint.","example":50}}},"description":"Multi-cycle intervals with different blueprints per cycle."},"nextCycleOccurrence":{"type":"number","nullable":false,"description":"Which cycle in the multi-cycle sequence comes next.","example":2}}}}}},"responses":{"201":{"description":"Successfully created the maintenance plan.","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number","example":1,"description":"ID of the created maintenance plan."}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Maintenance Plans"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]},"get":{"summary":"List maintenance plans","description":"Endpoint used to list maintenance plan resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Maintenance Plans returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Maintenance Plans list","content":{"application/json":{"schema":{"type":"object","required":["maintenancePlans","nextCursor","nextPageUrl"],"properties":{"maintenancePlans":{"type":"array","items":{"type":"object","required":["id","name","organizationId","startDate","workOrderStartDatePadding","workOrderStartDateOffset","workOrderStartDateFixedDay","blueprintEstimatedTime","triggerType","intervalStrategy","recurrence","planningHorizon","workOrderBlueprintId","assets","intervals","nextCycleOccurrence","nextScheduledWorkOrderDueDate","lastPlannedDueDate","nextWorkOrderGenerationAt","lastWorkOrderGeneratedAt","creatorId","createdAt","updatedAt","archivedAt"],"properties":{"id":{"type":"number","description":"Unique ID of the maintenance plan.","example":1},"name":{"type":"string","description":"Name of the maintenance plan.","example":"Weekly Conveyor Belt Inspection"},"organizationId":{"type":"number","description":"ID of the organization this plan belongs to.","example":42},"startDate":{"type":"string","format":"date-time","description":"The first due date for generated work orders.","example":"2022-01-01T00:00:00.000Z","nullable":true},"workOrderStartDatePadding":{"type":"number","deprecated":true,"description":"Hours between the start date and due date of generated work orders. Deprecated: use workOrderStartDateOffset instead.","example":48,"nullable":true},"workOrderStartDateOffset":{"type":"object","required":["value","unit"],"properties":{"value":{"type":"number","description":"The numeric value of the offset between the work order start date and the due date. Must be >= 1. Per-unit caps: HOUR <= 8760, DAY <= 365, WEEK <= 52.","example":2},"unit":{"type":"string","enum":["HOUR","DAY","WEEK"],"description":"The unit of the work order start date offset.","example":"DAY"}},"description":"Offset between the work order start date and the due date, expressed as a (value, unit) pair.","nullable":true},"workOrderStartDateFixedDay":{"type":"number","nullable":true,"description":"Day of month for fixed-day work order start dates. Null means the plan uses relative offset behavior.","example":5},"blueprintEstimatedTime":{"type":"number","nullable":true,"description":"Estimated time (in minutes) from the work order blueprint.","example":60},"triggerType":{"type":"string","enum":["CALENDAR","METER","CALENDAR_OR_METER"],"description":"What triggers work order generation. METER and CALENDAR_OR_METER require the meter configuration fields.","example":"CALENDAR"},"intervalStrategy":{"type":"string","enum":["FIXED","FLOATING"],"description":"The interval strategy for the schedule. FLOATING requires a PERIODICALLY recurrence, and CALENDAR_OR_METER plans must use FLOATING.","example":"FIXED"},"recurrence":{"type":"object","example":{"type":"WEEKLY","interval":2,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"oneOf":[{"type":"object","title":"Daily","required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]}}},{"type":"object","title":"Weekly","required":["type","interval","days"],"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between occurrences","minimum":1,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"]}}}},{"type":"object","title":"Monthly","required":["type","interval","day"],"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between occurrences","minimum":1,"default":1},"day":{"type":"integer","description":"Day of the month the event will occur","minimum":1,"maximum":31}}},{"type":"object","title":"Yearly","required":["type","interval"],"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between occurrences","minimum":1,"default":1}}},{"type":"object","title":"Periodically","required":["type","interval"],"properties":{"type":{"type":"string","pattern":"PERIODICALLY","enum":["PERIODICALLY"]},"interval":{"type":"integer","description":"Number of seconds after the previous due date. Required for plans whose intervalStrategy is FLOATING, and rejected for any other interval strategy.","minimum":1}}}],"description":"The recurrence schedule configuration."},"planningHorizon":{"type":"object","required":["value","unit"],"properties":{"value":{"type":"number","description":"The numeric value of the planning horizon.","example":3},"unit":{"type":"string","enum":["DAY","WEEK","MONTH","YEAR"],"description":"The unit of the planning horizon.","example":"WEEK"}},"description":"How far ahead to generate work orders."},"workOrderBlueprintId":{"type":"number","description":"ID of the maintenance plan work order blueprint used to generate work orders. These can be created through the /maintenanceplans/workorderblueprints endpoint.","example":10},"assets":{"type":"array","items":{"type":"object","required":["id","assetId"],"properties":{"id":{"type":"number","description":"ID of the plan-asset association.","example":1},"assetId":{"type":"number","description":"ID of the asset.","example":100}}},"description":"Assets associated with this maintenance plan."},"intervals":{"type":"array","items":{"type":"object","required":["id","interval","workOrderBlueprintId"],"properties":{"id":{"type":"number","description":"ID of the interval.","example":1},"interval":{"type":"number","description":"The cycle number at which this interval's blueprint is used.","example":3},"workOrderBlueprintId":{"type":"number","description":"ID of the maintenance plan work order blueprint for this cycle. These can be created through the /maintenanceplans/workorderblueprints endpoint.","example":50}}},"description":"Multi-cycle intervals. Each interval specifies a cycle number and a different work order blueprint."},"nextCycleOccurrence":{"type":"number","nullable":true,"description":"Which cycle in the multi-cycle sequence comes next.","example":2},"nextScheduledWorkOrderDueDate":{"type":"string","format":"date-time","nullable":true,"description":"The computed due date for the next work order to be generated.","example":"2022-01-01T00:00:00.000Z"},"lastPlannedDueDate":{"type":"string","format":"date-time","nullable":true,"description":"The due date of the most recently planned work order.","example":"2022-01-01T00:00:00.000Z"},"nextWorkOrderGenerationAt":{"type":"string","format":"date-time","nullable":true,"description":"When the next batch of work orders will be generated.","example":"2022-01-01T00:00:00.000Z"},"lastWorkOrderGeneratedAt":{"type":"string","format":"date-time","nullable":true,"description":"When work orders were last generated for this plan.","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"type":"number","description":"ID of the user who created this plan.","example":5},"createdAt":{"type":"string","format":"date-time","description":"When this plan was created.","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","nullable":true,"description":"When this plan was last updated.","example":"2022-01-01T00:00:00.000Z"},"archivedAt":{"type":"string","format":"date-time","nullable":true,"description":"When this plan was archived, or null if active.","example":"2022-01-01T00:00:00.000Z"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Maintenance Plans.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Maintenance Plans.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Maintenance Plans"]}},"/maintenanceplans/workorderblueprints":{"post":{"summary":"Create a maintenance plan work order blueprint","requestBody":{"description":"The work order blueprint to create with a maintenance plan target.","required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string","description":"Title of the work order blueprint.","example":"Weekly Inspection"},"description":{"type":"string","description":"Description of the work order blueprint.","example":"Inspect the conveyor belt for wear and tear."},"estimatedTime":{"type":"integer","description":"Estimated time in seconds to complete the work order.","example":3600},"procedureBlueprintIds":{"type":"array","items":{"type":"integer"},"description":"IDs of procedure blueprints to attach to the work order blueprint.","example":[1,2]},"userIds":{"type":"array","items":{"type":"integer"},"description":"IDs of users to assign to work orders generated from this blueprint.","example":[1,2]},"teamIds":{"type":"array","items":{"type":"integer"},"description":"IDs of teams to assign to work orders generated from this blueprint.","example":[3,4]},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"],"description":"Priority of work orders generated from this blueprint."},"partsUsed":{"type":"array","items":{"type":"object","required":["partId","quantityUsed"],"properties":{"partId":{"type":"integer","description":"ID of the part used.","example":10},"quantityUsed":{"type":"integer","description":"Quantity of the part used.","example":2}}},"description":"Parts used by work orders generated from this blueprint."},"tagIds":{"type":"array","items":{"type":"integer"},"description":"IDs of tags (categories) to associate with the work order blueprint.","example":[5,6]},"vendorIds":{"type":"array","items":{"type":"integer"},"description":"IDs of vendors to associate with the work order blueprint.","example":[7,8]},"customFieldValues":{"type":"array","items":{"type":"object","required":["workOrderFieldId","value"],"properties":{"workOrderFieldId":{"type":"integer","description":"ID of the work order custom field.","example":100},"value":{"type":"string","description":"Value of the custom field.","example":"high"}}},"description":"Custom field values for work orders generated from this blueprint."}}}}}},"responses":{"201":{"description":"Successfully created the work order blueprint.","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number","example":1,"description":"ID of the created work order blueprint."}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Maintenance Plans"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]}},"/maintenanceplans/{id}":{"get":{"summary":"Get maintenance plan","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the maintenancePlan","example":"1"}],"responses":{"200":{"description":"Successfully retrieved maintenancePlan's information","content":{"application/json":{"schema":{"type":"object","required":["maintenancePlan"],"properties":{"maintenancePlan":{"type":"object","required":["id","name","organizationId","startDate","workOrderStartDatePadding","workOrderStartDateOffset","workOrderStartDateFixedDay","blueprintEstimatedTime","triggerType","intervalStrategy","recurrence","planningHorizon","workOrderBlueprintId","assets","intervals","nextCycleOccurrence","nextScheduledWorkOrderDueDate","lastPlannedDueDate","nextWorkOrderGenerationAt","lastWorkOrderGeneratedAt","creatorId","createdAt","updatedAt","archivedAt"],"properties":{"id":{"type":"number","description":"Unique ID of the maintenance plan.","example":1},"name":{"type":"string","description":"Name of the maintenance plan.","example":"Weekly Conveyor Belt Inspection"},"organizationId":{"type":"number","description":"ID of the organization this plan belongs to.","example":42},"startDate":{"type":"string","format":"date-time","description":"The first due date for generated work orders.","example":"2022-01-01T00:00:00.000Z","nullable":true},"workOrderStartDatePadding":{"type":"number","deprecated":true,"description":"Hours between the start date and due date of generated work orders. Deprecated: use workOrderStartDateOffset instead.","example":48,"nullable":true},"workOrderStartDateOffset":{"type":"object","required":["value","unit"],"properties":{"value":{"type":"number","description":"The numeric value of the offset between the work order start date and the due date. Must be >= 1. Per-unit caps: HOUR <= 8760, DAY <= 365, WEEK <= 52.","example":2},"unit":{"type":"string","enum":["HOUR","DAY","WEEK"],"description":"The unit of the work order start date offset.","example":"DAY"}},"description":"Offset between the work order start date and the due date, expressed as a (value, unit) pair.","nullable":true},"workOrderStartDateFixedDay":{"type":"number","nullable":true,"description":"Day of month for fixed-day work order start dates. Null means the plan uses relative offset behavior.","example":5},"blueprintEstimatedTime":{"type":"number","nullable":true,"description":"Estimated time (in minutes) from the work order blueprint.","example":60},"triggerType":{"type":"string","enum":["CALENDAR","METER","CALENDAR_OR_METER"],"description":"What triggers work order generation. METER and CALENDAR_OR_METER require the meter configuration fields.","example":"CALENDAR"},"intervalStrategy":{"type":"string","enum":["FIXED","FLOATING"],"description":"The interval strategy for the schedule. FLOATING requires a PERIODICALLY recurrence, and CALENDAR_OR_METER plans must use FLOATING.","example":"FIXED"},"recurrence":{"type":"object","example":{"type":"WEEKLY","interval":2,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"oneOf":[{"type":"object","title":"Daily","required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]}}},{"type":"object","title":"Weekly","required":["type","interval","days"],"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between occurrences","minimum":1,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"]}}}},{"type":"object","title":"Monthly","required":["type","interval","day"],"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between occurrences","minimum":1,"default":1},"day":{"type":"integer","description":"Day of the month the event will occur","minimum":1,"maximum":31}}},{"type":"object","title":"Yearly","required":["type","interval"],"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between occurrences","minimum":1,"default":1}}},{"type":"object","title":"Periodically","required":["type","interval"],"properties":{"type":{"type":"string","pattern":"PERIODICALLY","enum":["PERIODICALLY"]},"interval":{"type":"integer","description":"Number of seconds after the previous due date. Required for plans whose intervalStrategy is FLOATING, and rejected for any other interval strategy.","minimum":1}}}],"description":"The recurrence schedule configuration."},"planningHorizon":{"type":"object","required":["value","unit"],"properties":{"value":{"type":"number","description":"The numeric value of the planning horizon.","example":3},"unit":{"type":"string","enum":["DAY","WEEK","MONTH","YEAR"],"description":"The unit of the planning horizon.","example":"WEEK"}},"description":"How far ahead to generate work orders."},"workOrderBlueprintId":{"type":"number","description":"ID of the maintenance plan work order blueprint used to generate work orders. These can be created through the /maintenanceplans/workorderblueprints endpoint.","example":10},"assets":{"type":"array","items":{"type":"object","required":["id","assetId"],"properties":{"id":{"type":"number","description":"ID of the plan-asset association.","example":1},"assetId":{"type":"number","description":"ID of the asset.","example":100}}},"description":"Assets associated with this maintenance plan."},"intervals":{"type":"array","items":{"type":"object","required":["id","interval","workOrderBlueprintId"],"properties":{"id":{"type":"number","description":"ID of the interval.","example":1},"interval":{"type":"number","description":"The cycle number at which this interval's blueprint is used.","example":3},"workOrderBlueprintId":{"type":"number","description":"ID of the maintenance plan work order blueprint for this cycle. These can be created through the /maintenanceplans/workorderblueprints endpoint.","example":50}}},"description":"Multi-cycle intervals. Each interval specifies a cycle number and a different work order blueprint."},"nextCycleOccurrence":{"type":"number","nullable":true,"description":"Which cycle in the multi-cycle sequence comes next.","example":2},"nextScheduledWorkOrderDueDate":{"type":"string","format":"date-time","nullable":true,"description":"The computed due date for the next work order to be generated.","example":"2022-01-01T00:00:00.000Z"},"lastPlannedDueDate":{"type":"string","format":"date-time","nullable":true,"description":"The due date of the most recently planned work order.","example":"2022-01-01T00:00:00.000Z"},"nextWorkOrderGenerationAt":{"type":"string","format":"date-time","nullable":true,"description":"When the next batch of work orders will be generated.","example":"2022-01-01T00:00:00.000Z"},"lastWorkOrderGeneratedAt":{"type":"string","format":"date-time","nullable":true,"description":"When work orders were last generated for this plan.","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"type":"number","description":"ID of the user who created this plan.","example":5},"createdAt":{"type":"string","format":"date-time","description":"When this plan was created.","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","nullable":true,"description":"When this plan was last updated.","example":"2022-01-01T00:00:00.000Z"},"archivedAt":{"type":"string","format":"date-time","nullable":true,"description":"When this plan was archived, or null if active.","example":"2022-01-01T00:00:00.000Z"}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified maintenancePlan or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Maintenance Plans"]},"patch":{"summary":"Update a maintenance plan","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the maintenance plan","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Fields to update on the maintenance plan.","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of the maintenance plan.","example":"Weekly Conveyor Belt Inspection"},"recurrence":{"type":"object","example":{"type":"WEEKLY","interval":2,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"oneOf":[{"type":"object","title":"Daily","required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]}}},{"type":"object","title":"Weekly","required":["type","interval","days"],"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between occurrences","minimum":1,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"]}}}},{"type":"object","title":"Monthly","required":["type","interval","day"],"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between occurrences","minimum":1,"default":1},"day":{"type":"integer","description":"Day of the month the event will occur","minimum":1,"maximum":31}}},{"type":"object","title":"Yearly","required":["type","interval"],"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between occurrences","minimum":1,"default":1}}},{"type":"object","title":"Periodically","required":["type","interval"],"properties":{"type":{"type":"string","pattern":"PERIODICALLY","enum":["PERIODICALLY"]},"interval":{"type":"integer","description":"Number of seconds after the previous due date. Required for plans whose intervalStrategy is FLOATING, and rejected for any other interval strategy.","minimum":1}}}],"description":"The recurrence schedule configuration."},"startDate":{"type":"string","format":"date-time","description":"The first due date for generated work orders.","example":"2022-01-01T00:00:00.000Z"},"workOrderBlueprintId":{"type":"number","description":"ID of the maintenance plan work order blueprint used to generate work orders. These can be created through the /maintenanceplans/workorderblueprints endpoint.","example":10},"workOrderStartDatePadding":{"type":"number","deprecated":true,"description":"Hours between the start date and due date of generated work orders. Deprecated: use workOrderStartDateOffset instead.","example":48},"workOrderStartDateOffset":{"type":"object","required":["value","unit"],"properties":{"value":{"type":"number","description":"The numeric value of the offset between the work order start date and the due date. Must be >= 1. Per-unit caps: HOUR <= 8760, DAY <= 365, WEEK <= 52.","example":2},"unit":{"type":"string","enum":["HOUR","DAY","WEEK"],"description":"The unit of the work order start date offset.","example":"DAY"}},"description":"Offset between the work order start date and the due date, expressed as a (value, unit) pair."},"planningHorizon":{"type":"object","required":["value","unit"],"properties":{"value":{"type":"number","description":"The numeric value of the planning horizon.","example":3},"unit":{"type":"string","enum":["DAY","WEEK","MONTH","YEAR"],"description":"The unit of the planning horizon.","example":"WEEK"}},"description":"How far ahead to generate work orders."},"nextWorkOrderToGenerateDueDate":{"type":"string","format":"date-time","nullable":true,"description":"Override the due date of the next work order to be generated.","example":"2022-01-01T00:00:00.000Z"},"addedPlanAssets":{"type":"array","items":{"type":"object","required":["assetId"],"properties":{"assetId":{"type":"number","description":"ID of the asset.","example":100}}},"description":"Assets to add to this plan."},"removedPlanAssetIds":{"type":"array","items":{"type":"number"},"description":"IDs of plan-asset associations to remove.","example":[1,2]},"addedUpdatedIntervals":{"type":"array","items":{"type":"object","required":["interval","workOrderBlueprintId"],"properties":{"id":{"type":"number","description":"ID of an existing interval to update. Omit to create a new one.","example":1},"interval":{"type":"number","description":"The cycle number at which this interval's blueprint is used.","example":3},"workOrderBlueprintId":{"type":"number","description":"ID of the maintenance plan work order blueprint for this cycle. These can be created through the /maintenanceplans/workorderblueprints endpoint.","example":50}}},"description":"Intervals to add or update."},"removedIntervalIds":{"type":"array","items":{"type":"number"},"description":"IDs of intervals to remove.","example":[1,2]},"nextCycleOccurrence":{"type":"number","nullable":true,"description":"Which cycle in the multi-cycle sequence comes next.","example":2}}}}}},"responses":{"200":{"description":"Successfully updated the maintenance plan.","content":{"application/json":{"schema":{"type":"object","required":["maintenancePlan"],"properties":{"maintenancePlan":{"type":"object","required":["id","name","organizationId","startDate","workOrderStartDatePadding","workOrderStartDateOffset","workOrderStartDateFixedDay","blueprintEstimatedTime","triggerType","intervalStrategy","recurrence","planningHorizon","workOrderBlueprintId","assets","intervals","nextCycleOccurrence","nextScheduledWorkOrderDueDate","lastPlannedDueDate","nextWorkOrderGenerationAt","lastWorkOrderGeneratedAt","creatorId","createdAt","updatedAt","archivedAt"],"properties":{"id":{"type":"number","description":"Unique ID of the maintenance plan.","example":1},"name":{"type":"string","description":"Name of the maintenance plan.","example":"Weekly Conveyor Belt Inspection"},"organizationId":{"type":"number","description":"ID of the organization this plan belongs to.","example":42},"startDate":{"type":"string","format":"date-time","description":"The first due date for generated work orders.","example":"2022-01-01T00:00:00.000Z","nullable":true},"workOrderStartDatePadding":{"type":"number","deprecated":true,"description":"Hours between the start date and due date of generated work orders. Deprecated: use workOrderStartDateOffset instead.","example":48,"nullable":true},"workOrderStartDateOffset":{"type":"object","required":["value","unit"],"properties":{"value":{"type":"number","description":"The numeric value of the offset between the work order start date and the due date. Must be >= 1. Per-unit caps: HOUR <= 8760, DAY <= 365, WEEK <= 52.","example":2},"unit":{"type":"string","enum":["HOUR","DAY","WEEK"],"description":"The unit of the work order start date offset.","example":"DAY"}},"description":"Offset between the work order start date and the due date, expressed as a (value, unit) pair.","nullable":true},"workOrderStartDateFixedDay":{"type":"number","nullable":true,"description":"Day of month for fixed-day work order start dates. Null means the plan uses relative offset behavior.","example":5},"blueprintEstimatedTime":{"type":"number","nullable":true,"description":"Estimated time (in minutes) from the work order blueprint.","example":60},"triggerType":{"type":"string","enum":["CALENDAR","METER","CALENDAR_OR_METER"],"description":"What triggers work order generation. METER and CALENDAR_OR_METER require the meter configuration fields.","example":"CALENDAR"},"intervalStrategy":{"type":"string","enum":["FIXED","FLOATING"],"description":"The interval strategy for the schedule. FLOATING requires a PERIODICALLY recurrence, and CALENDAR_OR_METER plans must use FLOATING.","example":"FIXED"},"recurrence":{"type":"object","example":{"type":"WEEKLY","interval":2,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"oneOf":[{"type":"object","title":"Daily","required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]}}},{"type":"object","title":"Weekly","required":["type","interval","days"],"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between occurrences","minimum":1,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"]}}}},{"type":"object","title":"Monthly","required":["type","interval","day"],"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between occurrences","minimum":1,"default":1},"day":{"type":"integer","description":"Day of the month the event will occur","minimum":1,"maximum":31}}},{"type":"object","title":"Yearly","required":["type","interval"],"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between occurrences","minimum":1,"default":1}}},{"type":"object","title":"Periodically","required":["type","interval"],"properties":{"type":{"type":"string","pattern":"PERIODICALLY","enum":["PERIODICALLY"]},"interval":{"type":"integer","description":"Number of seconds after the previous due date. Required for plans whose intervalStrategy is FLOATING, and rejected for any other interval strategy.","minimum":1}}}],"description":"The recurrence schedule configuration."},"planningHorizon":{"type":"object","required":["value","unit"],"properties":{"value":{"type":"number","description":"The numeric value of the planning horizon.","example":3},"unit":{"type":"string","enum":["DAY","WEEK","MONTH","YEAR"],"description":"The unit of the planning horizon.","example":"WEEK"}},"description":"How far ahead to generate work orders."},"workOrderBlueprintId":{"type":"number","description":"ID of the maintenance plan work order blueprint used to generate work orders. These can be created through the /maintenanceplans/workorderblueprints endpoint.","example":10},"assets":{"type":"array","items":{"type":"object","required":["id","assetId"],"properties":{"id":{"type":"number","description":"ID of the plan-asset association.","example":1},"assetId":{"type":"number","description":"ID of the asset.","example":100}}},"description":"Assets associated with this maintenance plan."},"intervals":{"type":"array","items":{"type":"object","required":["id","interval","workOrderBlueprintId"],"properties":{"id":{"type":"number","description":"ID of the interval.","example":1},"interval":{"type":"number","description":"The cycle number at which this interval's blueprint is used.","example":3},"workOrderBlueprintId":{"type":"number","description":"ID of the maintenance plan work order blueprint for this cycle. These can be created through the /maintenanceplans/workorderblueprints endpoint.","example":50}}},"description":"Multi-cycle intervals. Each interval specifies a cycle number and a different work order blueprint."},"nextCycleOccurrence":{"type":"number","nullable":true,"description":"Which cycle in the multi-cycle sequence comes next.","example":2},"nextScheduledWorkOrderDueDate":{"type":"string","format":"date-time","nullable":true,"description":"The computed due date for the next work order to be generated.","example":"2022-01-01T00:00:00.000Z"},"lastPlannedDueDate":{"type":"string","format":"date-time","nullable":true,"description":"The due date of the most recently planned work order.","example":"2022-01-01T00:00:00.000Z"},"nextWorkOrderGenerationAt":{"type":"string","format":"date-time","nullable":true,"description":"When the next batch of work orders will be generated.","example":"2022-01-01T00:00:00.000Z"},"lastWorkOrderGeneratedAt":{"type":"string","format":"date-time","nullable":true,"description":"When work orders were last generated for this plan.","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"type":"number","description":"ID of the user who created this plan.","example":5},"createdAt":{"type":"string","format":"date-time","description":"When this plan was created.","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","nullable":true,"description":"When this plan was last updated.","example":"2022-01-01T00:00:00.000Z"},"archivedAt":{"type":"string","format":"date-time","nullable":true,"description":"When this plan was archived, or null if active.","example":"2022-01-01T00:00:00.000Z"}}}}}}}},"400":{"description":"Failed to update the maintenance plan.","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Bad request"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified maintenance plan.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"maintenance plan Not Found"}}}}}}},"tags":["Maintenance Plans"]},"delete":{"summary":"Delete maintenance plan","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the maintenance plan","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the maintenancePlan"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified maintenancePlan.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"maintenancePlan Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Maintenance Plans"]}},"/meterreadings":{"post":{"summary":"Batch create new meter readings","description":"We strongly recommend using this endpoint to create meter readings since it is more efficient.\n      <h3>Rate Limits</h3>\n      <li>For Automated and IoT meter readings: 100 requests / 60 seconds</li>\n      <li>For Manual meter readings: 10 requests / 24 hours</li>\n      ","requestBody":{"description":"Meter readings to create","required":true,"content":{"application/json":{"schema":{"type":"array","maxItems":100,"items":{"type":"object","required":["meterId","value"],"properties":{"meterId":{"type":"number","example":53,"description":"Global ID of the meter."},"value":{"type":"number","description":"The reading value given by the meter.","example":120},"readingDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date at which the meter was read. This date can be set in the past, but cannot be further than 3 days for IoT meters.","nullable":true}}}}}}},"responses":{"201":{"description":"Successfully created meter readings","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["meterId","value","createdAt"],"properties":{"meterId":{"type":"number","example":53,"description":"Global ID of the meter."},"value":{"type":"number","description":"The reading value given by the meter.","example":120},"createdAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Meter Reading creation/processing date."},"readingDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date at which the meter was read. This date can be set in the past, but cannot be further than 3 days for IoT meters.","nullable":true}}}}}}},"400":{"description":"Error occurred trying to insert a meter reading","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Unexpected error"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"You are forbidden to perform the requested action or to access this resource","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Forbidden"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified meter.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"meter Not Found"}}}}}},"429":{"description":"You have exceeded the rate limit for manual meter readings","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Too Many Requests. Manual meter readings are limited to 10 every 24h 00m 00s. For a higher recording frequency please use Meters of type IoT. Contact support@getmaintainx.com for help."}}}}}}},"tags":["Meter Readings"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}]}},"/meters":{"post":{"summary":"Create new meter","description":"Endpoint used to create a new meter. Pay attention to the `measurementType` field as it has a significant impact on the behavior of your meter.","requestBody":{"description":"Asset to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","unit"],"properties":{"name":{"type":"string","description":"Name of the meters"},"description":{"nullable":true,"type":"string","description":"Description of the meter","example":"This meter is used for monitoring the temperature of the boiler"},"measurementType":{"type":"string","default":"MANUAL","enum":["MANUAL","IOT_DEVICE","AUTOMATED_SENSOR"],"example":"AUTOMATED_SENSOR","description":"Represents the Type of meter. <br><br><code>Manual</code>: They are made to be used in the MaintainX app and to retain manually entered values and are limited to 10 distinct readings creation requests per 24 hours over REST API. Batched readings requests only count as one toward the rate limit. <br><br><code>Automated</code>: (Enterprise Plan) Automated meters store high frequency readings sent from integrations and have normal rate limiting. <br><br>~~<code>IoT Device</code>~~: IoT Device meters are deprecated and should no longer be used in the future. Creating an IoT Device meter will mimic automated meters in terms of behavior to avoid breaking changes."},"readingFrequency":{"type":"object","nullable":true,"description":"Expected reading frequency of the meter. Mostly useful for manual meters.","example":{"type":"WEEKLY","interval":3,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"anyOf":[{"type":"object","title":"Secondly","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"SECONDLY","enum":["SECONDLY"]},"interval":{"type":"integer","description":"Number of seconds between readings. Minimum 10s for IOT_DEVICE, 86400s for MANUAL","minimum":10,"default":10}}},{"type":"object","title":"Minutly","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"MINUTLY","enum":["MINUTLY"]},"interval":{"type":"integer","description":"Number of minutes between readings","minimum":1,"default":1}}},{"type":"object","title":"Hourly","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"HOURLY","enum":["HOURLY"]},"interval":{"type":"integer","description":"Number of hours between readings","minimum":1,"default":1}}},{"type":"object","title":"Daily","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]},"interval":{"type":"integer","description":"Number of days between readings","minimum":1,"default":1}}},{"type":"object","title":"Weekly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between readings","minimum":1,"maximum":52,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"]}}}},{"type":"object","title":"Monthly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between readings","minimum":1,"maximum":12,"default":1},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month the event will occur"}}},{"type":"object","title":"Yearly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between readings","minimum":1,"maximum":1000,"default":1}}}]},"unit":{"type":"string","description":"Measurement unit for the readings. Any string is accepted. However, if applicable, we recommed you to use the following units as it may carry extra functionality: <br><ul> \n            <li>Distance:\n              <ul>\n                <li><code>Miles</code></li><li><code>Feet</code></li><li><code>Inches</code></li><li><code>Kilometers</code></li><li><code>Meters</code></li><li><code>Centimeters</code></li><li><code>Millimeters</code></li>\n              </ul>\n            </li>\n            <li>Volume:\n              <ul>\n                <li><code>Gallons</code></li><li><code>Liters</code></li><li><code>Milliliters</code></li><li><code>Cubic Meters</code></li>\n              </ul>\n            </li>\n            <li>Temperature:\n              <ul>\n                <li><code>Celsius</code></li><li><code>Fahrenheit</code></li><li><code>Kelvin</code></li>\n              </ul>\n            </li>\n            <li>Other:\n              <ul>\n                <li><code>Hours</code></li><li><code>Cycles</code></li><li><code>PSI</code></li><li><code>Kilograms</code></li><li><code>Grams</code></li><li><code>dBm</code></li><li><code>Nm</code></li>\n              </ul>\n            </li>\n            <li>Velocity:\n              <ul>\n                <li><code>MetersPerSecond</code></li><li><code>InchesPerSecond</code></li><li><code>MillimetersPerSecond</code></li>\n              </ul>\n            </li>\n            <li>Acceleration:\n              <ul>\n                <li><code>G-Force</code></li><li><code>MetersPerSecondSquared</code></li><li><code>FeetPerSecondSquared</code></li>\n              </ul>\n            </li>\n            <li>Electrical:\n              <ul>\n                <li><code>Volts</code></li><li><code>Amps</code></li>\n              </ul>\n            </li>\n      </ul>\n    ","example":"Celsius"},"assetId":{"type":"integer","description":"Global ID of the asset tied to the meter","example":123,"nullable":true},"locationId":{"type":"integer","description":"Global ID of the location tied to the meter","example":123,"nullable":true}}}}}},"responses":{"201":{"description":"Successfully created meter","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number","description":"Global ID of the meter.","example":123}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"502":{"description":"The creation of the resource failed on the upstream service.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"The creation of the source associated with this meter failed."}}}}}}},"tags":["Meters"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]},"get":{"summary":"List meters","description":"Endpoint used to list meter resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Meters returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"measurementType","schema":{"type":"string","description":"The measurement type of the meter to filter by","enum":["MANUAL","IOT_DEVICE","AUTOMATED_SENSOR"],"example":"MANUAL"},"in":"query"},{"name":"assets","schema":{"type":"array","title":"asset ID filters","description":"To filter by multiple asset IDs: `assets=123&assets=456`","items":{"type":"integer"}},"in":"query"},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","description":"To expand multiple fields: `expand=asset&expand=location`","type":"array","items":{"type":"string","enum":["asset","location","last_reading"]}}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Meters list","content":{"application/json":{"schema":{"type":"object","required":["meters","nextCursor","nextPageUrl"],"properties":{"meters":{"type":"array","items":{"type":"object","required":["id","name","unit","measurementType"],"properties":{"id":{"type":"number","description":"Global ID of the meter.","example":123},"name":{"type":"string","description":"Name of the meters"},"unit":{"type":"string","description":"Measurement unit for the readings. Any string is accepted. However, if applicable, we recommed you to use the following units as it may carry extra functionality: <br><ul> \n            <li>Distance:\n              <ul>\n                <li><code>Miles</code></li><li><code>Feet</code></li><li><code>Inches</code></li><li><code>Kilometers</code></li><li><code>Meters</code></li><li><code>Centimeters</code></li><li><code>Millimeters</code></li>\n              </ul>\n            </li>\n            <li>Volume:\n              <ul>\n                <li><code>Gallons</code></li><li><code>Liters</code></li><li><code>Milliliters</code></li><li><code>Cubic Meters</code></li>\n              </ul>\n            </li>\n            <li>Temperature:\n              <ul>\n                <li><code>Celsius</code></li><li><code>Fahrenheit</code></li><li><code>Kelvin</code></li>\n              </ul>\n            </li>\n            <li>Other:\n              <ul>\n                <li><code>Hours</code></li><li><code>Cycles</code></li><li><code>PSI</code></li><li><code>Kilograms</code></li><li><code>Grams</code></li><li><code>dBm</code></li><li><code>Nm</code></li>\n              </ul>\n            </li>\n            <li>Velocity:\n              <ul>\n                <li><code>MetersPerSecond</code></li><li><code>InchesPerSecond</code></li><li><code>MillimetersPerSecond</code></li>\n              </ul>\n            </li>\n            <li>Acceleration:\n              <ul>\n                <li><code>G-Force</code></li><li><code>MetersPerSecondSquared</code></li><li><code>FeetPerSecondSquared</code></li>\n              </ul>\n            </li>\n            <li>Electrical:\n              <ul>\n                <li><code>Volts</code></li><li><code>Amps</code></li>\n              </ul>\n            </li>\n      </ul>\n    ","example":"Celsius"},"measurementType":{"type":"string","default":"MANUAL","enum":["MANUAL","IOT_DEVICE","AUTOMATED_SENSOR"],"example":"AUTOMATED_SENSOR","description":"Represents the Type of meter. <br><br><code>Manual</code>: They are made to be used in the MaintainX app and to retain manually entered values and are limited to 10 distinct readings creation requests per 24 hours over REST API. Batched readings requests only count as one toward the rate limit. <br><br><code>Automated</code>: (Enterprise Plan) Automated meters store high frequency readings sent from integrations and have normal rate limiting. <br><br>~~<code>IoT Device</code>~~: IoT Device meters are deprecated and should no longer be used in the future. Creating an IoT Device meter will mimic automated meters in terms of behavior to avoid breaking changes."},"asset":{"type":"object","required":["id","name","description","parentId","criticalityId","locationId","serialNumber","createdAt","updatedAt","creatorId"],"description":"Asset linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"},"name":{"type":"string","example":"Forklift"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the asset creator"}},"nullable":true},"location":{"type":"object","required":["id","name"],"description":"Location linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the location"},"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the location was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the location was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"}},"nullable":true},"lastReading":{"type":"object","required":["id","createdAt","meterId","readingDate","value"],"description":"Last reading of a meter (expand with query parameter)","properties":{"id":{"type":"string","example":963,"description":"Global ID of the reading.\nIoT meters will produce IDs with the format '{meterId}-{uuid}', while manual meters will produce numbered IDs."},"meterId":{"type":"number","example":53,"description":"Global ID of the meter."},"createdAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Meter Reading creation/processing date."},"readingDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date at which the meter was read. This date can be set in the past, but cannot be further than 3 days for IoT meters.","nullable":true},"value":{"type":"number","description":"The reading value given by the meter.","example":120}},"nullable":true}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Meters.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Meters.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Meters"]}},"/meters/{id}":{"get":{"summary":"Get meter","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the meter","example":"1"},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","description":"To expand multiple fields: `expand=asset&expand=location`","type":"array","items":{"type":"string","enum":["asset","location","last_reading"]}}}],"responses":{"200":{"description":"Successfully retrieved meter's information","content":{"application/json":{"schema":{"type":"object","required":["meter"],"properties":{"meter":{"type":"object","required":["id","assetId","locationId","creatorId","updaterId","name","uuid","description","measurementType","readingFrequency","unit","createdAt","updatedAt","deletedAt"],"properties":{"id":{"type":"number","description":"Global ID of the meter.","example":123},"assetId":{"type":"integer","description":"Global ID of the asset tied to the meter","example":123,"nullable":true},"locationId":{"type":"integer","description":"Global ID of the location tied to the meter","example":123,"nullable":true},"creatorId":{"type":"integer","description":"Global ID of the user who created the meter","example":123},"updaterId":{"type":"integer","description":"Global ID of the last user who updated the meter","example":123,"nullable":true},"name":{"type":"string","description":"Name of the meters"},"uuid":{"type":"string","description":"Universally unique identifier of the meter in the UUID format","example":"cd6fdffd-c9e2-4a40-9715-a182a6e5b557"},"description":{"nullable":true,"type":"string","description":"Description of the meter","example":"This meter is used for monitoring the temperature of the boiler"},"measurementType":{"type":"string","default":"MANUAL","enum":["MANUAL","IOT_DEVICE","AUTOMATED_SENSOR"],"example":"AUTOMATED_SENSOR","description":"Represents the Type of meter. <br><br><code>Manual</code>: They are made to be used in the MaintainX app and to retain manually entered values and are limited to 10 distinct readings creation requests per 24 hours over REST API. Batched readings requests only count as one toward the rate limit. <br><br><code>Automated</code>: (Enterprise Plan) Automated meters store high frequency readings sent from integrations and have normal rate limiting. <br><br>~~<code>IoT Device</code>~~: IoT Device meters are deprecated and should no longer be used in the future. Creating an IoT Device meter will mimic automated meters in terms of behavior to avoid breaking changes."},"readingFrequency":{"type":"object","nullable":true,"description":"Expected reading frequency of the meter. Mostly useful for manual meters.","example":{"type":"WEEKLY","interval":3,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"anyOf":[{"type":"object","title":"Secondly","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"SECONDLY","enum":["SECONDLY"]},"interval":{"type":"integer","description":"Number of seconds between readings. Minimum 10s for IOT_DEVICE, 86400s for MANUAL","minimum":10,"default":10}}},{"type":"object","title":"Minutly","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"MINUTLY","enum":["MINUTLY"]},"interval":{"type":"integer","description":"Number of minutes between readings","minimum":1,"default":1}}},{"type":"object","title":"Hourly","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"HOURLY","enum":["HOURLY"]},"interval":{"type":"integer","description":"Number of hours between readings","minimum":1,"default":1}}},{"type":"object","title":"Daily","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]},"interval":{"type":"integer","description":"Number of days between readings","minimum":1,"default":1}}},{"type":"object","title":"Weekly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between readings","minimum":1,"maximum":52,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"]}}}},{"type":"object","title":"Monthly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between readings","minimum":1,"maximum":12,"default":1},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month the event will occur"}}},{"type":"object","title":"Yearly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between readings","minimum":1,"maximum":1000,"default":1}}}]},"unit":{"type":"string","description":"Measurement unit for the readings. Any string is accepted. However, if applicable, we recommed you to use the following units as it may carry extra functionality: <br><ul> \n            <li>Distance:\n              <ul>\n                <li><code>Miles</code></li><li><code>Feet</code></li><li><code>Inches</code></li><li><code>Kilometers</code></li><li><code>Meters</code></li><li><code>Centimeters</code></li><li><code>Millimeters</code></li>\n              </ul>\n            </li>\n            <li>Volume:\n              <ul>\n                <li><code>Gallons</code></li><li><code>Liters</code></li><li><code>Milliliters</code></li><li><code>Cubic Meters</code></li>\n              </ul>\n            </li>\n            <li>Temperature:\n              <ul>\n                <li><code>Celsius</code></li><li><code>Fahrenheit</code></li><li><code>Kelvin</code></li>\n              </ul>\n            </li>\n            <li>Other:\n              <ul>\n                <li><code>Hours</code></li><li><code>Cycles</code></li><li><code>PSI</code></li><li><code>Kilograms</code></li><li><code>Grams</code></li><li><code>dBm</code></li><li><code>Nm</code></li>\n              </ul>\n            </li>\n            <li>Velocity:\n              <ul>\n                <li><code>MetersPerSecond</code></li><li><code>InchesPerSecond</code></li><li><code>MillimetersPerSecond</code></li>\n              </ul>\n            </li>\n            <li>Acceleration:\n              <ul>\n                <li><code>G-Force</code></li><li><code>MetersPerSecondSquared</code></li><li><code>FeetPerSecondSquared</code></li>\n              </ul>\n            </li>\n            <li>Electrical:\n              <ul>\n                <li><code>Volts</code></li><li><code>Amps</code></li>\n              </ul>\n            </li>\n      </ul>\n    ","example":"Celsius"},"createdAt":{"type":"string","description":"Meter creation date.","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","description":"Date that Meter was last modified.","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the meter was deleted.","format":"date-time","example":"2022-01-01T00:00:00.000Z"},"asset":{"type":"object","required":["id","name","description","parentId","criticalityId","locationId","serialNumber","createdAt","updatedAt","creatorId"],"description":"Asset linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"},"name":{"type":"string","example":"Forklift"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the asset creator"}},"nullable":true},"location":{"type":"object","required":["id","name"],"description":"Location linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the location"},"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the location was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the location was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"}},"nullable":true},"lastReading":{"type":"object","required":["id","createdAt","meterId","readingDate","value"],"description":"Last reading of a meter (expand with query parameter)","properties":{"id":{"type":"string","example":963,"description":"Global ID of the reading.\nIoT meters will produce IDs with the format '{meterId}-{uuid}', while manual meters will produce numbered IDs."},"meterId":{"type":"number","example":53,"description":"Global ID of the meter."},"createdAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Meter Reading creation/processing date."},"readingDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date at which the meter was read. This date can be set in the past, but cannot be further than 3 days for IoT meters.","nullable":true},"value":{"type":"number","description":"The reading value given by the meter.","example":120}},"nullable":true}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified meter or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Meters"]},"patch":{"summary":"Update meter","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the meter","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Meter to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assetId":{"type":"integer","description":"Global ID of the asset tied to the meter","example":123,"nullable":true},"locationId":{"type":"integer","description":"Global ID of the location tied to the meter","example":123,"nullable":true},"description":{"nullable":true,"type":"string","description":"Description of the meter","example":"This meter is used for monitoring the temperature of the boiler"},"name":{"type":"string","description":"Name of the meters"},"readingFrequency":{"type":"object","nullable":true,"description":"Expected reading frequency of the meter. Mostly useful for manual meters.","example":{"type":"WEEKLY","interval":3,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"anyOf":[{"type":"object","title":"Secondly","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"SECONDLY","enum":["SECONDLY"]},"interval":{"type":"integer","description":"Number of seconds between readings. Minimum 10s for IOT_DEVICE, 86400s for MANUAL","minimum":10,"default":10}}},{"type":"object","title":"Minutly","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"MINUTLY","enum":["MINUTLY"]},"interval":{"type":"integer","description":"Number of minutes between readings","minimum":1,"default":1}}},{"type":"object","title":"Hourly","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"HOURLY","enum":["HOURLY"]},"interval":{"type":"integer","description":"Number of hours between readings","minimum":1,"default":1}}},{"type":"object","title":"Daily","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]},"interval":{"type":"integer","description":"Number of days between readings","minimum":1,"default":1}}},{"type":"object","title":"Weekly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between readings","minimum":1,"maximum":52,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"]}}}},{"type":"object","title":"Monthly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between readings","minimum":1,"maximum":12,"default":1},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month the event will occur"}}},{"type":"object","title":"Yearly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between readings","minimum":1,"maximum":1000,"default":1}}}]},"unit":{"type":"string","description":"Measurement unit for the readings. Any string is accepted. However, if applicable, we recommed you to use the following units as it may carry extra functionality: <br><ul> \n            <li>Distance:\n              <ul>\n                <li><code>Miles</code></li><li><code>Feet</code></li><li><code>Inches</code></li><li><code>Kilometers</code></li><li><code>Meters</code></li><li><code>Centimeters</code></li><li><code>Millimeters</code></li>\n              </ul>\n            </li>\n            <li>Volume:\n              <ul>\n                <li><code>Gallons</code></li><li><code>Liters</code></li><li><code>Milliliters</code></li><li><code>Cubic Meters</code></li>\n              </ul>\n            </li>\n            <li>Temperature:\n              <ul>\n                <li><code>Celsius</code></li><li><code>Fahrenheit</code></li><li><code>Kelvin</code></li>\n              </ul>\n            </li>\n            <li>Other:\n              <ul>\n                <li><code>Hours</code></li><li><code>Cycles</code></li><li><code>PSI</code></li><li><code>Kilograms</code></li><li><code>Grams</code></li><li><code>dBm</code></li><li><code>Nm</code></li>\n              </ul>\n            </li>\n            <li>Velocity:\n              <ul>\n                <li><code>MetersPerSecond</code></li><li><code>InchesPerSecond</code></li><li><code>MillimetersPerSecond</code></li>\n              </ul>\n            </li>\n            <li>Acceleration:\n              <ul>\n                <li><code>G-Force</code></li><li><code>MetersPerSecondSquared</code></li><li><code>FeetPerSecondSquared</code></li>\n              </ul>\n            </li>\n            <li>Electrical:\n              <ul>\n                <li><code>Volts</code></li><li><code>Amps</code></li>\n              </ul>\n            </li>\n      </ul>\n    ","example":"Celsius"}}}}}},"responses":{"200":{"description":"Successfully edited meter","content":{"application/json":{"schema":{"type":"object","required":["meter"],"properties":{"meter":{"type":"object","required":["id","name"],"properties":{"id":{"type":"number","description":"Global ID of the meter.","example":123},"assetId":{"type":"integer","description":"Global ID of the asset tied to the meter","example":123,"nullable":true},"locationId":{"type":"integer","description":"Global ID of the location tied to the meter","example":123,"nullable":true},"creatorId":{"type":"integer","description":"Global ID of the user who created the meter","example":123},"updaterId":{"type":"integer","description":"Global ID of the last user who updated the meter","example":123,"nullable":true},"name":{"type":"string","description":"Name of the meters"},"uuid":{"type":"string","description":"Universally unique identifier of the meter in the UUID format","example":"cd6fdffd-c9e2-4a40-9715-a182a6e5b557"},"description":{"nullable":true,"type":"string","description":"Description of the meter","example":"This meter is used for monitoring the temperature of the boiler"},"measurementType":{"type":"string","default":"MANUAL","enum":["MANUAL","IOT_DEVICE","AUTOMATED_SENSOR"],"example":"AUTOMATED_SENSOR","description":"Represents the Type of meter. <br><br><code>Manual</code>: They are made to be used in the MaintainX app and to retain manually entered values and are limited to 10 distinct readings creation requests per 24 hours over REST API. Batched readings requests only count as one toward the rate limit. <br><br><code>Automated</code>: (Enterprise Plan) Automated meters store high frequency readings sent from integrations and have normal rate limiting. <br><br>~~<code>IoT Device</code>~~: IoT Device meters are deprecated and should no longer be used in the future. Creating an IoT Device meter will mimic automated meters in terms of behavior to avoid breaking changes."},"readingFrequency":{"type":"object","nullable":true,"description":"Expected reading frequency of the meter. Mostly useful for manual meters.","example":{"type":"WEEKLY","interval":3,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"anyOf":[{"type":"object","title":"Secondly","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"SECONDLY","enum":["SECONDLY"]},"interval":{"type":"integer","description":"Number of seconds between readings. Minimum 10s for IOT_DEVICE, 86400s for MANUAL","minimum":10,"default":10}}},{"type":"object","title":"Minutly","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"MINUTLY","enum":["MINUTLY"]},"interval":{"type":"integer","description":"Number of minutes between readings","minimum":1,"default":1}}},{"type":"object","title":"Hourly","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"HOURLY","enum":["HOURLY"]},"interval":{"type":"integer","description":"Number of hours between readings","minimum":1,"default":1}}},{"type":"object","title":"Daily","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]},"interval":{"type":"integer","description":"Number of days between readings","minimum":1,"default":1}}},{"type":"object","title":"Weekly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between readings","minimum":1,"maximum":52,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"]}}}},{"type":"object","title":"Monthly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between readings","minimum":1,"maximum":12,"default":1},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month the event will occur"}}},{"type":"object","title":"Yearly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between readings","minimum":1,"maximum":1000,"default":1}}}]},"unit":{"type":"string","description":"Measurement unit for the readings. Any string is accepted. However, if applicable, we recommed you to use the following units as it may carry extra functionality: <br><ul> \n            <li>Distance:\n              <ul>\n                <li><code>Miles</code></li><li><code>Feet</code></li><li><code>Inches</code></li><li><code>Kilometers</code></li><li><code>Meters</code></li><li><code>Centimeters</code></li><li><code>Millimeters</code></li>\n              </ul>\n            </li>\n            <li>Volume:\n              <ul>\n                <li><code>Gallons</code></li><li><code>Liters</code></li><li><code>Milliliters</code></li><li><code>Cubic Meters</code></li>\n              </ul>\n            </li>\n            <li>Temperature:\n              <ul>\n                <li><code>Celsius</code></li><li><code>Fahrenheit</code></li><li><code>Kelvin</code></li>\n              </ul>\n            </li>\n            <li>Other:\n              <ul>\n                <li><code>Hours</code></li><li><code>Cycles</code></li><li><code>PSI</code></li><li><code>Kilograms</code></li><li><code>Grams</code></li><li><code>dBm</code></li><li><code>Nm</code></li>\n              </ul>\n            </li>\n            <li>Velocity:\n              <ul>\n                <li><code>MetersPerSecond</code></li><li><code>InchesPerSecond</code></li><li><code>MillimetersPerSecond</code></li>\n              </ul>\n            </li>\n            <li>Acceleration:\n              <ul>\n                <li><code>G-Force</code></li><li><code>MetersPerSecondSquared</code></li><li><code>FeetPerSecondSquared</code></li>\n              </ul>\n            </li>\n            <li>Electrical:\n              <ul>\n                <li><code>Volts</code></li><li><code>Amps</code></li>\n              </ul>\n            </li>\n      </ul>\n    ","example":"Celsius"},"createdAt":{"type":"string","description":"Meter creation date.","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","description":"Date that Meter was last modified.","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the meter was deleted.","format":"date-time","example":"2022-01-01T00:00:00.000Z"}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified location.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"location Not Found"}}}}}}},"tags":["Meters"]},"delete":{"summary":"Delete meter","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the meter","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the meter"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified meter.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"meter Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Meters"]}},"/meters/{meterId}/readings":{"post":{"summary":"Create new meter reading","description":"We strongly recommend using the batch create endpoint [POST /meterreadings](#tag/Meter-Readings/paths/~1meterreadings/post) to create meter readings since it is more efficient and allows you to send more readings at once without consuming as much rate limit as this endpoint.\n      <h3>Rate Limits</h3>\n      <li>For Automated and IoT meter readings: 1 request / 10 seconds</li>\n      <li>For Manual meter readings: 10 requests / 24 hours</li>\n      ","deprecated":true,"parameters":[{"schema":{"type":"integer"},"name":"meterId","in":"path","required":true,"description":"ID of the meter","example":"123"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Meter Reading to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["readingValue"],"properties":{"readingValue":{"type":"number","description":"The reading value given by the meter.","example":120},"readingDate":{"type":"string","example":"2020-07-22T14:01:00Z","description":"Reading date when the meter was read. This date can be set in the past, but cannot go further than 3 days for IoT meters.","nullable":true}}}}}},"responses":{"201":{"description":"Successfully created reading","content":{"application/json":{"schema":{"type":"object","required":["id","readingValue"],"properties":{"id":{"type":"string","example":963,"description":"Global ID of the reading.\nIoT meters will produce IDs with the format '{meterId}-{uuid}', while manual meters will produce numbered IDs."},"createdAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Reading creation or processing date."},"readingDate":{"type":"string","example":"2020-07-22T14:01:00Z","description":"Reading date when the meter was read. This date can be set in the past, but cannot go further than 3 days for IoT meters.","nullable":true},"readingValue":{"type":"number","description":"The reading value given by the meter.","example":120}}}}}},"400":{"description":"Failed to create the reading","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"errors with request"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"429":{"description":"Too many requests. Please retry in 10 seconds","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Too many requests. Please retry in 10 seconds"}}}}}}},"tags":["Meters"]}},"/metertriggers":{"post":{"summary":"Create meter trigger","requestBody":{"description":"The meter trigger to create","required":true,"content":{"application/json":{"schema":{"type":"object","description":"The meter triger data","required":["meterTrigger"],"properties":{"meterTrigger":{"required":["meterId","amount","condition","name"],"type":"object","properties":{"meterId":{"type":"integer"},"workOrderTemplateId":{"type":"integer","description":"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":{"type":"number"},"condition":{"type":"string","enum":["DECREMENTED_BY","INCREMENTED_BY","IS_EQUAL","IS_GREATER","IS_LESS","INCREMENTED_BY_BASED_ON_LAST_READING","DECREMENTED_BY_BASED_ON_LAST_READING"]},"dataPoints":{"type":"object","required":["numerator","denominator"],"properties":{"numerator":{"type":"integer","description":"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":{"type":"integer","description":"The window of points where the condition gets checked"}}},"description":{"type":"string"},"minDateForProcessing":{"type":"string","format":"date-time","description":"Date that the trigger will start to be active"},"name":{"type":"string","description":"Name of the trigger"},"nextTriggerValue":{"type":"number","description":"Can be set to override the first trigger value"},"period":{"type":"integer","description":"Window in seconds where the data points can be checked","nullable":true}}},"workOrderTemplate":{"type":"object","properties":{"procedureTemplateId":{"nullable":true,"type":"integer","description":"ID of the procedure template used"},"saveProcedureAsTemplate":{"type":"boolean","nullable":true,"description":"Save the procedure in data as a new procedure template"},"title":{"deprecated":true,"type":"string","description":"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":{"type":"object","properties":{"assetId":{"nullable":true,"type":"integer"},"assigneeIds":{"type":"array","description":"Users IDs assigned to the template","items":{"type":"number","example":1}},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDate":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["OFFSET"]},"offset":{"type":"number"}}},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order"},"partsUsed":{"type":"array","nullable":true,"items":{"type":"object","properties":{"partId":{"type":"integer","example":963,"description":"Global ID of the part"},"quantityUsed":{"type":"integer","description":"Quantity used in the work order.","example":120},"locationId":{"type":"integer","nullable":true,"description":"Global ID of the location of the part","example":852},"copyOnRecurring":{"type":"string","description":"Indicates if the parts will be copied to the next work order in the chain (if applicable).","default":"Default","enum":["NoCopy","Copy","Default"]}}}},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"procedure":{"type":"object","nullable":true,"required":["title","fields"],"properties":{"id":{"type":"number","example":1234,"deprecated":true,"description":"You should favor 'procedureTemplateId' to attach a procedure template."},"title":{"type":"string","description":"Title of the procedure","example":"Control dashboard audit"},"fields":{"type":"array","items":{"type":"object","required":["type","label"],"properties":{"label":{"type":"string","example":"Metal Parts: broken, loose, dented, rusty, missing"},"type":{"type":"string","example":"INSPECTION_CHECK","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"]},"description":{"type":"string","nullable":true},"choices":{"type":"array","items":{"example":"Partially","type":"string"}},"urls":{"type":"array","items":{"type":"object","required":["link"],"properties":{"label":{"type":"string","description":"Label of the url","example":"MaintainX Website"},"link":{"type":"string","description":"Link","example":"www.getmaintainx.com"}}}},"meterId":{"type":"number","example":1,"nullable":true,"description":"Id of the meter"},"isDateAndTime":{"type":"boolean","default":false,"description":"Indicate if a DATE field also contains the time","example":false},"index":{"type":"number","example":1,"description":"Order which the row is displayed"}}},"description":"Steps of a procedure"}}},"tagsIds":{"type":"array","description":"Categories IDs","items":{"type":"number","example":1}},"teamIds":{"type":"array","description":"Teams IDs","items":{"type":"number","example":1}},"title":{"type":"string","deprecated":true,"description":"Use the `title` field at the root level. If both `title` and `data.title` are provided, `title` will be used."},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}}}}}}}}}}},"responses":{"201":{"description":"Successfully created the meter trigger","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number","example":1,"description":"Id of the meter trigger"}}}}}},"400":{"description":"Failed to create the meter trigger","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Unexpected error"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Meter Triggers"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]},"get":{"summary":"List meter triggers","description":"Endpoint used to list meter trigger resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Meter Triggers returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"meters","schema":{"type":"array","title":"meter ID filters","description":"To filter by multiple meter IDs: `meters=630&meters=634`","items":{"type":"integer"}},"in":"query"},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Meter Triggers list","content":{"application/json":{"schema":{"type":"object","required":["meterTriggers","nextCursor","nextPageUrl"],"properties":{"meterTriggers":{"type":"array","items":{"type":"object","required":["id","name","meterId"],"properties":{"id":{"type":"number","example":963,"description":"Global ID of the trigger."},"name":{"type":"string","example":"Thermometer #4"},"meterId":{"type":"number","example":53,"description":"Global ID of the meter."}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Meter Triggers.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Meter Triggers.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Meter Triggers"]}},"/metertriggers/{id}":{"get":{"summary":"Get meter trigger","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the meterTrigger","example":"1"},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","type":"array","items":{"type":"string","enum":["work_order_template"]}}}],"responses":{"200":{"description":"Successfully retrieved meterTrigger's information","content":{"application/json":{"schema":{"type":"object","required":["meterTrigger"],"properties":{"meterTrigger":{"type":"object","required":["id","meterId","organizationId","amount","condition","createdAt","creatorId","dataPoints","deletedAt","description","minDateForProcessing","name","nextTriggerValue","period","state","updatedAt","workOrderTemplateId"],"properties":{"id":{"type":"integer","description":"Global ID of the meter trigger"},"meterId":{"type":"integer","description":"Global ID of the meter"},"organizationId":{"type":"integer","description":"Global ID of the organization"},"amount":{"type":"number","description":"Value used to trigger the condition"},"condition":{"type":"string","description":"Condition of the trigger","enum":["DECREMENTED_BY","INCREMENTED_BY","IS_EQUAL","IS_GREATER","IS_LESS","INCREMENTED_BY_BASED_ON_LAST_READING","DECREMENTED_BY_BASED_ON_LAST_READING"]},"createdAt":{"type":"string","description":"Date at which the meter was created","format":"date-time"},"creatorId":{"type":"integer","description":"Global ID of the meter trigger's creator"},"dataPoints":{"type":"object","nullable":true,"properties":{"numerator":{"type":"integer","description":"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":{"type":"integer","description":"The window of points where the condition gets checked"}}},"deletedAt":{"type":"string","nullable":true,"description":"Data at which the meter was delated","format":"date-time"},"description":{"type":"string","nullable":true},"minDateForProcessing":{"type":"string","format":"date-time","description":"Date that the trigger will start to be active","nullable":true},"name":{"type":"string","description":"Name of the trigger"},"nextTriggerValue":{"type":"number","description":"Can be set to override the first trigger value","nullable":true},"period":{"type":"integer","description":"Window in seconds where the data points can be checked","nullable":true},"state":{"type":"string","description":"State of the trigger","enum":["INACTIVE","INSUFFICIENT_DATA","PENDING","STABLE","TRIGGERED"]},"updatedAt":{"type":"string","description":"Date at which the meter was updated","format":"date-time"},"workOrderTemplateId":{"type":"integer","description":"Global ID of the work order template used by the meter trigger","nullable":true},"workOrderTemplate":{"type":"object","description":"Work Order template used by the meter trigger (expand with query parameter)","properties":{"id":{"type":"integer","description":"Global ID of the work order template"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the work order template was created","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"nullable":true,"type":"integer","description":"ID of the user who created the work order"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Time at which the template was deleted","example":"2022-01-01T00:00:00.000Z"},"organizationId":{"nullable":true,"type":"integer","description":"ID of the organization"},"procedureTemplateId":{"nullable":true,"type":"integer","description":"ID of the procedure template used if in the library"},"title":{"type":"string","deprecated":true,"description":"Title of the work order that will be generated. Use the meter trigger's name instead"},"updatedAt":{"nullable":true,"type":"string","format":"date-time","description":"Time at which the template was updated","example":"2022-01-01T00:00:00.000Z"},"data":{"type":"object","properties":{"assetId":{"nullable":true,"type":"integer","description":"Global ID of the asset assigned to the work order"},"assigneeIds":{"type":"array","description":"Users IDs assigned to the template","items":{"type":"number","example":1}},"attachmentIds":{"nullable":true,"type":"array","items":{"type":"number","example":1},"description":"IDs of the attachments on the template"},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDate":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["OFFSET"]},"offset":{"type":"number"}}},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order"},"partsUsed":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the part"},"name":{"type":"string","example":"Locknut - 1/8"},"description":{"type":"string","nullable":true,"example":""},"area":{"type":"string","example":"tool room","nullable":true},"unitCost":{"type":"integer","nullable":true,"description":"Cost in cents. For example, for $1.20, put 120.","example":120},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"quantityUsed":{"type":"integer","description":"Quantity used in the work order.","example":120},"copyOnRecurring":{"type":"string","description":"Indicates if the parts will be copied to the next work order in the chain (if applicable).","default":"Default","enum":["NoCopy","Copy","Default"]},"locationId":{"type":"number","description":"Global ID of the location of the part","nullable":true,"example":852},"extraFields":{"type":"object","description":"Work Order-scoped custom fields for this Part on this specific Work Order. These are distinct from Part-level custom fields (see `partExtraFields`).","additionalProperties":{"type":"string"}}}}},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"procedure":{"type":"object","nullable":true,"required":["title","fields"],"properties":{"title":{"example":"Control dashboard audit","type":"string"},"fields":{"type":"array","items":{"type":"object","required":["id","label","type"],"properties":{"id":{"type":"number","example":1},"label":{"type":"string","example":"Metal Parts: broken, loose, dented, rusty, missing"},"type":{"type":"string","example":"INSPECTION_CHECK","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"]},"description":{"type":"string","nullable":true},"choices":{"type":"array","nullable":true,"items":{"example":"Partially","type":"string"}},"meterId":{"type":"number","nullable":true,"items":{"example":1,"type":"number"}},"isDateAndTime":{"type":"boolean","nullable":true,"description":"Indicate if a DATE field also contains the time","example":false},"attachmentId":{"type":"number","nullable":true,"example":1},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the procedure row","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"urls":{"type":"array","items":{"type":"object","required":["link"],"properties":{"label":{"type":"string","description":"Label of the url","example":"MaintainX Website"},"link":{"type":"string","description":"Link","example":"www.getmaintainx.com"}}}}}}}}},"tagsIds":{"type":"array","description":"Categories IDs","items":{"type":"number","example":1}},"teamIds":{"type":"array","description":"Teams IDs","items":{"type":"number","example":1}},"thumbnailId":{"nullable":true,"type":"integer","description":"ID of the attachment used as thumbnail"},"title":{"type":"string","deprecated":true,"description":"Use the `title` field outside of the data object instead"},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}}}}},"nullable":true}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified meterTrigger or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Meter Triggers"]},"patch":{"summary":"Update meter trigger","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the work order template","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"The meter trigger to update","required":true,"content":{"application/json":{"schema":{"type":"object","description":"The meter trigger update data","properties":{"meterTrigger":{"type":"object","properties":{"meterId":{"type":"integer"},"workOrderTemplateId":{"type":"integer","description":"Id of an existing work order template. NOTE: If this changes, the name of the meter trigger will also changed to match the name of the linked work order template."},"amount":{"type":"number"},"condition":{"type":"string","enum":["DECREMENTED_BY","INCREMENTED_BY","IS_EQUAL","IS_GREATER","IS_LESS","INCREMENTED_BY_BASED_ON_LAST_READING","DECREMENTED_BY_BASED_ON_LAST_READING"]},"dataPoints":{"type":"object","required":["numerator","denominator"],"properties":{"numerator":{"type":"integer","description":"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":{"type":"integer","description":"The window of points where the condition gets checked"}}},"description":{"type":"string"},"minDateForProcessing":{"type":"string","format":"date-time","description":"Date that the trigger will start to be active"},"name":{"type":"string","description":"Name of the trigger"},"nextTriggerValue":{"type":"number","description":"Can be set to override the first trigger value"},"period":{"type":"integer","description":"Window in seconds where the data points can be checked","nullable":true}}}}}}}},"responses":{"204":{"description":"Successfully updated the meter trigger"},"400":{"description":"Failed to create the meter trigger","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Unexpected error"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified meter trigger.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"meter trigger Not Found"}}}}}}},"tags":["Meter Triggers"]},"delete":{"summary":"Delete meterTrigger","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the meterTrigger","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the meterTrigger"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified meterTrigger.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"meterTrigger Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Meter Triggers"]}},"/metertriggers/{id}/thumbnail/{filename}":{"put":{"summary":"Update meter trigger's work order template's thumbnail","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the meter trigger's work order template.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the meter trigger's work order template thumbnail, including the extension.","example":"motor.png"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the thumbnail.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated meter trigger's work order template's thumbnail.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"You cannot edit this entity.","fieldPath":"organizationId","fieldValue":"1"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Meter Trigger's Work Order Template.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Meter Trigger's Work Order Template Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Meter Triggers"]}},"/metertriggers/{id}/workordertemplates":{"patch":{"summary":"Update Meter Trigger's Work Order Template","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the work order template","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Data to update a work order template","content":{"application/json":{"schema":{"type":"object","properties":{"procedureTemplateId":{"nullable":true,"type":"integer","description":"ID of the procedure template used"},"saveProcedureAsTemplate":{"type":"boolean","nullable":true,"description":"Save the procedure in data as a new procedure template"},"title":{"type":"string","description":"Title of the work order that will be generated. Same string for meter trigger's name. Setting this will also set the corresponding meter's trigger name."},"data":{"type":"object","properties":{"assetId":{"nullable":true,"type":"integer"},"assigneeIds":{"type":"array","description":"Users IDs assigned to the template","items":{"type":"number","example":1}},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDate":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["OFFSET"]},"offset":{"type":"number"}}},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order"},"partsUsed":{"type":"array","nullable":true,"items":{"type":"object","properties":{"partId":{"type":"integer","example":963,"description":"Global ID of the part"},"quantityUsed":{"type":"integer","description":"Quantity used in the work order.","example":120},"locationId":{"type":"integer","nullable":true,"description":"Global ID of the location of the part","example":852},"copyOnRecurring":{"type":"string","description":"Indicates if the parts will be copied to the next work order in the chain (if applicable).","default":"Default","enum":["NoCopy","Copy","Default"]}}}},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"procedure":{"type":"object","nullable":true,"required":["title","fields"],"properties":{"id":{"type":"number","example":1234,"deprecated":true,"description":"You should favor 'procedureTemplateId' to attach a procedure template."},"title":{"type":"string","description":"Title of the procedure","example":"Control dashboard audit"},"fields":{"type":"array","items":{"type":"object","required":["type","label"],"properties":{"label":{"type":"string","example":"Metal Parts: broken, loose, dented, rusty, missing"},"type":{"type":"string","example":"INSPECTION_CHECK","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"]},"description":{"type":"string","nullable":true},"choices":{"type":"array","items":{"example":"Partially","type":"string"}},"urls":{"type":"array","items":{"type":"object","required":["link"],"properties":{"label":{"type":"string","description":"Label of the url","example":"MaintainX Website"},"link":{"type":"string","description":"Link","example":"www.getmaintainx.com"}}}},"meterId":{"type":"number","example":1,"nullable":true,"description":"Id of the meter"},"isDateAndTime":{"type":"boolean","default":false,"description":"Indicate if a DATE field also contains the time","example":false},"index":{"type":"number","example":1,"description":"Order which the row is displayed"}}},"description":"Steps of a procedure"}}},"tagsIds":{"type":"array","description":"Categories IDs","items":{"type":"number","example":1}},"teamIds":{"type":"array","description":"Teams IDs","items":{"type":"number","example":1}},"title":{"type":"string","deprecated":true,"description":"Use the `title` field at the root level. If both `title` and `data.title` are provided, `title` will be used."},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}}}}}}}}},"responses":{"204":{"description":"Successfully edited the procedure template"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Bad request"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified work order template.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"work order template Not Found"}}}}}}},"tags":["Meter Triggers"]}},"/metertriggers/{id}/workordertemplates/attachments/{filename}":{"put":{"summary":"Update meter trigger's work order template attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the meter trigger's work order template.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"datasheet.pdf"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the attachment.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"application/x-indesign":{"schema":{"type":"object","format":"binary"}},"application/epub+zip":{"schema":{"type":"object","format":"binary"}},"application/x-xpinstall":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"schema":{"type":"object","format":"binary"}},"application/zip":{"schema":{"type":"object","format":"binary"}},"application/x-tar":{"schema":{"type":"object","format":"binary"}},"application/x-rar-compressed":{"schema":{"type":"object","format":"binary"}},"application/gzip":{"schema":{"type":"object","format":"binary"}},"application/x-bzip2":{"schema":{"type":"object","format":"binary"}},"application/x-7z-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-apple-diskimage":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.arrow.file":{"schema":{"type":"object","format":"binary"}},"video/mp4":{"schema":{"type":"object","format":"binary"}},"audio/midi":{"schema":{"type":"object","format":"binary"}},"video/matroska":{"schema":{"type":"object","format":"binary"}},"video/webm":{"schema":{"type":"object","format":"binary"}},"video/quicktime":{"schema":{"type":"object","format":"binary"}},"video/vnd.avi":{"schema":{"type":"object","format":"binary"}},"audio/wav":{"schema":{"type":"object","format":"binary"}},"audio/qcelp":{"schema":{"type":"object","format":"binary"}},"audio/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"video/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-asf":{"schema":{"type":"object","format":"binary"}},"video/mpeg":{"schema":{"type":"object","format":"binary"}},"video/3gpp":{"schema":{"type":"object","format":"binary"}},"audio/mpeg":{"schema":{"type":"object","format":"binary"}},"audio/mp4":{"schema":{"type":"object","format":"binary"}},"video/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg; codecs=opus":{"schema":{"type":"object","format":"binary"}},"application/ogg":{"schema":{"type":"object","format":"binary"}},"audio/flac":{"schema":{"type":"object","format":"binary"}},"audio/ape":{"schema":{"type":"object","format":"binary"}},"audio/wavpack":{"schema":{"type":"object","format":"binary"}},"audio/amr":{"schema":{"type":"object","format":"binary"}},"application/pdf":{"schema":{"type":"object","format":"binary"}},"application/x-elf":{"schema":{"type":"object","format":"binary"}},"application/x-mach-binary":{"schema":{"type":"object","format":"binary"}},"application/x-msdownload":{"schema":{"type":"object","format":"binary"}},"application/x-shockwave-flash":{"schema":{"type":"object","format":"binary"}},"application/rtf":{"schema":{"type":"object","format":"binary"}},"application/wasm":{"schema":{"type":"object","format":"binary"}},"font/woff":{"schema":{"type":"object","format":"binary"}},"font/woff2":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-fontobject":{"schema":{"type":"object","format":"binary"}},"font/ttf":{"schema":{"type":"object","format":"binary"}},"font/otf":{"schema":{"type":"object","format":"binary"}},"font/collection":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"video/x-flv":{"schema":{"type":"object","format":"binary"}},"application/postscript":{"schema":{"type":"object","format":"binary"}},"application/eps":{"schema":{"type":"object","format":"binary"}},"application/x-xz":{"schema":{"type":"object","format":"binary"}},"application/x-sqlite3":{"schema":{"type":"object","format":"binary"}},"application/x-nintendo-nes-rom":{"schema":{"type":"object","format":"binary"}},"application/x-google-chrome-extension":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-cab-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-deb":{"schema":{"type":"object","format":"binary"}},"application/x-unix-archive":{"schema":{"type":"object","format":"binary"}},"application/x-rpm":{"schema":{"type":"object","format":"binary"}},"application/x-compress":{"schema":{"type":"object","format":"binary"}},"application/lzip":{"schema":{"type":"object","format":"binary"}},"application/x-cfb":{"schema":{"type":"object","format":"binary"}},"application/x-mie":{"schema":{"type":"object","format":"binary"}},"application/mxf":{"schema":{"type":"object","format":"binary"}},"video/mp2t":{"schema":{"type":"object","format":"binary"}},"application/x-blender":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"audio/aiff":{"schema":{"type":"object","format":"binary"}},"application/xml":{"schema":{"type":"object","format":"binary"}},"application/x-mobipocket-ebook":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"application/dicom":{"schema":{"type":"object","format":"binary"}},"audio/x-musepack":{"schema":{"type":"object","format":"binary"}},"text/calendar":{"schema":{"type":"object","format":"binary"}},"text/vcard":{"schema":{"type":"object","format":"binary"}},"text/vtt":{"schema":{"type":"object","format":"binary"}},"model/gltf-binary":{"schema":{"type":"object","format":"binary"}},"application/vnd.tcpdump.pcap":{"schema":{"type":"object","format":"binary"}},"audio/x-dsf":{"schema":{"type":"object","format":"binary"}},"application/x-ms-shortcut":{"schema":{"type":"object","format":"binary"}},"application/x-ft-apple.alias":{"schema":{"type":"object","format":"binary"}},"audio/x-voc":{"schema":{"type":"object","format":"binary"}},"audio/vnd.dolby.dd-raw":{"schema":{"type":"object","format":"binary"}},"audio/x-m4a":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"video/x-m4v":{"schema":{"type":"object","format":"binary"}},"video/3gpp2":{"schema":{"type":"object","format":"binary"}},"application/x-esri-shape":{"schema":{"type":"object","format":"binary"}},"audio/aac":{"schema":{"type":"object","format":"binary"}},"audio/x-it":{"schema":{"type":"object","format":"binary"}},"audio/x-s3m":{"schema":{"type":"object","format":"binary"}},"audio/x-xm":{"schema":{"type":"object","format":"binary"}},"video/mp1s":{"schema":{"type":"object","format":"binary"}},"video/mp2p":{"schema":{"type":"object","format":"binary"}},"application/vnd.sketchup.skp":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"application/x-lzh-compressed":{"schema":{"type":"object","format":"binary"}},"application/pgp-encrypted":{"schema":{"type":"object","format":"binary"}},"application/x-asar":{"schema":{"type":"object","format":"binary"}},"model/stl":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-htmlhelp":{"schema":{"type":"object","format":"binary"}},"model/3mf":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"application/zstd":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-outlook":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.parquet":{"schema":{"type":"object","format":"binary"}},"application/java-vm":{"schema":{"type":"object","format":"binary"}},"application/x-arj":{"schema":{"type":"object","format":"binary"}},"application/x-cpio":{"schema":{"type":"object","format":"binary"}},"application/x-ace-compressed":{"schema":{"type":"object","format":"binary"}},"application/avro":{"schema":{"type":"object","format":"binary"}},"application/vnd.iccprofile":{"schema":{"type":"object","format":"binary"}},"application/x-ft-fbx":{"schema":{"type":"object","format":"binary"}},"application/vnd.visio":{"schema":{"type":"object","format":"binary"}},"application/vnd.android.package-archive":{"schema":{"type":"object","format":"binary"}},"application/x-ft-draco":{"schema":{"type":"object","format":"binary"}},"application/x-lz4":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.sheet.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.document.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/java-archive":{"schema":{"type":"object","format":"binary"}},"application/vnd.rn-realmedia":{"schema":{"type":"object","format":"binary"}},"application/x-spss-sav":{"schema":{"type":"object","format":"binary"}},"application/x-ms-regedit":{"schema":{"type":"object","format":"binary"}},"application/x-ft-windows-registry-hive":{"schema":{"type":"object","format":"binary"}},"application/x-jmp-data":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.keynote":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.numbers":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.pages":{"schema":{"type":"object","format":"binary"}},"application/x-apache-arrow":{"schema":{"type":"object","format":"binary"}},"application/x-lzip":{"schema":{"type":"object","format":"binary"}},"application/x.apple.alias":{"schema":{"type":"object","format":"binary"}},"application/x.ms.shortcut":{"schema":{"type":"object","format":"binary"}},"audio/opus":{"schema":{"type":"object","format":"binary"}},"audio/vnd.wave":{"schema":{"type":"object","format":"binary"}},"audio/x-flac":{"schema":{"type":"object","format":"binary"}},"video/x-matroska":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated meter trigger's work order template's attachment.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified meter trigger's work order template.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"meter trigger's work order template Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Meter Triggers"]},"delete":{"summary":"Remove meter trigger's work order template attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the meter trigger's work order template.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"attachment.xls"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully removed meter trigger's work order template's attachment."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Attachment.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment Not Found"}}}}}}},"tags":["Meter Triggers"]}},"/manufacturers":{"get":{"summary":"List manufacturers","description":"Endpoint used to list manufacturer resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Manufacturers returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"},{"schema":{"type":"string"},"description":"Required if using a multi organizations token and doing an operation on resources from multiple organizations. This is mutually exclusive with the x-organization-id header (use one or the other).","name":"x-organization-ids","in":"header","required":false,"example":"1,2,3"}],"responses":{"200":{"description":"Successfully fetched Manufacturers list","content":{"application/json":{"schema":{"type":"object","required":["manufacturers","nextCursor","nextPageUrl"],"properties":{"manufacturers":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Unique ID of the manufacturer."},"name":{"type":"string","example":"ACME Corporation","description":"Manufacturer name."},"organizationId":{"type":"integer","example":1,"description":"ID of the organization that owns this resource"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Manufacturers.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Manufacturers.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Manufacturer REST API list is currently disabled","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Manufacturer REST API list is currently disabled."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}}},"tags":["Manufacturers"]},"post":{"summary":"Create new manufacturer","requestBody":{"description":"Manufacturer to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"ACME Corporation","description":"Manufacturer name."}}}}}},"responses":{"201":{"description":"Successfully created manufacturer","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":963,"description":"Unique ID of the manufacturer."}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Manufacturer REST API creation is currently disabled","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Manufacturer REST API creation is currently disabled."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Manufacturers"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]}},"/manufacturers/{id}":{"get":{"summary":"Get manufacturer","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the manufacturer","example":"1"},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully retrieved manufacturer's information","content":{"application/json":{"schema":{"type":"object","required":["manufacturer"],"properties":{"manufacturer":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Unique ID of the manufacturer."},"name":{"type":"string","example":"ACME Corporation","description":"Manufacturer name."}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Manufacturer REST API get is currently disabled","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Manufacturer REST API get is currently disabled."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified manufacturer.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"manufacturer Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Manufacturers"]}},"/models":{"get":{"summary":"List models","description":"Endpoint used to list model resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Models returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"},{"schema":{"type":"string"},"description":"Required if using a multi organizations token and doing an operation on resources from multiple organizations. This is mutually exclusive with the x-organization-id header (use one or the other).","name":"x-organization-ids","in":"header","required":false,"example":"1,2,3"}],"responses":{"200":{"description":"Successfully fetched Models list","content":{"application/json":{"schema":{"type":"object","required":["models","nextCursor","nextPageUrl"],"properties":{"models":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Unique ID of the manufacturer model."},"name":{"type":"string","example":"D10","description":"Model name."},"manufacturerId":{"type":"integer","nullable":true,"example":123,"description":"Manufacturer ID the model belongs to."},"organizationId":{"type":"integer","example":1,"description":"ID of the organization that owns this resource"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Models.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Models.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Model REST API list is currently disabled","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Model REST API list is currently disabled."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}}},"tags":["Manufacturers"]},"post":{"summary":"Create new model","requestBody":{"description":"Manufacturer model to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","manufacturerId"],"properties":{"name":{"type":"string","example":"D10","description":"Model name."},"manufacturerId":{"type":"integer","example":123,"description":"Manufacturer ID the model belongs to."}}}}}},"responses":{"201":{"description":"Successfully created manufacturer model","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":963,"description":"Unique ID of the manufacturer model."}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Manufacturer model REST API creation is currently disabled","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Manufacturer model REST API creation is currently disabled."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified manufacturer.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"manufacturer Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Manufacturers"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]}},"/models/{id}":{"get":{"summary":"Get model","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the model","example":"1"},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully retrieved model information","content":{"application/json":{"schema":{"type":"object","required":["model"],"properties":{"model":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Unique ID of the manufacturer model."},"name":{"type":"string","example":"D10","description":"Model name."},"manufacturerId":{"type":"integer","nullable":true,"example":123,"description":"Manufacturer ID the model belongs to."}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Model REST API get is currently disabled","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Model REST API get is currently disabled."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified model.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"model Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Manufacturers"]}},"/organizations":{"get":{"summary":"List organizations","description":"Endpoint used to list organization resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Organizations returned","type":"integer","minimum":1,"maximum":200,"default":100}}],"responses":{"200":{"description":"Successfully fetched Organizations list","content":{"application/json":{"schema":{"type":"object","required":["organizations","nextCursor","nextPageUrl"],"properties":{"organizations":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":15,"description":"Global ID of the organization"},"name":{"type":"string","example":"My Organization","description":"Name of the organization"},"timeZone":{"type":"string","description":"Time zone of the organization. default: Etc/UTC","example":"America/New_York"},"imageUrl":{"type":"string","nullable":true,"description":"URL of the organization image","example":"https://example.com/image.png"},"currency":{"type":"string","nullable":true,"description":"Currency of the organization","example":"USD"},"dateFormatLocale":{"type":"string","nullable":true,"description":"Date format locale of the organization","example":"en-CA"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Organizations.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Organizations.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Organizations"]}},"/parts":{"post":{"summary":"Create new part","requestBody":{"description":"Part to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"Locknut - 1/8"},"description":{"type":"string","nullable":true,"example":""},"area":{"type":"string","example":"tool room","nullable":true,"description":"Area of the part. Deprecated: Use new field inside `locations`. Will cause error if both fields are sent.","deprecated":true},"unitCost":{"type":"integer","description":"Cost in cents. For example, for $1.20, put 120.","example":120,"nullable":true},"availableQuantity":{"type":"integer","description":"Total quantity currently in stock. Deprecated: Use new field inside `locations`. Will cause error if both fields are sent.","example":10,"deprecated":true},"minimumQuantity":{"type":"integer","description":"Total minimum quantity before you should restock. Deprecated: Use new field inside `locations`. Will cause error if both fields are sent.","example":5,"deprecated":true},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the part is located. Deprecated: Use new field inside `locations`. Will cause error if both fields are sent.","deprecated":true},"locations":{"type":"array","items":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"integer","example":852,"description":"ID of the location where the part is located"},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5,"nullable":true},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Maximum quantity you want to stock. Must be greater than or equal to minimumQuantity."},"area":{"type":"string","example":"tool room","nullable":true}}},"description":"Detailed list of locations where the part is stored, including properties such as available quantity, minimum quantity, reserved quantity, and area within each location."},"partTypes":{"type":"array","items":{"type":"string"},"description":"List of part types"},"assetIds":{"type":"array","items":{"type":"integer"},"example":[12,4561],"description":"List of asset IDs"},"teamIds":{"type":"array","items":{"type":"integer"},"example":[1,4],"description":"List of team IDs in charge of the part"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"000000000"}},"vendors":{"type":"array","description":"List of vendors of the part","items":{"type":"object","properties":{"vendorId":{"type":"integer","example":"1","description":"Id of the vendor"},"partNumber":{"type":"string","example":"XC230","description":"Part number given to the part by this vendor"}}}},"externalId":{"type":"string","nullable":true,"description":"External ID for this part, unique per organization.","example":"ext-part-001"},"committedQuantities":{"type":"object","description":"Quantities of the part currently committed to work orders, broken down by stage.","properties":{"kitted":{"type":"integer","description":"Quantity of parts that have been kitted for work orders","example":5},"reserved":{"type":"integer","description":"Quantity of parts reserved for work orders","example":3},"staged":{"type":"integer","description":"Quantity of parts that have been staged for work orders","example":2}}},"assignedQuantity":{"type":"integer","description":"Total quantity currently assigned to work orders across all stages.","example":10},"vendorIds":{"type":"array","items":{"type":"integer"},"example":[23,56],"description":"List of vendor IDs. Deprecated: Use the `vendorId` field inside `vendors`.","deprecated":true}}}}}},"responses":{"201":{"description":"Successfully created part","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":123456,"description":"Global ID of the part"}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"409":{"description":"Conflict with existing part","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"conflictingMxId":{"type":"integer"},"isDeleted":{"type":"boolean"}},"required":["error","conflictingMxId","isDeleted"],"example":{"error":"Asset with externalId 'ext-123' already exists in this organization.","conflictingMxId":456,"isDeleted":false}}}}}},"tags":["Parts"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]},"get":{"summary":"List parts","description":"Endpoint used to list part resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Parts returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"partNumber","schema":{"type":"array","description":"Will only show parts that have a vendor with this part number associated to them.","items":{"type":"string"}},"in":"query"},{"name":"updatedAt[gte]","schema":{"type":"string","format":"date-time","description":"Return records whose updatedAt is at or after this ISO 8601 date-time (UTC).","example":"2024-01-01T00:00:00.000Z"},"in":"query"},{"name":"updatedAt[lte]","schema":{"type":"string","format":"date-time","description":"Return records whose updatedAt is at or before this ISO 8601 date-time (UTC).","example":"2024-12-31T23:59:59.999Z"},"in":"query"},{"name":"createdAt[gte]","schema":{"type":"string","format":"date-time","description":"Return records whose createdAt is at or after this ISO 8601 date-time (UTC).","example":"2024-01-01T00:00:00.000Z"},"in":"query"},{"name":"createdAt[lte]","schema":{"type":"string","format":"date-time","description":"Return records whose createdAt is at or before this ISO 8601 date-time (UTC).","example":"2024-12-31T23:59:59.999Z"},"in":"query"},{"name":"customFieldName","schema":{"type":"array","items":{"type":"string"},"description":"Filter parts by custom field value. Your query parameter should be your custom field name. (ie: To filter by a custom field named \"Industry\" with the value \"Construction\", you would do this \"/parts?Industry=Construction\").\n                    <br><br>Adding multiple instance of the same custom field act as an <code>OR</code> and adding a different custom field act as an <code>AND</code>. (ie: To filter by a custom field named <code>Industry</code> with the value <code>Construction</code> OR <code>Transportation</code> AND the custom field <code>Manufacturer</code> with the value <code>ACME</code>, you would do this <code>/parts?Industry=Construction&Industry=Transportation&Manufacturer=ACME</code>).\n                    <br><br>If your custom field label is the same as a reserved query parameter such as <code>limit</code>, <code>sort</code>, <code>expand</code>, etc, you can add <code>__c</code> to your custom field filtering (ie: To filter by a custom field named <code>limit</code> with the value <code>ten</code>, you would do this <code>/parts?limit__c=ten</code>).\n                    <br><br>Note that your custom field needs to be created beforehand. Only number and single line text custom field types are supported."},"in":"query"},{"in":"query","name":"sort","schema":{"description":"Attribute on which to sort the list. (for descending order, prefix attribute with '-'). ","type":"string","enum":["id","createdAt","updatedAt","-id","-createdAt","-updatedAt"]}},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","description":"To expand multiple fields: `expand=extra_fields&expand=vendors`","type":"array","items":{"type":"string","enum":["extra_fields","vendors","asset_ids"]}}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"},{"schema":{"type":"string"},"description":"Required if using a multi organizations token and doing an operation on resources from multiple organizations. This is mutually exclusive with the x-organization-id header (use one or the other).","name":"x-organization-ids","in":"header","required":false,"example":"1,2,3"}],"responses":{"200":{"description":"Successfully fetched Parts list","content":{"application/json":{"schema":{"type":"object","required":["parts","nextCursor","nextPageUrl"],"properties":{"parts":{"type":"array","items":{"type":"object","required":["id","name","description","barcode","locationId","locations","area","unitCost","availableQuantity","minimumQuantity","orderedQuantity","reservedQuantity","partTypes","createdAt","updatedAt"],"properties":{"id":{"type":"integer","example":123456,"description":"Global ID of the part"},"name":{"type":"string","example":"Locknut - 1/8"},"description":{"type":"string","nullable":true,"example":""},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the part is located. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"locations":{"type":"array","items":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"integer","example":852,"description":"ID of the location where the part is located"},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5,"nullable":true},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Maximum quantity you want to stock. Must be greater than or equal to minimumQuantity."},"area":{"type":"string","example":"tool room","nullable":true},"name":{"type":"string","example":"Warehouses","nullable":true,"description":"Name of the location where the part is stored"},"reservedQuantity":{"type":"integer","description":"Quantity currently reserved for work orders. Deprecated: Use `committedQuantities.reserved` instead.","example":10,"nullable":true,"deprecated":true},"committedQuantities":{"type":"object","description":"Quantities of the part currently committed to work orders, broken down by stage.","properties":{"kitted":{"type":"integer","description":"Quantity of parts that have been kitted for work orders","example":5},"reserved":{"type":"integer","description":"Quantity of parts reserved for work orders","example":3},"staged":{"type":"integer","description":"Quantity of parts that have been staged for work orders","example":2}}},"assignedQuantity":{"type":"integer","description":"Quantity currently assigned to work orders at this location","example":5}}},"description":"Detailed list of locations where the part is stored, including properties such as available quantity, minimum quantity, reserved quantity, area, and name of each location."},"area":{"type":"string","example":"tool room","nullable":true,"description":"Area of the part. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"unitCost":{"type":"integer","description":"Cost in cents. For example, for $1.20, put 120.","example":120,"nullable":true},"availableQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations. Deprecated: Use `inStockQuantity` instead.","example":10,"deprecated":true},"minimumQuantity":{"type":"integer","description":"Total minimum quantity before you should restock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":5},"orderedQuantity":{"type":"integer","description":"Total quantity currently on order from purchase orders. If your plan includes multi-location parts, this is the quantity across all part locations.","example":15},"reservedQuantity":{"type":"integer","description":"Total quantity currently reserved for work orders. If your plan includes multi-location parts, this is the quantity across all part locations. Deprecated: Use `committedQuantities.reserved` instead.","example":3,"deprecated":true},"partTypes":{"type":"array","items":{"type":"string"},"description":"List of part types"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the part was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the part was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"inStockQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":10},"committedQuantities":{"type":"object","description":"Quantities of the part currently committed to work orders, broken down by stage.","properties":{"kitted":{"type":"integer","description":"Quantity of parts that have been kitted for work orders","example":5},"reserved":{"type":"integer","description":"Quantity of parts reserved for work orders","example":3},"staged":{"type":"integer","description":"Quantity of parts that have been staged for work orders","example":2}}},"assignedQuantity":{"type":"integer","description":"Total quantity currently assigned to work orders across all stages.","example":10},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Total maximum quantity to keep in stock. Null when no part location has a max set. If your plan includes multi-location parts, this is the quantity across all part locations."},"externalId":{"type":"string","nullable":true,"description":"External ID for this part, unique per organization.","example":"ext-part-001"},"organizationId":{"type":"integer","example":1,"description":"ID of the organization that owns this resource"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\") (expand with query parameter)","additionalProperties":{"type":"string"},"example":{"Part Number":"000000000"},"nullable":false},"vendors":{"type":"array","description":"List of vendors of the part (expand with query parameter)","items":{"type":"object","properties":{"vendorId":{"type":"integer","example":"1","description":"Id of the vendor"},"partNumber":{"type":"string","example":"XC230","description":"Part number given to the part by this vendor"}}},"nullable":false},"assetIds":{"type":"array","items":{"type":"integer"},"example":[12,4561],"description":"List of asset IDs (expand with query parameter)","nullable":false}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Parts.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Parts.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Parts"]}},"/parts/external/{externalId}":{"get":{"summary":"Get part by external ID","parameters":[{"name":"externalId","in":"path","required":true,"description":"External ID of the part","schema":{"type":"string","maxLength":255}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully retrieved part","content":{"application/json":{"schema":{"type":"object","required":["part"],"properties":{"part":{"type":"object","required":["id","name","updatedAt","createdAt"],"properties":{"id":{"type":"integer","example":123456,"description":"Global ID of the part"},"name":{"type":"string","example":"Locknut - 1/8"},"description":{"type":"string","nullable":true,"example":""},"area":{"type":"string","example":"tool room","nullable":true,"description":"Area of the part. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"unitCost":{"type":"integer","description":"Cost in cents. For example, for $1.20, put 120.","example":120,"nullable":true},"availableQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations. Deprecated: Use `inStockQuantity` instead.","example":10,"deprecated":true},"inStockQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":10},"minimumQuantity":{"type":"integer","description":"Total minimum quantity before you should restock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":5},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the part is located. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"locations":{"type":"array","items":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"integer","example":852,"description":"ID of the location where the part is located"},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5,"nullable":true},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Maximum quantity you want to stock. Must be greater than or equal to minimumQuantity."},"area":{"type":"string","example":"tool room","nullable":true},"name":{"type":"string","example":"Warehouses","nullable":true,"description":"Name of the location where the part is stored"},"reservedQuantity":{"type":"integer","description":"Quantity currently reserved for work orders. Deprecated: Use `committedQuantities.reserved` instead.","example":10,"nullable":true,"deprecated":true},"committedQuantities":{"type":"object","description":"Quantities of the part currently committed to work orders, broken down by stage.","properties":{"kitted":{"type":"integer","description":"Quantity of parts that have been kitted for work orders","example":5},"reserved":{"type":"integer","description":"Quantity of parts reserved for work orders","example":3},"staged":{"type":"integer","description":"Quantity of parts that have been staged for work orders","example":2}}},"assignedQuantity":{"type":"integer","description":"Quantity currently assigned to work orders at this location","example":5}}},"description":"Detailed list of locations where the part is stored, including properties such as available quantity, minimum quantity, reserved quantity, area, and name of each location."},"partTypes":{"type":"array","items":{"type":"string"},"description":"List of part types"},"assetIds":{"type":"array","items":{"type":"integer"},"example":[12,4561],"description":"List of asset IDs"},"teamIds":{"type":"array","items":{"type":"integer"},"example":[1,4],"description":"List of team IDs in charge of the part"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"000000000"}},"vendors":{"type":"array","description":"List of vendors of the part","items":{"type":"object","properties":{"vendorId":{"type":"integer","example":"1","description":"Id of the vendor"},"partNumber":{"type":"string","example":"XC230","description":"Part number given to the part by this vendor"}}}},"externalId":{"type":"string","nullable":true,"description":"External ID for this part, unique per organization.","example":"ext-part-001"},"orderedQuantity":{"type":"integer","description":"Total quantity currently on order from purchase orders. If your plan includes multi-location parts, this is the quantity across all part locations.","example":15},"reservedQuantity":{"type":"integer","description":"Total quantity currently reserved for work orders. If your plan includes multi-location parts, this is the quantity across all part locations. Deprecated: Use `committedQuantities.reserved` instead.","example":3,"deprecated":true},"committedQuantities":{"type":"object","description":"Quantities of the part currently committed to work orders, broken down by stage.","properties":{"kitted":{"type":"integer","description":"Quantity of parts that have been kitted for work orders","example":5},"reserved":{"type":"integer","description":"Quantity of parts reserved for work orders","example":3},"staged":{"type":"integer","description":"Quantity of parts that have been staged for work orders","example":2}}},"assignedQuantity":{"type":"integer","description":"Total quantity currently assigned to work orders across all stages.","example":10},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Total maximum quantity to keep in stock. Null when no part location has a max set. If your plan includes multi-location parts, this is the quantity across all part locations."},"vendorIds":{"type":"array","items":{"type":"integer"},"example":[23,56],"description":"List of vendor IDs. Deprecated: Use the `vendorId` field inside `vendors`.","deprecated":true},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the part","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the part was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the part was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date at which the part was deleted","example":"2022-01-01T00:00:00.000Z"}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified part.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"part Not Found"}}}}}}},"tags":["Parts"]},"patch":{"summary":"Create or update part by external ID","description":"Idempotent upsert keyed on the external ID in the path. If a part has this external ID, it will be updated (and undeleted, if the part was previously deleted). Otherwise, a new part will be created with this external ID.","parameters":[{"name":"externalId","in":"path","required":true,"description":"External ID of the part","schema":{"type":"string","maxLength":255}},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"requestBody":{"description":"Part to create or update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"Locknut - 1/8"},"description":{"type":"string","nullable":true,"example":""},"area":{"type":"string","example":"tool room","nullable":true,"description":"Area of the part. Deprecated: Use new field inside `locations`. Will cause error if both fields are sent. See https://help.getmaintainx.com/multi-location-parts#integration-issues-with-multi-location-parts for more information.","deprecated":true},"unitCost":{"type":"integer","description":"Cost in cents. For example, for $1.20, put 120.","example":120,"nullable":true},"availableQuantity":{"type":"integer","description":"Total quantity currently in stock. Deprecated: Use new field inside `locations`. Will cause error if both fields are sent. See https://help.getmaintainx.com/multi-location-parts#integration-issues-with-multi-location-parts for more information.","example":10,"deprecated":true},"minimumQuantity":{"type":"integer","description":"Total minimum quantity before you should restock. Deprecated: Use new field inside `locations`. Will cause error if both fields are sent. See https://help.getmaintainx.com/multi-location-parts#integration-issues-with-multi-location-parts for more information.","example":5,"deprecated":true},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the part is located. Deprecated: Use new field inside `locations`. Will cause error if both fields are sent. See https://help.getmaintainx.com/multi-location-parts#integration-issues-with-multi-location-parts for more information.","deprecated":true},"partTypes":{"type":"array","items":{"type":"string"},"description":"List of part types"},"assetIds":{"type":"array","items":{"type":"integer"},"example":[12,4561],"description":"List of asset IDs"},"teamIds":{"type":"array","items":{"type":"integer"},"example":[1,4],"description":"List of team IDs in charge of the part"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"000000000"}},"vendors":{"type":"array","description":"List of vendors of the part","items":{"type":"object","properties":{"vendorId":{"type":"integer","example":"1","description":"Id of the vendor"},"partNumber":{"type":"string","example":"XC230","description":"Part number given to the part by this vendor"}}}},"committedQuantities":{"type":"object","description":"Quantities of the part currently committed to work orders, broken down by stage.","properties":{"kitted":{"type":"integer","description":"Quantity of parts that have been kitted for work orders","example":5},"reserved":{"type":"integer","description":"Quantity of parts reserved for work orders","example":3},"staged":{"type":"integer","description":"Quantity of parts that have been staged for work orders","example":2}}},"assignedQuantity":{"type":"integer","description":"Total quantity currently assigned to work orders across all stages.","example":10},"vendorIds":{"type":"array","items":{"type":"integer"},"example":[23,56],"description":"List of vendor IDs. Deprecated: Use the `vendorId` field inside `vendors`.","deprecated":true},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the part was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the part was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date at which the part was deleted","example":"2022-01-01T00:00:00.000Z"},"locations":{"type":"object","properties":{"addedUpdated":{"type":"array","items":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"integer","example":852,"description":"ID of the location where the part is located"},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5,"nullable":true},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Maximum quantity you want to stock. Must be greater than or equal to minimumQuantity."},"area":{"type":"string","example":"tool room","nullable":true}}},"description":"List of locations to add or update"},"removedLocationIds":{"type":"array","items":{"type":"integer"},"description":"List of location IDs to remove from the part","example":[742,514]}},"description":"List of locations to add, update or remove."}}}}}},"responses":{"200":{"description":"Successfully updated part","content":{"application/json":{"schema":{"type":"object","required":["part"],"properties":{"part":{"type":"object","required":["id","name","updatedAt","createdAt"],"properties":{"id":{"type":"integer","example":123456,"description":"Global ID of the part"},"name":{"type":"string","example":"Locknut - 1/8"},"description":{"type":"string","nullable":true,"example":""},"area":{"type":"string","example":"tool room","nullable":true,"description":"Area of the part. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"unitCost":{"type":"integer","description":"Cost in cents. For example, for $1.20, put 120.","example":120,"nullable":true},"availableQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations. Deprecated: Use `inStockQuantity` instead.","example":10,"deprecated":true},"inStockQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":10},"minimumQuantity":{"type":"integer","description":"Total minimum quantity before you should restock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":5},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the part is located. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"locations":{"type":"array","items":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"integer","example":852,"description":"ID of the location where the part is located"},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5,"nullable":true},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Maximum quantity you want to stock. Must be greater than or equal to minimumQuantity."},"area":{"type":"string","example":"tool room","nullable":true},"name":{"type":"string","example":"Warehouses","nullable":true,"description":"Name of the location where the part is stored"},"reservedQuantity":{"type":"integer","description":"Quantity currently reserved for work orders. Deprecated: Use `committedQuantities.reserved` instead.","example":10,"nullable":true,"deprecated":true},"committedQuantities":{"type":"object","description":"Quantities of the part currently committed to work orders, broken down by stage.","properties":{"kitted":{"type":"integer","description":"Quantity of parts that have been kitted for work orders","example":5},"reserved":{"type":"integer","description":"Quantity of parts reserved for work orders","example":3},"staged":{"type":"integer","description":"Quantity of parts that have been staged for work orders","example":2}}},"assignedQuantity":{"type":"integer","description":"Quantity currently assigned to work orders at this location","example":5}}},"description":"Detailed list of locations where the part is stored, including properties such as available quantity, minimum quantity, reserved quantity, area, and name of each location."},"partTypes":{"type":"array","items":{"type":"string"},"description":"List of part types"},"assetIds":{"type":"array","items":{"type":"integer"},"example":[12,4561],"description":"List of asset IDs"},"teamIds":{"type":"array","items":{"type":"integer"},"example":[1,4],"description":"List of team IDs in charge of the part"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"000000000"}},"vendors":{"type":"array","description":"List of vendors of the part","items":{"type":"object","properties":{"vendorId":{"type":"integer","example":"1","description":"Id of the vendor"},"partNumber":{"type":"string","example":"XC230","description":"Part number given to the part by this vendor"}}}},"externalId":{"type":"string","nullable":true,"description":"External ID for this part, unique per organization.","example":"ext-part-001"},"orderedQuantity":{"type":"integer","description":"Total quantity currently on order from purchase orders. If your plan includes multi-location parts, this is the quantity across all part locations.","example":15},"reservedQuantity":{"type":"integer","description":"Total quantity currently reserved for work orders. If your plan includes multi-location parts, this is the quantity across all part locations. Deprecated: Use `committedQuantities.reserved` instead.","example":3,"deprecated":true},"committedQuantities":{"type":"object","description":"Quantities of the part currently committed to work orders, broken down by stage.","properties":{"kitted":{"type":"integer","description":"Quantity of parts that have been kitted for work orders","example":5},"reserved":{"type":"integer","description":"Quantity of parts reserved for work orders","example":3},"staged":{"type":"integer","description":"Quantity of parts that have been staged for work orders","example":2}}},"assignedQuantity":{"type":"integer","description":"Total quantity currently assigned to work orders across all stages.","example":10},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Total maximum quantity to keep in stock. Null when no part location has a max set. If your plan includes multi-location parts, this is the quantity across all part locations."},"vendorIds":{"type":"array","items":{"type":"integer"},"example":[23,56],"description":"List of vendor IDs. Deprecated: Use the `vendorId` field inside `vendors`.","deprecated":true},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the part","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the part was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the part was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date at which the part was deleted","example":"2022-01-01T00:00:00.000Z"}}}}}}}},"201":{"description":"Successfully created part","content":{"application/json":{"schema":{"type":"object","required":["part"],"properties":{"part":{"type":"object","required":["id","name","updatedAt","createdAt"],"properties":{"id":{"type":"integer","example":123456,"description":"Global ID of the part"},"name":{"type":"string","example":"Locknut - 1/8"},"description":{"type":"string","nullable":true,"example":""},"area":{"type":"string","example":"tool room","nullable":true,"description":"Area of the part. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"unitCost":{"type":"integer","description":"Cost in cents. For example, for $1.20, put 120.","example":120,"nullable":true},"availableQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations. Deprecated: Use `inStockQuantity` instead.","example":10,"deprecated":true},"inStockQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":10},"minimumQuantity":{"type":"integer","description":"Total minimum quantity before you should restock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":5},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the part is located. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"locations":{"type":"array","items":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"integer","example":852,"description":"ID of the location where the part is located"},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5,"nullable":true},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Maximum quantity you want to stock. Must be greater than or equal to minimumQuantity."},"area":{"type":"string","example":"tool room","nullable":true},"name":{"type":"string","example":"Warehouses","nullable":true,"description":"Name of the location where the part is stored"},"reservedQuantity":{"type":"integer","description":"Quantity currently reserved for work orders. Deprecated: Use `committedQuantities.reserved` instead.","example":10,"nullable":true,"deprecated":true},"committedQuantities":{"type":"object","description":"Quantities of the part currently committed to work orders, broken down by stage.","properties":{"kitted":{"type":"integer","description":"Quantity of parts that have been kitted for work orders","example":5},"reserved":{"type":"integer","description":"Quantity of parts reserved for work orders","example":3},"staged":{"type":"integer","description":"Quantity of parts that have been staged for work orders","example":2}}},"assignedQuantity":{"type":"integer","description":"Quantity currently assigned to work orders at this location","example":5}}},"description":"Detailed list of locations where the part is stored, including properties such as available quantity, minimum quantity, reserved quantity, area, and name of each location."},"partTypes":{"type":"array","items":{"type":"string"},"description":"List of part types"},"assetIds":{"type":"array","items":{"type":"integer"},"example":[12,4561],"description":"List of asset IDs"},"teamIds":{"type":"array","items":{"type":"integer"},"example":[1,4],"description":"List of team IDs in charge of the part"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"000000000"}},"vendors":{"type":"array","description":"List of vendors of the part","items":{"type":"object","properties":{"vendorId":{"type":"integer","example":"1","description":"Id of the vendor"},"partNumber":{"type":"string","example":"XC230","description":"Part number given to the part by this vendor"}}}},"externalId":{"type":"string","nullable":true,"description":"External ID for this part, unique per organization.","example":"ext-part-001"},"orderedQuantity":{"type":"integer","description":"Total quantity currently on order from purchase orders. If your plan includes multi-location parts, this is the quantity across all part locations.","example":15},"reservedQuantity":{"type":"integer","description":"Total quantity currently reserved for work orders. If your plan includes multi-location parts, this is the quantity across all part locations. Deprecated: Use `committedQuantities.reserved` instead.","example":3,"deprecated":true},"committedQuantities":{"type":"object","description":"Quantities of the part currently committed to work orders, broken down by stage.","properties":{"kitted":{"type":"integer","description":"Quantity of parts that have been kitted for work orders","example":5},"reserved":{"type":"integer","description":"Quantity of parts reserved for work orders","example":3},"staged":{"type":"integer","description":"Quantity of parts that have been staged for work orders","example":2}}},"assignedQuantity":{"type":"integer","description":"Total quantity currently assigned to work orders across all stages.","example":10},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Total maximum quantity to keep in stock. Null when no part location has a max set. If your plan includes multi-location parts, this is the quantity across all part locations."},"vendorIds":{"type":"array","items":{"type":"integer"},"example":[23,56],"description":"List of vendor IDs. Deprecated: Use the `vendorId` field inside `vendors`.","deprecated":true},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the part","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the part was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the part was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date at which the part was deleted","example":"2022-01-01T00:00:00.000Z"}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified part.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"part Not Found"}}}}}},"409":{"description":"Conflict with existing part","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"conflictingMxId":{"type":"integer"},"isDeleted":{"type":"boolean"}},"required":["error","conflictingMxId","isDeleted"],"example":{"error":"Asset with externalId 'ext-123' already exists in this organization.","conflictingMxId":456,"isDeleted":false}}}}}},"tags":["Parts"]},"delete":{"summary":"Delete part by external ID","parameters":[{"name":"externalId","in":"path","required":true,"description":"External ID of the part","schema":{"type":"string","maxLength":255}},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"204":{"description":"Successfully deleted the part"},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified part.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"part Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Parts"]}},"/parts/{id}":{"get":{"summary":"Get part","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the part","example":"1"}],"responses":{"200":{"description":"Successfully retrieved part's information","content":{"application/json":{"schema":{"type":"object","required":["part"],"properties":{"part":{"type":"object","required":["id","name","updatedAt","createdAt"],"properties":{"id":{"type":"integer","example":123456,"description":"Global ID of the part"},"name":{"type":"string","example":"Locknut - 1/8"},"description":{"type":"string","nullable":true,"example":""},"area":{"type":"string","example":"tool room","nullable":true,"description":"Area of the part. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"unitCost":{"type":"integer","description":"Cost in cents. For example, for $1.20, put 120.","example":120,"nullable":true},"availableQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations. Deprecated: Use `inStockQuantity` instead.","example":10,"deprecated":true},"inStockQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":10},"minimumQuantity":{"type":"integer","description":"Total minimum quantity before you should restock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":5},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the part is located. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"locations":{"type":"array","items":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"integer","example":852,"description":"ID of the location where the part is located"},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5,"nullable":true},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Maximum quantity you want to stock. Must be greater than or equal to minimumQuantity."},"area":{"type":"string","example":"tool room","nullable":true},"name":{"type":"string","example":"Warehouses","nullable":true,"description":"Name of the location where the part is stored"},"reservedQuantity":{"type":"integer","description":"Quantity currently reserved for work orders. Deprecated: Use `committedQuantities.reserved` instead.","example":10,"nullable":true,"deprecated":true},"committedQuantities":{"type":"object","description":"Quantities of the part currently committed to work orders, broken down by stage.","properties":{"kitted":{"type":"integer","description":"Quantity of parts that have been kitted for work orders","example":5},"reserved":{"type":"integer","description":"Quantity of parts reserved for work orders","example":3},"staged":{"type":"integer","description":"Quantity of parts that have been staged for work orders","example":2}}},"assignedQuantity":{"type":"integer","description":"Quantity currently assigned to work orders at this location","example":5}}},"description":"Detailed list of locations where the part is stored, including properties such as available quantity, minimum quantity, reserved quantity, area, and name of each location."},"partTypes":{"type":"array","items":{"type":"string"},"description":"List of part types"},"assetIds":{"type":"array","items":{"type":"integer"},"example":[12,4561],"description":"List of asset IDs"},"teamIds":{"type":"array","items":{"type":"integer"},"example":[1,4],"description":"List of team IDs in charge of the part"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"000000000"}},"vendors":{"type":"array","description":"List of vendors of the part","items":{"type":"object","properties":{"vendorId":{"type":"integer","example":"1","description":"Id of the vendor"},"partNumber":{"type":"string","example":"XC230","description":"Part number given to the part by this vendor"}}}},"externalId":{"type":"string","nullable":true,"description":"External ID for this part, unique per organization.","example":"ext-part-001"},"orderedQuantity":{"type":"integer","description":"Total quantity currently on order from purchase orders. If your plan includes multi-location parts, this is the quantity across all part locations.","example":15},"reservedQuantity":{"type":"integer","description":"Total quantity currently reserved for work orders. If your plan includes multi-location parts, this is the quantity across all part locations. Deprecated: Use `committedQuantities.reserved` instead.","example":3,"deprecated":true},"committedQuantities":{"type":"object","description":"Quantities of the part currently committed to work orders, broken down by stage.","properties":{"kitted":{"type":"integer","description":"Quantity of parts that have been kitted for work orders","example":5},"reserved":{"type":"integer","description":"Quantity of parts reserved for work orders","example":3},"staged":{"type":"integer","description":"Quantity of parts that have been staged for work orders","example":2}}},"assignedQuantity":{"type":"integer","description":"Total quantity currently assigned to work orders across all stages.","example":10},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Total maximum quantity to keep in stock. Null when no part location has a max set. If your plan includes multi-location parts, this is the quantity across all part locations."},"vendorIds":{"type":"array","items":{"type":"integer"},"example":[23,56],"description":"List of vendor IDs. Deprecated: Use the `vendorId` field inside `vendors`.","deprecated":true},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the part","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the part was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the part was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date at which the part was deleted","example":"2022-01-01T00:00:00.000Z"}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified part or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Parts"]},"patch":{"summary":"Update part","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the part","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Part to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"Locknut - 1/8"},"description":{"type":"string","nullable":true,"example":""},"area":{"type":"string","example":"tool room","nullable":true,"description":"Area of the part. Deprecated: Use new field inside `locations`. Will cause error if both fields are sent. See https://help.getmaintainx.com/multi-location-parts#integration-issues-with-multi-location-parts for more information.","deprecated":true},"unitCost":{"type":"integer","description":"Cost in cents. For example, for $1.20, put 120.","example":120,"nullable":true},"availableQuantity":{"type":"integer","description":"Total quantity currently in stock. Deprecated: Use new field inside `locations`. Will cause error if both fields are sent. See https://help.getmaintainx.com/multi-location-parts#integration-issues-with-multi-location-parts for more information.","example":10,"deprecated":true},"minimumQuantity":{"type":"integer","description":"Total minimum quantity before you should restock. Deprecated: Use new field inside `locations`. Will cause error if both fields are sent. See https://help.getmaintainx.com/multi-location-parts#integration-issues-with-multi-location-parts for more information.","example":5,"deprecated":true},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the part is located. Deprecated: Use new field inside `locations`. Will cause error if both fields are sent. See https://help.getmaintainx.com/multi-location-parts#integration-issues-with-multi-location-parts for more information.","deprecated":true},"partTypes":{"type":"array","items":{"type":"string"},"description":"List of part types"},"assetIds":{"type":"array","items":{"type":"integer"},"example":[12,4561],"description":"List of asset IDs"},"teamIds":{"type":"array","items":{"type":"integer"},"example":[1,4],"description":"List of team IDs in charge of the part"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"000000000"}},"vendors":{"type":"array","description":"List of vendors of the part","items":{"type":"object","properties":{"vendorId":{"type":"integer","example":"1","description":"Id of the vendor"},"partNumber":{"type":"string","example":"XC230","description":"Part number given to the part by this vendor"}}}},"externalId":{"type":"string","nullable":true,"description":"External ID for this part, unique per organization.","example":"ext-part-001"},"committedQuantities":{"type":"object","description":"Quantities of the part currently committed to work orders, broken down by stage.","properties":{"kitted":{"type":"integer","description":"Quantity of parts that have been kitted for work orders","example":5},"reserved":{"type":"integer","description":"Quantity of parts reserved for work orders","example":3},"staged":{"type":"integer","description":"Quantity of parts that have been staged for work orders","example":2}}},"assignedQuantity":{"type":"integer","description":"Total quantity currently assigned to work orders across all stages.","example":10},"vendorIds":{"type":"array","items":{"type":"integer"},"example":[23,56],"description":"List of vendor IDs. Deprecated: Use the `vendorId` field inside `vendors`.","deprecated":true},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the part was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the part was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date at which the part was deleted","example":"2022-01-01T00:00:00.000Z"},"locations":{"type":"object","properties":{"addedUpdated":{"type":"array","items":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"integer","example":852,"description":"ID of the location where the part is located"},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5,"nullable":true},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Maximum quantity you want to stock. Must be greater than or equal to minimumQuantity."},"area":{"type":"string","example":"tool room","nullable":true}}},"description":"List of locations to add or update"},"removedLocationIds":{"type":"array","items":{"type":"integer"},"description":"List of location IDs to remove from the part","example":[742,514]}},"description":"List of locations to add, update or remove."}}}}}},"responses":{"200":{"description":"Successfully edited part","content":{"application/json":{"schema":{"type":"object","required":["part"],"properties":{"part":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":123456,"description":"Global ID of the part"},"name":{"type":"string","example":"Locknut - 1/8"},"description":{"type":"string","nullable":true,"example":""},"area":{"type":"string","example":"tool room","nullable":true,"description":"Area of the part. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"unitCost":{"type":"integer","description":"Cost in cents. For example, for $1.20, put 120.","example":120,"nullable":true},"availableQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations. Deprecated: Use `inStockQuantity` instead.","example":10,"deprecated":true},"inStockQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":10},"minimumQuantity":{"type":"integer","description":"Total minimum quantity before you should restock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":5},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the part is located. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"locations":{"type":"array","items":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"integer","example":852,"description":"ID of the location where the part is located"},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5,"nullable":true},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Maximum quantity you want to stock. Must be greater than or equal to minimumQuantity."},"area":{"type":"string","example":"tool room","nullable":true},"name":{"type":"string","example":"Warehouses","nullable":true,"description":"Name of the location where the part is stored"},"reservedQuantity":{"type":"integer","description":"Quantity currently reserved for work orders. Deprecated: Use `committedQuantities.reserved` instead.","example":10,"nullable":true,"deprecated":true},"committedQuantities":{"type":"object","description":"Quantities of the part currently committed to work orders, broken down by stage.","properties":{"kitted":{"type":"integer","description":"Quantity of parts that have been kitted for work orders","example":5},"reserved":{"type":"integer","description":"Quantity of parts reserved for work orders","example":3},"staged":{"type":"integer","description":"Quantity of parts that have been staged for work orders","example":2}}},"assignedQuantity":{"type":"integer","description":"Quantity currently assigned to work orders at this location","example":5}}},"description":"Detailed list of locations where the part is stored, including properties such as available quantity, minimum quantity, reserved quantity, area, and name of each location."},"partTypes":{"type":"array","items":{"type":"string"},"description":"List of part types"},"assetIds":{"type":"array","items":{"type":"integer"},"example":[12,4561],"description":"List of asset IDs"},"teamIds":{"type":"array","items":{"type":"integer"},"example":[1,4],"description":"List of team IDs in charge of the part"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"000000000"}},"vendors":{"type":"array","description":"List of vendors of the part","items":{"type":"object","properties":{"vendorId":{"type":"integer","example":"1","description":"Id of the vendor"},"partNumber":{"type":"string","example":"XC230","description":"Part number given to the part by this vendor"}}}},"externalId":{"type":"string","nullable":true,"description":"External ID for this part, unique per organization.","example":"ext-part-001"},"orderedQuantity":{"type":"integer","description":"Total quantity currently on order from purchase orders. If your plan includes multi-location parts, this is the quantity across all part locations.","example":15},"reservedQuantity":{"type":"integer","description":"Total quantity currently reserved for work orders. If your plan includes multi-location parts, this is the quantity across all part locations. Deprecated: Use `committedQuantities.reserved` instead.","example":3,"deprecated":true},"committedQuantities":{"type":"object","description":"Quantities of the part currently committed to work orders, broken down by stage.","properties":{"kitted":{"type":"integer","description":"Quantity of parts that have been kitted for work orders","example":5},"reserved":{"type":"integer","description":"Quantity of parts reserved for work orders","example":3},"staged":{"type":"integer","description":"Quantity of parts that have been staged for work orders","example":2}}},"assignedQuantity":{"type":"integer","description":"Total quantity currently assigned to work orders across all stages.","example":10},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Total maximum quantity to keep in stock. Null when no part location has a max set. If your plan includes multi-location parts, this is the quantity across all part locations."},"vendorIds":{"type":"array","items":{"type":"integer"},"example":[23,56],"description":"List of vendor IDs. Deprecated: Use the `vendorId` field inside `vendors`.","deprecated":true},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the part","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the part was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the part was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date at which the part was deleted","example":"2022-01-01T00:00:00.000Z"}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified part.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"part Not Found"}}}}}},"409":{"description":"Conflict with existing part","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"conflictingMxId":{"type":"integer"},"isDeleted":{"type":"boolean"}},"required":["error","conflictingMxId","isDeleted"],"example":{"error":"Asset with externalId 'ext-123' already exists in this organization.","conflictingMxId":456,"isDeleted":false}}}}}},"tags":["Parts"]},"delete":{"summary":"Delete part","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the part","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the part"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified part.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"part Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Parts"]}},"/parts/{id}/attachments/{filename}":{"put":{"summary":"Update part attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the part.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"datasheet.pdf"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the attachment.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"application/x-indesign":{"schema":{"type":"object","format":"binary"}},"application/epub+zip":{"schema":{"type":"object","format":"binary"}},"application/x-xpinstall":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"schema":{"type":"object","format":"binary"}},"application/zip":{"schema":{"type":"object","format":"binary"}},"application/x-tar":{"schema":{"type":"object","format":"binary"}},"application/x-rar-compressed":{"schema":{"type":"object","format":"binary"}},"application/gzip":{"schema":{"type":"object","format":"binary"}},"application/x-bzip2":{"schema":{"type":"object","format":"binary"}},"application/x-7z-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-apple-diskimage":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.arrow.file":{"schema":{"type":"object","format":"binary"}},"video/mp4":{"schema":{"type":"object","format":"binary"}},"audio/midi":{"schema":{"type":"object","format":"binary"}},"video/matroska":{"schema":{"type":"object","format":"binary"}},"video/webm":{"schema":{"type":"object","format":"binary"}},"video/quicktime":{"schema":{"type":"object","format":"binary"}},"video/vnd.avi":{"schema":{"type":"object","format":"binary"}},"audio/wav":{"schema":{"type":"object","format":"binary"}},"audio/qcelp":{"schema":{"type":"object","format":"binary"}},"audio/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"video/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-asf":{"schema":{"type":"object","format":"binary"}},"video/mpeg":{"schema":{"type":"object","format":"binary"}},"video/3gpp":{"schema":{"type":"object","format":"binary"}},"audio/mpeg":{"schema":{"type":"object","format":"binary"}},"audio/mp4":{"schema":{"type":"object","format":"binary"}},"video/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg; codecs=opus":{"schema":{"type":"object","format":"binary"}},"application/ogg":{"schema":{"type":"object","format":"binary"}},"audio/flac":{"schema":{"type":"object","format":"binary"}},"audio/ape":{"schema":{"type":"object","format":"binary"}},"audio/wavpack":{"schema":{"type":"object","format":"binary"}},"audio/amr":{"schema":{"type":"object","format":"binary"}},"application/pdf":{"schema":{"type":"object","format":"binary"}},"application/x-elf":{"schema":{"type":"object","format":"binary"}},"application/x-mach-binary":{"schema":{"type":"object","format":"binary"}},"application/x-msdownload":{"schema":{"type":"object","format":"binary"}},"application/x-shockwave-flash":{"schema":{"type":"object","format":"binary"}},"application/rtf":{"schema":{"type":"object","format":"binary"}},"application/wasm":{"schema":{"type":"object","format":"binary"}},"font/woff":{"schema":{"type":"object","format":"binary"}},"font/woff2":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-fontobject":{"schema":{"type":"object","format":"binary"}},"font/ttf":{"schema":{"type":"object","format":"binary"}},"font/otf":{"schema":{"type":"object","format":"binary"}},"font/collection":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"video/x-flv":{"schema":{"type":"object","format":"binary"}},"application/postscript":{"schema":{"type":"object","format":"binary"}},"application/eps":{"schema":{"type":"object","format":"binary"}},"application/x-xz":{"schema":{"type":"object","format":"binary"}},"application/x-sqlite3":{"schema":{"type":"object","format":"binary"}},"application/x-nintendo-nes-rom":{"schema":{"type":"object","format":"binary"}},"application/x-google-chrome-extension":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-cab-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-deb":{"schema":{"type":"object","format":"binary"}},"application/x-unix-archive":{"schema":{"type":"object","format":"binary"}},"application/x-rpm":{"schema":{"type":"object","format":"binary"}},"application/x-compress":{"schema":{"type":"object","format":"binary"}},"application/lzip":{"schema":{"type":"object","format":"binary"}},"application/x-cfb":{"schema":{"type":"object","format":"binary"}},"application/x-mie":{"schema":{"type":"object","format":"binary"}},"application/mxf":{"schema":{"type":"object","format":"binary"}},"video/mp2t":{"schema":{"type":"object","format":"binary"}},"application/x-blender":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"audio/aiff":{"schema":{"type":"object","format":"binary"}},"application/xml":{"schema":{"type":"object","format":"binary"}},"application/x-mobipocket-ebook":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"application/dicom":{"schema":{"type":"object","format":"binary"}},"audio/x-musepack":{"schema":{"type":"object","format":"binary"}},"text/calendar":{"schema":{"type":"object","format":"binary"}},"text/vcard":{"schema":{"type":"object","format":"binary"}},"text/vtt":{"schema":{"type":"object","format":"binary"}},"model/gltf-binary":{"schema":{"type":"object","format":"binary"}},"application/vnd.tcpdump.pcap":{"schema":{"type":"object","format":"binary"}},"audio/x-dsf":{"schema":{"type":"object","format":"binary"}},"application/x-ms-shortcut":{"schema":{"type":"object","format":"binary"}},"application/x-ft-apple.alias":{"schema":{"type":"object","format":"binary"}},"audio/x-voc":{"schema":{"type":"object","format":"binary"}},"audio/vnd.dolby.dd-raw":{"schema":{"type":"object","format":"binary"}},"audio/x-m4a":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"video/x-m4v":{"schema":{"type":"object","format":"binary"}},"video/3gpp2":{"schema":{"type":"object","format":"binary"}},"application/x-esri-shape":{"schema":{"type":"object","format":"binary"}},"audio/aac":{"schema":{"type":"object","format":"binary"}},"audio/x-it":{"schema":{"type":"object","format":"binary"}},"audio/x-s3m":{"schema":{"type":"object","format":"binary"}},"audio/x-xm":{"schema":{"type":"object","format":"binary"}},"video/mp1s":{"schema":{"type":"object","format":"binary"}},"video/mp2p":{"schema":{"type":"object","format":"binary"}},"application/vnd.sketchup.skp":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"application/x-lzh-compressed":{"schema":{"type":"object","format":"binary"}},"application/pgp-encrypted":{"schema":{"type":"object","format":"binary"}},"application/x-asar":{"schema":{"type":"object","format":"binary"}},"model/stl":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-htmlhelp":{"schema":{"type":"object","format":"binary"}},"model/3mf":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"application/zstd":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-outlook":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.parquet":{"schema":{"type":"object","format":"binary"}},"application/java-vm":{"schema":{"type":"object","format":"binary"}},"application/x-arj":{"schema":{"type":"object","format":"binary"}},"application/x-cpio":{"schema":{"type":"object","format":"binary"}},"application/x-ace-compressed":{"schema":{"type":"object","format":"binary"}},"application/avro":{"schema":{"type":"object","format":"binary"}},"application/vnd.iccprofile":{"schema":{"type":"object","format":"binary"}},"application/x-ft-fbx":{"schema":{"type":"object","format":"binary"}},"application/vnd.visio":{"schema":{"type":"object","format":"binary"}},"application/vnd.android.package-archive":{"schema":{"type":"object","format":"binary"}},"application/x-ft-draco":{"schema":{"type":"object","format":"binary"}},"application/x-lz4":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.sheet.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.document.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/java-archive":{"schema":{"type":"object","format":"binary"}},"application/vnd.rn-realmedia":{"schema":{"type":"object","format":"binary"}},"application/x-spss-sav":{"schema":{"type":"object","format":"binary"}},"application/x-ms-regedit":{"schema":{"type":"object","format":"binary"}},"application/x-ft-windows-registry-hive":{"schema":{"type":"object","format":"binary"}},"application/x-jmp-data":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.keynote":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.numbers":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.pages":{"schema":{"type":"object","format":"binary"}},"application/x-apache-arrow":{"schema":{"type":"object","format":"binary"}},"application/x-lzip":{"schema":{"type":"object","format":"binary"}},"application/x.apple.alias":{"schema":{"type":"object","format":"binary"}},"application/x.ms.shortcut":{"schema":{"type":"object","format":"binary"}},"audio/opus":{"schema":{"type":"object","format":"binary"}},"audio/vnd.wave":{"schema":{"type":"object","format":"binary"}},"audio/x-flac":{"schema":{"type":"object","format":"binary"}},"video/x-matroska":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated part's attachment.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified part.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"part Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Parts"]},"delete":{"summary":"Remove part attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the part.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"attachment.xls"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully removed part's attachment."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Attachment.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment Not Found"}}}}}}},"tags":["Parts"]}},"/parts/{id}/thumbnail/{filename}":{"put":{"summary":"Update part's thumbnail","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the part.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the part thumbnail, including the extension.","example":"motor.png"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the thumbnail.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated part's thumbnail.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"You cannot edit this entity.","fieldPath":"organizationId","fieldValue":"1"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Part.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Part Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Parts"]}},"/parttransferrequests":{"post":{"summary":"Create a part transfer request","requestBody":{"description":"PartTransferRequest to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["quantityRequested","sourcePartId","destinationPartId"],"properties":{"quantityRequested":{"type":"integer","example":3,"description":"Quantity of parts requested for transfer."},"sourcePartId":{"type":"integer","format":"integer","description":"ID of the part that belongs to the organization receiving the request. (Sending stocks)","example":843},"destinationPartId":{"type":"integer","format":"integer","description":"ID of the part that belongs to the organization performing the request. (Receiving stocks)","example":852},"requestMessage":{"type":"string","example":"Would you please send us five ball screws for our cnc machine?","description":"Message to give context surrounding the part transfer request.","nullable":true}}}}}},"responses":{"201":{"description":"Successfully created part transfer request","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the part transfer request."}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Part.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Part Not Found"}}}}}}},"tags":["Part Transfer Requests"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}]},"get":{"summary":"List part transfer requests","description":"Endpoint used to list part transfer request resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Part Transfer Requests returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"statuses","schema":{"type":"array","title":"status filters","description":"To filter by multiple status: `status=APPROVED&status=DECLINED`","items":{"type":"string","enum":["APPROVED","CANCELED","COMPLETED","DECLINED","PENDING"]}},"in":"query"},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Part Transfer Requests list","content":{"application/json":{"schema":{"type":"object","required":["partTransferRequests","nextCursor","nextPageUrl"],"properties":{"partTransferRequests":{"type":"array","items":{"type":"object","required":["id","destinationOrganizationId","sourceOrganizationId","sourcePartId","destinationPartId","quantityRequested"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the part transfer request."},"quantityReceived":{"type":"integer","example":2,"description":"Quantity of parts received.","nullable":true},"quantityRequested":{"type":"integer","example":3,"description":"Quantity of parts requested for transfer."},"quantityTransferred":{"type":"integer","example":2,"description":"Quantity of parts transferred.","nullable":true},"requestMessage":{"type":"string","example":"Would you please send us five ball screws for our cnc machine?","description":"Message to give context surrounding the part transfer request.","nullable":true},"responseMessage":{"type":"string","example":"Sorry, we do not have enough extra ball screws to share them with you.","description":"Message to give context surrounding the transfer of the part transfer request.","nullable":true},"status":{"type":"string","enum":["APPROVED","CANCELED","COMPLETED","DECLINED","PENDING"],"description":"Status of the part transfer request.","example":"PENDING"},"sourcePartId":{"type":"integer","format":"integer","description":"ID of the part that belongs to the organization receiving the request. (Sending stocks)","example":843},"destinationPartId":{"type":"integer","format":"integer","description":"ID of the part that belongs to the organization performing the request. (Receiving stocks)","example":852},"transferrerId":{"type":"integer","format":"integer","description":"ID of the user performing the transfer. (Sending stocks)","example":102,"nullable":true},"requesterId":{"type":"integer","format":"integer","description":"ID of the user performing the request. (Requesting/receiving stocks)","example":201},"destinationOrganizationId":{"type":"integer","format":"integer","description":"ID of the organization performing the request. (Requesting/receiving stocks)","example":1001},"sourceOrganizationId":{"type":"integer","format":"integer","description":"ID of the organization receiving the request. (Sending stocks)","example":1002},"sourceLocationId":{"type":"integer","format":"integer","description":"ID of the location in the organization from which parts were transferred. (Sending stocks)","example":852},"destinationLocations":{"type":"array","items":{"type":"object","required":["quantity"],"properties":{"locationId":{"type":"integer","format":"integer","description":"ID of the location in the organization where the part is being received. (Receiving stocks)","example":917},"quantity":{"type":"integer","format":"integer","description":"Quantity of parts received.","example":2}}},"description":"Locations into which the transferred parts were received. (Receiving stocks)"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Part Transfer Requests.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Part Transfer Requests.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Part Transfer Requests"]}},"/parttransferrequests/{id}":{"get":{"summary":"Get part transfer request","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the partTransferRequest","example":"1"}],"responses":{"200":{"description":"Successfully retrieved partTransferRequest's information","content":{"application/json":{"schema":{"type":"object","required":["partTransferRequest"],"properties":{"partTransferRequest":{"type":"object","required":["id","destinationOrganizationId","sourceOrganizationId","sourcePartId","destinationPartId","quantityRequested"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the part transfer request."},"quantityReceived":{"type":"integer","example":2,"description":"Quantity of parts received.","nullable":true},"quantityRequested":{"type":"integer","example":3,"description":"Quantity of parts requested for transfer."},"quantityTransferred":{"type":"integer","example":2,"description":"Quantity of parts transferred.","nullable":true},"requestMessage":{"type":"string","example":"Would you please send us five ball screws for our cnc machine?","description":"Message to give context surrounding the part transfer request.","nullable":true},"responseMessage":{"type":"string","example":"Sorry, we do not have enough extra ball screws to share them with you.","description":"Message to give context surrounding the transfer of the part transfer request.","nullable":true},"status":{"type":"string","enum":["APPROVED","CANCELED","COMPLETED","DECLINED","PENDING"],"description":"Status of the part transfer request.","example":"PENDING"},"sourcePartId":{"type":"integer","format":"integer","description":"ID of the part that belongs to the organization receiving the request. (Sending stocks)","example":843},"destinationPartId":{"type":"integer","format":"integer","description":"ID of the part that belongs to the organization performing the request. (Receiving stocks)","example":852},"transferrerId":{"type":"integer","format":"integer","description":"ID of the user performing the transfer. (Sending stocks)","example":102,"nullable":true},"requesterId":{"type":"integer","format":"integer","description":"ID of the user performing the request. (Requesting/receiving stocks)","example":201},"destinationOrganizationId":{"type":"integer","format":"integer","description":"ID of the organization performing the request. (Requesting/receiving stocks)","example":1001},"sourceOrganizationId":{"type":"integer","format":"integer","description":"ID of the organization receiving the request. (Sending stocks)","example":1002},"sourceLocationId":{"type":"integer","format":"integer","description":"ID of the location in the organization from which parts were transferred. (Sending stocks)","example":852},"destinationLocations":{"type":"array","items":{"type":"object","required":["quantity"],"properties":{"locationId":{"type":"integer","format":"integer","description":"ID of the location in the organization where the part is being received. (Receiving stocks)","example":917},"quantity":{"type":"integer","format":"integer","description":"Quantity of parts received.","example":2}}},"description":"Locations into which the transferred parts were received. (Receiving stocks)"}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified partTransferRequest or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Part Transfer Requests"]},"patch":{"summary":"Update part transfer request","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the part transfer request","example":"4242"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"200":{"description":"Successfully updated part transfer request","content":{"application/json":{"schema":{"type":"object","required":["partTransferRequest"],"properties":{"partTransferRequest":{"type":"object","required":["id","destinationOrganizationId","sourceOrganizationId","sourcePartId","destinationPartId","quantityRequested"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the part transfer request."},"quantityReceived":{"type":"integer","example":2,"description":"Quantity of parts received.","nullable":true},"quantityRequested":{"type":"integer","example":3,"description":"Quantity of parts requested for transfer."},"quantityTransferred":{"type":"integer","example":2,"description":"Quantity of parts transferred.","nullable":true},"requestMessage":{"type":"string","example":"Would you please send us five ball screws for our cnc machine?","description":"Message to give context surrounding the part transfer request.","nullable":true},"responseMessage":{"type":"string","example":"Sorry, we do not have enough extra ball screws to share them with you.","description":"Message to give context surrounding the transfer of the part transfer request.","nullable":true},"status":{"type":"string","enum":["APPROVED","CANCELED","COMPLETED","DECLINED","PENDING"],"description":"Status of the part transfer request.","example":"PENDING"},"sourcePartId":{"type":"integer","format":"integer","description":"ID of the part that belongs to the organization receiving the request. (Sending stocks)","example":843},"destinationPartId":{"type":"integer","format":"integer","description":"ID of the part that belongs to the organization performing the request. (Receiving stocks)","example":852},"transferrerId":{"type":"integer","format":"integer","description":"ID of the user performing the transfer. (Sending stocks)","example":102,"nullable":true},"requesterId":{"type":"integer","format":"integer","description":"ID of the user performing the request. (Requesting/receiving stocks)","example":201},"destinationOrganizationId":{"type":"integer","format":"integer","description":"ID of the organization performing the request. (Requesting/receiving stocks)","example":1001},"sourceOrganizationId":{"type":"integer","format":"integer","description":"ID of the organization receiving the request. (Sending stocks)","example":1002},"sourceLocationId":{"type":"integer","format":"integer","description":"ID of the location in the organization from which parts were transferred. (Sending stocks)","example":852},"destinationLocations":{"type":"array","items":{"type":"object","required":["quantity"],"properties":{"locationId":{"type":"integer","format":"integer","description":"ID of the location in the organization where the part is being received. (Receiving stocks)","example":917},"quantity":{"type":"integer","format":"integer","description":"Quantity of parts received.","example":2}}},"description":"Locations into which the transferred parts were received. (Receiving stocks)"}}}}}}}},"400":{"description":"Failed to edit the part transfer request","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"status is not valid"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified partTransferRequest.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"partTransferRequest Not Found"}}}}}}},"requestBody":{"description":"Part transfer request to update","required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["APPROVED","CANCELED","COMPLETED","DECLINED","PENDING"],"description":"Status of the part transfer request.","example":"PENDING"},"responseMessage":{"type":"string","example":"Sorry, we do not have enough extra ball screws to share them with you.","description":"Message to give context surrounding the transfer of the part transfer request.","nullable":true},"sourceLocationId":{"type":"integer","format":"integer","description":"ID of the location in the organization from which parts were transferred. (Sending stocks)","example":852},"destinationLocations":{"type":"array","items":{"type":"object","required":["quantity"],"properties":{"locationId":{"type":"integer","format":"integer","description":"ID of the location in the organization where the part is being received. (Receiving stocks)","example":917},"quantity":{"type":"integer","format":"integer","description":"Quantity of parts received.","example":2}}},"description":"Locations into which the transferred parts were received. (Receiving stocks)"},"quantity":{"type":"integer","example":42,"description":"Quantity to update for the relevant status.","nullable":true}}}}}},"tags":["Part Transfer Requests"]}},"/purchaseorders":{"post":{"summary":"Create new purchase order","requestBody":{"description":"Purchase Order to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["vendorId","items"],"properties":{"note":{"type":"string","nullable":true,"description":"Notes left for Purchase Orders","example":"Please deliver during business hours"},"dueDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Due date of Purchase Order","nullable":true},"vendorId":{"type":"number","example":432,"description":"ID of vendor that this Purchase Order is associated with","nullable":true},"overrideNumber":{"type":"string","example":"A123","nullable":true,"description":"Custom number/identifier for Purchase Order"},"deletedAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","format":"date-time","description":"Date at which the Purchase Order was deleted","nullable":true},"vendorContactIds":{"type":"array","description":"List of vendor contact IDs in the Purchase Order","example":[12,34,56],"items":{"type":"number","example":12}},"shippingAddress":{"type":"object","description":"Shipping address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"shippingAddressId":{"type":"number","description":"Shipping address Id in the Purchase Order","nullable":true},"billingAddress":{"type":"object","description":"Billing address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"billingAddressId":{"type":"number","description":"Billing address Id in the Purchase Order","nullable":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}},"items":{"type":"array","description":"List of items in the Purchase Order","items":{"type":"object","required":["quantityOrdered"],"properties":{"partId":{"type":"number","example":43,"description":"ID of the part this item is related to","nullable":true},"name":{"type":"string","nullable":true},"partNumber":{"type":"string","nullable":true},"price":{"type":"number","example":25000,"nullable":true,"description":"Total price of items in cents"},"quantityOrdered":{"type":"number","example":4,"description":"Represent the amount of units for this item that were ordered in the purchase order."},"quantityReceived":{"type":"number","example":3,"nullable":true,"description":"Represents the total amount of this specific item that has been received to date."},"unitCost":{"type":"number","example":125000,"nullable":true,"description":"Price of a single item in cents"},"extraFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom Fields on the entity. Deprecated: Use `lineExtraFields` instead.","deprecated":true},"lineExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}}}}},"costs":{"type":"array","description":"List of costs in the Purchase Order","items":{"type":"object","required":["name","type","amount"],"properties":{"name":{"type":"string","example":"Sales Tax","description":"Description of the cost"},"type":{"type":"string","enum":["AMOUNT_NON_TAXABLE","AMOUNT_TAXABLE","PERCENT_TAXABLE"],"example":"AMOUNT_TAXABLE","description":"Type of cost in either cents or percent. Accepted types in cents are AMOUNT_TAXABLE and AMOUNT_NON_TAXABLE. For percentage use PERCENT_TAXABLE"},"amount":{"type":"number","example":125000}}}},"title":{"type":"string","nullable":true,"description":"Title of the Purchase Order. Will be ignored if organization setting for custom purchase order titles is disabled.","example":"Office Supplies Order"}}}}}},"responses":{"201":{"description":"Successfully created Purchase Order","content":{"application/json":{"schema":{"type":"object","required":["id","status","items"],"properties":{"id":{"type":"number","example":135,"description":"Global ID of the Purchase Order"},"note":{"type":"string","nullable":true,"description":"Notes left for Purchase Orders","example":"Please deliver during business hours"},"title":{"type":"string","nullable":true,"description":"Title of the Purchase Order.","example":"Office Supplies Order"},"reviewNote":{"type":"string","nullable":true,"description":"Notes to be left for changes to be made when sending a Purchase Order for revision","example":"Please adjust quantities and resubmit"},"status":{"type":"string","nullable":true,"example":"APPROVED","description":"Status of the Purchase Order. Supported values are APPROVED, CANCELED, COMPLETED, DECLINED, PARTIALLY_FULFILLED, PENDING, REQUESTED"},"dueDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Due date of Purchase Order","nullable":true},"creatorId":{"type":"number","example":432,"description":"ID of the user that created this Purchase Order"},"vendorId":{"type":"number","example":432,"description":"ID of vendor that this Purchase Order is associated with","nullable":true},"autoGeneratedNumber":{"type":"number","example":987,"nullable":true,"description":"Autogenerated Purchase Order number"},"overrideNumber":{"type":"string","example":"A123","nullable":true,"description":"Custom number/identifier for Purchase Order"},"approverId":{"type":"number","example":135,"description":"ID of the user who approved the Purchase Order","nullable":true},"approvalDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date the Purchase Order was approved","nullable":true},"createdAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","format":"date-time","description":"Date the Purchase Order was created","nullable":true},"updatedAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date the Purchase Order was last updated","nullable":true},"deletedAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","format":"date-time","description":"Date at which the Purchase Order was deleted","nullable":true},"items":{"type":"array","description":"List of items in the Purchase Order","items":{"type":"object","required":["id","quantityOrdered"],"properties":{"id":{"type":"number","example":23,"description":"ID of the item"},"partId":{"type":"number","example":43,"description":"ID of the part this item is related to","nullable":true},"name":{"type":"string","nullable":true},"partNumber":{"type":"string","nullable":true},"price":{"type":"number","example":25000,"nullable":true,"description":"Total price of items in cents"},"priceDecimal":{"type":"string","example":"250.000000","nullable":true,"description":"Total price of items as a decimal value"},"quantityOrdered":{"type":"number","example":4,"description":"Represent the amount of units for this item that were ordered in the purchase order."},"quantityReceived":{"type":"number","example":3,"nullable":true,"description":"Represents the total amount of this specific item that has been received to date."},"unitCost":{"type":"number","example":125000,"nullable":true,"description":"Price of a single item in cents"},"unitCostDecimal":{"type":"string","example":"1250.000000","nullable":true,"description":"Price of a single item as a decimal value"},"fulfillments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","example":23,"description":"ID of the item fulfillment"},"locationId":{"type":"number","example":852,"nullable":true,"description":"ID of the location where the item was fulfilled"},"quantityReceived":{"type":"string","example":"3.000000","description":"Quantity of the item fulfilled to this location"},"isLegacy":{"type":"boolean","description":"Indicates the location is a legacy location. This is used to determine if this fulfillment was done before enablement of the multi-location parts feature.","example":true}}},"description":"Fulfillment information for the item's fulfillment locations."},"extraFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom Fields on the entity. Deprecated: Use `lineExtraFields` instead.","deprecated":true},"lineExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}},"partExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"321"}}}}},"costs":{"type":"array","description":"List of costs in the Purchase Order","items":{"type":"object","required":["name","type","amount"],"properties":{"id":{"type":"number","example":123,"description":"ID of the cost"},"name":{"type":"string","example":"Sales Tax","description":"Description of the cost"},"type":{"type":"string","enum":["AMOUNT_NON_TAXABLE","AMOUNT_TAXABLE","PERCENT_TAXABLE"],"example":"AMOUNT_TAXABLE","description":"Type of cost in either cents or percent. Accepted types in cents are AMOUNT_TAXABLE and AMOUNT_NON_TAXABLE. For percentage use PERCENT_TAXABLE"},"amount":{"type":"number","example":125000}}}},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the Purchase Order","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"vendorContactIds":{"type":"array","description":"List of vendor contact IDs in the Purchase Order","example":[12,34,56],"items":{"type":"number","example":12}},"shippingAddress":{"type":"object","description":"Shipping address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"billingAddress":{"type":"object","description":"Billing address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}}}}}}},"400":{"description":"Failed to create the Purchase Order","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"errors with request"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Failed to create the Purchase Order","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"User doesn't have the right permissions"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified Purchase Order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Purchase Order Not Found"}}}}}},"429":{"description":"Too many requests. Please retry in 10 seconds","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Too many requests. Please retry in 10 seconds"}}}}}}},"tags":["Purchase Orders"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]},"get":{"summary":"List purchase orders","description":"Endpoint used to list purchase order resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Purchase Orders returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"updatedAt[gte]","schema":{"type":"string","format":"date-time","description":"Return records whose updatedAt is at or after this ISO 8601 date-time (UTC).","example":"2024-01-01T00:00:00.000Z"},"in":"query"},{"name":"updatedAt[lte]","schema":{"type":"string","format":"date-time","description":"Return records whose updatedAt is at or before this ISO 8601 date-time (UTC).","example":"2024-12-31T23:59:59.999Z"},"in":"query"},{"name":"createdAt[gte]","schema":{"type":"string","format":"date-time","description":"Return records whose createdAt is at or after this ISO 8601 date-time (UTC).","example":"2024-01-01T00:00:00.000Z"},"in":"query"},{"name":"createdAt[lte]","schema":{"type":"string","format":"date-time","description":"Return records whose createdAt is at or before this ISO 8601 date-time (UTC).","example":"2024-12-31T23:59:59.999Z"},"in":"query"},{"name":"customFieldName","schema":{"type":"array","items":{"type":"string"},"description":"Filter purchase orders by custom field value. Your query parameter should be your custom field name. (ie: To filter by a custom field named \"Industry\" with the value \"Construction\", you would do this \"/purchaseorders?Industry=Construction\").\n                    <br><br>Adding multiple instance of the same custom field act as an <code>OR</code> and adding a different custom field act as an <code>AND</code>. (ie: To filter by a custom field named <code>Industry</code> with the value <code>Construction</code> OR <code>Transportation</code> AND the custom field <code>Manufacturer</code> with the value <code>ACME</code>, you would do this <code>/purchaseorders?Industry=Construction&Industry=Transportation&Manufacturer=ACME</code>).\n                    <br><br>If your custom field label is the same as a reserved query parameter such as <code>limit</code>, <code>sort</code>, <code>expand</code>, etc, you can add <code>__c</code> to your custom field filtering (ie: To filter by a custom field named <code>limit</code> with the value <code>ten</code>, you would do this <code>/purchaseorders?limit__c=ten</code>).\n                    <br><br>Note that your custom field needs to be created beforehand. Only number and single line text custom field types are supported."},"in":"query"},{"name":"statuses","schema":{"type":"array","title":"statuses filters","description":"To filter by multiple statuses: `statuses=APPROVED&statuses=COMPLETED`","items":{"type":"string","enum":["APPROVED","CANCELED","COMPLETED","DECLINED","PARTIALLY_FULFILLED","PENDING","REQUESTED"],"description":"Status of the Purchase Order."}},"in":"query"},{"in":"query","name":"sort","schema":{"description":"Attribute on which to sort the list. (for descending order, prefix attribute with '-'). ","type":"string","enum":["id","createdAt","updatedAt","-id","-createdAt","-updatedAt"]}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Purchase Orders list","content":{"application/json":{"schema":{"type":"object","required":["purchaseOrders","nextCursor","nextPageUrl"],"properties":{"purchaseOrders":{"type":"array","items":{"type":"object","required":["id","status"],"properties":{"id":{"type":"number","example":135,"description":"Global ID of the Purchase Order"},"status":{"type":"string","nullable":true,"example":"APPROVED","description":"Status of the Purchase Order. Supported values are APPROVED, CANCELED, COMPLETED, DECLINED, PARTIALLY_FULFILLED, PENDING, REQUESTED"},"updatedAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date the Purchase Order was last updated","nullable":true},"createdAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","format":"date-time","description":"Date the Purchase Order was created","nullable":true}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Purchase Orders.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Purchase Orders.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Purchase Orders"]}},"/purchaseorders/{id}":{"get":{"summary":"Get purchase order","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the purchaseOrder","example":"1"}],"responses":{"200":{"description":"Successfully retrieved purchaseOrder's information","content":{"application/json":{"schema":{"type":"object","required":["purchaseOrder"],"properties":{"purchaseOrder":{"type":"object","required":["id","note","title","reviewNote","status","dueDate","creatorId","vendorId","autoGeneratedNumber","overrideNumber","approverId","approvalDate","createdAt","updatedAt","deletedAt","items","costs","thumbnail","attachments","vendorContactIds","shippingAddress","billingAddress","extraFields"],"properties":{"id":{"type":"number","example":135,"description":"Global ID of the Purchase Order"},"note":{"type":"string","nullable":true,"description":"Notes left for Purchase Orders","example":"Please deliver during business hours"},"title":{"type":"string","nullable":true,"description":"Title of the Purchase Order.","example":"Office Supplies Order"},"reviewNote":{"type":"string","nullable":true,"description":"Notes to be left for changes to be made when sending a Purchase Order for revision","example":"Please adjust quantities and resubmit"},"status":{"type":"string","nullable":true,"example":"APPROVED","description":"Status of the Purchase Order. Supported values are APPROVED, CANCELED, COMPLETED, DECLINED, PARTIALLY_FULFILLED, PENDING, REQUESTED"},"dueDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Due date of Purchase Order","nullable":true},"creatorId":{"type":"number","example":432,"description":"ID of the user that created this Purchase Order"},"vendorId":{"type":"number","example":432,"description":"ID of vendor that this Purchase Order is associated with","nullable":true},"autoGeneratedNumber":{"type":"number","example":987,"nullable":true,"description":"Autogenerated Purchase Order number"},"overrideNumber":{"type":"string","example":"A123","nullable":true,"description":"Custom number/identifier for Purchase Order"},"approverId":{"type":"number","example":135,"description":"ID of the user who approved the Purchase Order","nullable":true},"approvalDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date the Purchase Order was approved","nullable":true},"createdAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","format":"date-time","description":"Date the Purchase Order was created","nullable":true},"updatedAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date the Purchase Order was last updated","nullable":true},"deletedAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","format":"date-time","description":"Date at which the Purchase Order was deleted","nullable":true},"items":{"type":"array","description":"List of items in the Purchase Order","items":{"type":"object","required":["id","quantityOrdered"],"properties":{"id":{"type":"number","example":23,"description":"ID of the item"},"partId":{"type":"number","example":43,"description":"ID of the part this item is related to","nullable":true},"name":{"type":"string","nullable":true},"partNumber":{"type":"string","nullable":true},"price":{"type":"number","example":25000,"nullable":true,"description":"Total price of items in cents"},"priceDecimal":{"type":"string","example":"250.000000","nullable":true,"description":"Total price of items as a decimal value"},"quantityOrdered":{"type":"number","example":4,"description":"Represent the amount of units for this item that were ordered in the purchase order."},"quantityReceived":{"type":"number","example":3,"nullable":true,"description":"Represents the total amount of this specific item that has been received to date."},"unitCost":{"type":"number","example":125000,"nullable":true,"description":"Price of a single item in cents"},"unitCostDecimal":{"type":"string","example":"1250.000000","nullable":true,"description":"Price of a single item as a decimal value"},"fulfillments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","example":23,"description":"ID of the item fulfillment"},"locationId":{"type":"number","example":852,"nullable":true,"description":"ID of the location where the item was fulfilled"},"quantityReceived":{"type":"string","example":"3.000000","description":"Quantity of the item fulfilled to this location"},"isLegacy":{"type":"boolean","description":"Indicates the location is a legacy location. This is used to determine if this fulfillment was done before enablement of the multi-location parts feature.","example":true}}},"description":"Fulfillment information for the item's fulfillment locations."},"extraFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom Fields on the entity. Deprecated: Use `lineExtraFields` instead.","deprecated":true},"lineExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}},"partExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"321"}}}}},"costs":{"type":"array","description":"List of costs in the Purchase Order","items":{"type":"object","required":["name","type","amount"],"properties":{"id":{"type":"number","example":123,"description":"ID of the cost"},"name":{"type":"string","example":"Sales Tax","description":"Description of the cost"},"type":{"type":"string","enum":["AMOUNT_NON_TAXABLE","AMOUNT_TAXABLE","PERCENT_TAXABLE"],"example":"AMOUNT_TAXABLE","description":"Type of cost in either cents or percent. Accepted types in cents are AMOUNT_TAXABLE and AMOUNT_NON_TAXABLE. For percentage use PERCENT_TAXABLE"},"amount":{"type":"number","example":125000}}}},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the Purchase Order","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"vendorContactIds":{"type":"array","description":"List of vendor contact IDs in the Purchase Order","example":[12,34,56],"items":{"type":"number","example":12}},"shippingAddress":{"type":"object","description":"Shipping address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"billingAddress":{"type":"object","description":"Billing address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified purchaseOrder or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Purchase Orders"]},"patch":{"summary":"Update purchase order","parameters":[{"schema":{"type":"number"},"name":"id","required":true,"in":"path","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"200":{"description":"Successfully updated Purchase Order","content":{"application/json":{"schema":{"type":"object","required":["purchaseOrder"],"properties":{"purchaseOrder":{"type":"object","properties":{"id":{"type":"number","example":135,"description":"Global ID of the Purchase Order"},"note":{"type":"string","nullable":true,"description":"Notes left for Purchase Orders","example":"Please deliver during business hours"},"title":{"type":"string","nullable":true,"description":"Title of the Purchase Order.","example":"Office Supplies Order"},"reviewNote":{"type":"string","nullable":true,"description":"Notes to be left for changes to be made when sending a Purchase Order for revision","example":"Please adjust quantities and resubmit"},"status":{"type":"string","nullable":true,"example":"APPROVED","description":"Status of the Purchase Order. Supported values are APPROVED, CANCELED, COMPLETED, DECLINED, PARTIALLY_FULFILLED, PENDING, REQUESTED"},"dueDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Due date of Purchase Order","nullable":true},"creatorId":{"type":"number","example":432,"description":"ID of the user that created this Purchase Order"},"vendorId":{"type":"number","example":432,"description":"ID of vendor that this Purchase Order is associated with","nullable":true},"autoGeneratedNumber":{"type":"number","example":987,"nullable":true,"description":"Autogenerated Purchase Order number"},"overrideNumber":{"type":"string","example":"A123","nullable":true,"description":"Custom number/identifier for Purchase Order"},"approverId":{"type":"number","example":135,"description":"ID of the user who approved the Purchase Order","nullable":true},"approvalDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date the Purchase Order was approved","nullable":true},"createdAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","format":"date-time","description":"Date the Purchase Order was created","nullable":true},"updatedAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date the Purchase Order was last updated","nullable":true},"deletedAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","format":"date-time","description":"Date at which the Purchase Order was deleted","nullable":true},"items":{"type":"array","description":"List of items in the Purchase Order","items":{"type":"object","required":["id","quantityOrdered"],"properties":{"id":{"type":"number","example":23,"description":"ID of the item"},"partId":{"type":"number","example":43,"description":"ID of the part this item is related to","nullable":true},"name":{"type":"string","nullable":true},"partNumber":{"type":"string","nullable":true},"price":{"type":"number","example":25000,"nullable":true,"description":"Total price of items in cents"},"priceDecimal":{"type":"string","example":"250.000000","nullable":true,"description":"Total price of items as a decimal value"},"quantityOrdered":{"type":"number","example":4,"description":"Represent the amount of units for this item that were ordered in the purchase order."},"quantityReceived":{"type":"number","example":3,"nullable":true,"description":"Represents the total amount of this specific item that has been received to date."},"unitCost":{"type":"number","example":125000,"nullable":true,"description":"Price of a single item in cents"},"unitCostDecimal":{"type":"string","example":"1250.000000","nullable":true,"description":"Price of a single item as a decimal value"},"fulfillments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","example":23,"description":"ID of the item fulfillment"},"locationId":{"type":"number","example":852,"nullable":true,"description":"ID of the location where the item was fulfilled"},"quantityReceived":{"type":"string","example":"3.000000","description":"Quantity of the item fulfilled to this location"},"isLegacy":{"type":"boolean","description":"Indicates the location is a legacy location. This is used to determine if this fulfillment was done before enablement of the multi-location parts feature.","example":true}}},"description":"Fulfillment information for the item's fulfillment locations."},"extraFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom Fields on the entity. Deprecated: Use `lineExtraFields` instead.","deprecated":true},"lineExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}},"partExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"321"}}}}},"costs":{"type":"array","description":"List of costs in the Purchase Order","items":{"type":"object","required":["name","type","amount"],"properties":{"id":{"type":"number","example":123,"description":"ID of the cost"},"name":{"type":"string","example":"Sales Tax","description":"Description of the cost"},"type":{"type":"string","enum":["AMOUNT_NON_TAXABLE","AMOUNT_TAXABLE","PERCENT_TAXABLE"],"example":"AMOUNT_TAXABLE","description":"Type of cost in either cents or percent. Accepted types in cents are AMOUNT_TAXABLE and AMOUNT_NON_TAXABLE. For percentage use PERCENT_TAXABLE"},"amount":{"type":"number","example":125000}}}},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the Purchase Order","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"vendorContactIds":{"type":"array","description":"List of vendor contact IDs in the Purchase Order","example":[12,34,56],"items":{"type":"number","example":12}},"shippingAddress":{"type":"object","description":"Shipping address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"billingAddress":{"type":"object","description":"Billing address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}}},"required":["id","status","items"]}}}}}},"400":{"description":"Failed to update the Purchase Order","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"error with the request"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Failed to update the Purchase Order","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"User doesn't have the right permissions"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified Purchase Order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Purchase Order Not Found"}}}}}}},"requestBody":{"description":"Purchase Order to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","nullable":true,"description":"Notes left for Purchase Orders","example":"Please deliver during business hours"},"reviewNote":{"type":"string","nullable":true,"description":"Notes to be left for changes to be made when sending a Purchase Order for revision","example":"Please adjust quantities and resubmit"},"status":{"type":"string","nullable":true,"example":"APPROVED","description":"Please use the [PATCH /purchaseorders/{id}/status](#tag/Purchase-Orders/paths/~1purchaseorders~1{id}~1status/patch) endpoint instead.","deprecated":true},"dueDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Due date of Purchase Order","nullable":true},"vendorId":{"type":"number","example":432,"description":"ID of vendor that this Purchase Order is associated with","nullable":true},"overrideNumber":{"type":"string","example":"A123","nullable":true,"description":"Custom number/identifier for Purchase Order"},"deletedAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","format":"date-time","description":"Date at which the Purchase Order was deleted","nullable":true},"costs":{"type":"array","description":"List of costs in the Purchase Order","items":{"type":"object","required":["name","type","amount"],"properties":{"id":{"type":"number","example":123,"description":"ID of the cost"},"name":{"type":"string","example":"Sales Tax","description":"Description of the cost"},"type":{"type":"string","enum":["AMOUNT_NON_TAXABLE","AMOUNT_TAXABLE","PERCENT_TAXABLE"],"example":"AMOUNT_TAXABLE","description":"Type of cost in either cents or percent. Accepted types in cents are AMOUNT_TAXABLE and AMOUNT_NON_TAXABLE. For percentage use PERCENT_TAXABLE"},"amount":{"type":"number","example":125000}}}},"vendorContactIds":{"type":"array","description":"List of vendor contact IDs in the Purchase Order","example":[12,34,56],"items":{"type":"number","example":12}},"shippingAddress":{"type":"object","description":"Shipping address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"shippingAddressId":{"type":"number","description":"Shipping address Id in the Purchase Order","nullable":true},"billingAddress":{"type":"object","description":"Billing address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"billingAddressId":{"type":"number","description":"Billing address Id in the Purchase Order","nullable":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}},"items":{"type":"array","description":"List of items in the Purchase Order","items":{"type":"object","required":["quantityOrdered"],"properties":{"id":{"type":"number","example":23,"description":"ID of the item"},"partId":{"type":"number","example":43,"description":"ID of the part this item is related to","nullable":true},"name":{"type":"string","nullable":true},"partNumber":{"type":"string","nullable":true},"price":{"type":"number","example":25000,"nullable":true,"description":"Total price of items in cents"},"quantityOrdered":{"type":"number","example":4,"description":"Represent the amount of units for this item that were ordered in the purchase order."},"unitCost":{"type":"number","example":125000,"nullable":true,"description":"Price of a single item in cents"},"extraFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom Fields on the entity. Deprecated: Use `lineExtraFields` instead.","deprecated":true},"lineExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}},"quantityReceived":{"type":"number","example":3,"nullable":true,"description":"Represents the total amount of this specific item that has been received to date.","deprecated":true}}}},"title":{"type":"string","nullable":true,"description":"Title of the Purchase Order. Will be ignored if organization setting for custom purchase order titles is disabled.","example":"Office Supplies Order"}}}}}},"tags":["Purchase Orders"]},"delete":{"summary":"Delete purchaseOrder","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the purchaseOrder","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the purchaseOrder"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified purchaseOrder.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"purchaseOrder Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Purchase Orders"]}},"/purchaseorders/{id}/attachments/{filename}":{"put":{"summary":"Update purchase order attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the purchase order.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"datasheet.pdf"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the attachment.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"application/x-indesign":{"schema":{"type":"object","format":"binary"}},"application/epub+zip":{"schema":{"type":"object","format":"binary"}},"application/x-xpinstall":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"schema":{"type":"object","format":"binary"}},"application/zip":{"schema":{"type":"object","format":"binary"}},"application/x-tar":{"schema":{"type":"object","format":"binary"}},"application/x-rar-compressed":{"schema":{"type":"object","format":"binary"}},"application/gzip":{"schema":{"type":"object","format":"binary"}},"application/x-bzip2":{"schema":{"type":"object","format":"binary"}},"application/x-7z-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-apple-diskimage":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.arrow.file":{"schema":{"type":"object","format":"binary"}},"video/mp4":{"schema":{"type":"object","format":"binary"}},"audio/midi":{"schema":{"type":"object","format":"binary"}},"video/matroska":{"schema":{"type":"object","format":"binary"}},"video/webm":{"schema":{"type":"object","format":"binary"}},"video/quicktime":{"schema":{"type":"object","format":"binary"}},"video/vnd.avi":{"schema":{"type":"object","format":"binary"}},"audio/wav":{"schema":{"type":"object","format":"binary"}},"audio/qcelp":{"schema":{"type":"object","format":"binary"}},"audio/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"video/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-asf":{"schema":{"type":"object","format":"binary"}},"video/mpeg":{"schema":{"type":"object","format":"binary"}},"video/3gpp":{"schema":{"type":"object","format":"binary"}},"audio/mpeg":{"schema":{"type":"object","format":"binary"}},"audio/mp4":{"schema":{"type":"object","format":"binary"}},"video/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg; codecs=opus":{"schema":{"type":"object","format":"binary"}},"application/ogg":{"schema":{"type":"object","format":"binary"}},"audio/flac":{"schema":{"type":"object","format":"binary"}},"audio/ape":{"schema":{"type":"object","format":"binary"}},"audio/wavpack":{"schema":{"type":"object","format":"binary"}},"audio/amr":{"schema":{"type":"object","format":"binary"}},"application/pdf":{"schema":{"type":"object","format":"binary"}},"application/x-elf":{"schema":{"type":"object","format":"binary"}},"application/x-mach-binary":{"schema":{"type":"object","format":"binary"}},"application/x-msdownload":{"schema":{"type":"object","format":"binary"}},"application/x-shockwave-flash":{"schema":{"type":"object","format":"binary"}},"application/rtf":{"schema":{"type":"object","format":"binary"}},"application/wasm":{"schema":{"type":"object","format":"binary"}},"font/woff":{"schema":{"type":"object","format":"binary"}},"font/woff2":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-fontobject":{"schema":{"type":"object","format":"binary"}},"font/ttf":{"schema":{"type":"object","format":"binary"}},"font/otf":{"schema":{"type":"object","format":"binary"}},"font/collection":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"video/x-flv":{"schema":{"type":"object","format":"binary"}},"application/postscript":{"schema":{"type":"object","format":"binary"}},"application/eps":{"schema":{"type":"object","format":"binary"}},"application/x-xz":{"schema":{"type":"object","format":"binary"}},"application/x-sqlite3":{"schema":{"type":"object","format":"binary"}},"application/x-nintendo-nes-rom":{"schema":{"type":"object","format":"binary"}},"application/x-google-chrome-extension":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-cab-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-deb":{"schema":{"type":"object","format":"binary"}},"application/x-unix-archive":{"schema":{"type":"object","format":"binary"}},"application/x-rpm":{"schema":{"type":"object","format":"binary"}},"application/x-compress":{"schema":{"type":"object","format":"binary"}},"application/lzip":{"schema":{"type":"object","format":"binary"}},"application/x-cfb":{"schema":{"type":"object","format":"binary"}},"application/x-mie":{"schema":{"type":"object","format":"binary"}},"application/mxf":{"schema":{"type":"object","format":"binary"}},"video/mp2t":{"schema":{"type":"object","format":"binary"}},"application/x-blender":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"audio/aiff":{"schema":{"type":"object","format":"binary"}},"application/xml":{"schema":{"type":"object","format":"binary"}},"application/x-mobipocket-ebook":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"application/dicom":{"schema":{"type":"object","format":"binary"}},"audio/x-musepack":{"schema":{"type":"object","format":"binary"}},"text/calendar":{"schema":{"type":"object","format":"binary"}},"text/vcard":{"schema":{"type":"object","format":"binary"}},"text/vtt":{"schema":{"type":"object","format":"binary"}},"model/gltf-binary":{"schema":{"type":"object","format":"binary"}},"application/vnd.tcpdump.pcap":{"schema":{"type":"object","format":"binary"}},"audio/x-dsf":{"schema":{"type":"object","format":"binary"}},"application/x-ms-shortcut":{"schema":{"type":"object","format":"binary"}},"application/x-ft-apple.alias":{"schema":{"type":"object","format":"binary"}},"audio/x-voc":{"schema":{"type":"object","format":"binary"}},"audio/vnd.dolby.dd-raw":{"schema":{"type":"object","format":"binary"}},"audio/x-m4a":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"video/x-m4v":{"schema":{"type":"object","format":"binary"}},"video/3gpp2":{"schema":{"type":"object","format":"binary"}},"application/x-esri-shape":{"schema":{"type":"object","format":"binary"}},"audio/aac":{"schema":{"type":"object","format":"binary"}},"audio/x-it":{"schema":{"type":"object","format":"binary"}},"audio/x-s3m":{"schema":{"type":"object","format":"binary"}},"audio/x-xm":{"schema":{"type":"object","format":"binary"}},"video/mp1s":{"schema":{"type":"object","format":"binary"}},"video/mp2p":{"schema":{"type":"object","format":"binary"}},"application/vnd.sketchup.skp":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"application/x-lzh-compressed":{"schema":{"type":"object","format":"binary"}},"application/pgp-encrypted":{"schema":{"type":"object","format":"binary"}},"application/x-asar":{"schema":{"type":"object","format":"binary"}},"model/stl":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-htmlhelp":{"schema":{"type":"object","format":"binary"}},"model/3mf":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"application/zstd":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-outlook":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.parquet":{"schema":{"type":"object","format":"binary"}},"application/java-vm":{"schema":{"type":"object","format":"binary"}},"application/x-arj":{"schema":{"type":"object","format":"binary"}},"application/x-cpio":{"schema":{"type":"object","format":"binary"}},"application/x-ace-compressed":{"schema":{"type":"object","format":"binary"}},"application/avro":{"schema":{"type":"object","format":"binary"}},"application/vnd.iccprofile":{"schema":{"type":"object","format":"binary"}},"application/x-ft-fbx":{"schema":{"type":"object","format":"binary"}},"application/vnd.visio":{"schema":{"type":"object","format":"binary"}},"application/vnd.android.package-archive":{"schema":{"type":"object","format":"binary"}},"application/x-ft-draco":{"schema":{"type":"object","format":"binary"}},"application/x-lz4":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.sheet.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.document.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/java-archive":{"schema":{"type":"object","format":"binary"}},"application/vnd.rn-realmedia":{"schema":{"type":"object","format":"binary"}},"application/x-spss-sav":{"schema":{"type":"object","format":"binary"}},"application/x-ms-regedit":{"schema":{"type":"object","format":"binary"}},"application/x-ft-windows-registry-hive":{"schema":{"type":"object","format":"binary"}},"application/x-jmp-data":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.keynote":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.numbers":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.pages":{"schema":{"type":"object","format":"binary"}},"application/x-apache-arrow":{"schema":{"type":"object","format":"binary"}},"application/x-lzip":{"schema":{"type":"object","format":"binary"}},"application/x.apple.alias":{"schema":{"type":"object","format":"binary"}},"application/x.ms.shortcut":{"schema":{"type":"object","format":"binary"}},"audio/opus":{"schema":{"type":"object","format":"binary"}},"audio/vnd.wave":{"schema":{"type":"object","format":"binary"}},"audio/x-flac":{"schema":{"type":"object","format":"binary"}},"video/x-matroska":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated purchase order's attachment.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified purchase order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"purchase order Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Purchase Orders"]},"delete":{"summary":"Remove purchase order attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the purchase order.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"attachment.xls"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully removed purchase order's attachment."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Attachment.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment Not Found"}}}}}}},"tags":["Purchase Orders"]}},"/purchaseorders/{id}/comments":{"post":{"summary":"Create new comment on a purchase order","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"Global ID of the purchase order","example":"12345"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Comment to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"string","description":"Content of the comment to post"}}}}}},"responses":{"201":{"description":"Successfully created the comment","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number","description":"Global ID of the comment"}}}}}},"400":{"description":"Failed to create the comment","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"should have required property 'content'","fieldPath":"content"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Purchase Order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Purchase Order Not Found"}}}}}}},"tags":["Purchase Orders"]}},"/purchaseorders/{id}/emails":{"post":{"summary":"Send Purchase Order as an email","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"Global ID of the Purchase Order","example":"123"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"If you do not provide any emails, the system will attempt to send the email to the vendor contacts associated with the Purchase Order. If you provide an invalid email address, it will be ignored.","content":{"application/json":{"schema":{"type":"object","properties":{"emails":{"type":"array","description":"Emails to send the Purchase Order to","nullable":true,"items":{"type":"string","example":"example@gmail.com"}},"emailsCC":{"type":"array","description":"Emails to send the Purchase Order to as a carbon copy (CC)","nullable":true,"items":{"type":"string","example":"example@gmail.com"}}}}}}},"responses":{"201":{"description":"Successfully created the email","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"Global ID of the Purchase Order","example":12345}}}}}},"400":{"description":"Failed to create the email","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"An error occurred while sending the email","fieldPath":"type"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"You do not have permission to send this email","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Forbidden","fieldPath":"type"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified Purchase Order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Purchase Order Not Found"}}}}}}},"tags":["Purchase Orders"]}},"/purchaseorders/{id}/fulfillment":{"patch":{"summary":"Fulfill purchase order","parameters":[{"schema":{"type":"number"},"name":"id","required":true,"in":"path","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"200":{"description":"Successfully updated Purchase Order","content":{"application/json":{"schema":{"type":"object","required":["purchaseOrder"],"properties":{"purchaseOrder":{"type":"object","properties":{"id":{"type":"number","example":135,"description":"Global ID of the Purchase Order"},"note":{"type":"string","nullable":true,"description":"Notes left for Purchase Orders","example":"Please deliver during business hours"},"title":{"type":"string","nullable":true,"description":"Title of the Purchase Order.","example":"Office Supplies Order"},"reviewNote":{"type":"string","nullable":true,"description":"Notes to be left for changes to be made when sending a Purchase Order for revision","example":"Please adjust quantities and resubmit"},"status":{"type":"string","nullable":true,"example":"APPROVED","description":"Status of the Purchase Order. Supported values are APPROVED, CANCELED, COMPLETED, DECLINED, PARTIALLY_FULFILLED, PENDING, REQUESTED"},"dueDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Due date of Purchase Order","nullable":true},"creatorId":{"type":"number","example":432,"description":"ID of the user that created this Purchase Order"},"vendorId":{"type":"number","example":432,"description":"ID of vendor that this Purchase Order is associated with","nullable":true},"autoGeneratedNumber":{"type":"number","example":987,"nullable":true,"description":"Autogenerated Purchase Order number"},"overrideNumber":{"type":"string","example":"A123","nullable":true,"description":"Custom number/identifier for Purchase Order"},"approverId":{"type":"number","example":135,"description":"ID of the user who approved the Purchase Order","nullable":true},"approvalDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date the Purchase Order was approved","nullable":true},"createdAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","format":"date-time","description":"Date the Purchase Order was created","nullable":true},"updatedAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date the Purchase Order was last updated","nullable":true},"deletedAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","format":"date-time","description":"Date at which the Purchase Order was deleted","nullable":true},"items":{"type":"array","description":"List of items in the Purchase Order","items":{"type":"object","required":["id","quantityOrdered"],"properties":{"id":{"type":"number","example":23,"description":"ID of the item"},"partId":{"type":"number","example":43,"description":"ID of the part this item is related to","nullable":true},"name":{"type":"string","nullable":true},"partNumber":{"type":"string","nullable":true},"price":{"type":"number","example":25000,"nullable":true,"description":"Total price of items in cents"},"priceDecimal":{"type":"string","example":"250.000000","nullable":true,"description":"Total price of items as a decimal value"},"quantityOrdered":{"type":"number","example":4,"description":"Represent the amount of units for this item that were ordered in the purchase order."},"quantityReceived":{"type":"number","example":3,"nullable":true,"description":"Represents the total amount of this specific item that has been received to date."},"unitCost":{"type":"number","example":125000,"nullable":true,"description":"Price of a single item in cents"},"unitCostDecimal":{"type":"string","example":"1250.000000","nullable":true,"description":"Price of a single item as a decimal value"},"fulfillments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","example":23,"description":"ID of the item fulfillment"},"locationId":{"type":"number","example":852,"nullable":true,"description":"ID of the location where the item was fulfilled"},"quantityReceived":{"type":"string","example":"3.000000","description":"Quantity of the item fulfilled to this location"},"isLegacy":{"type":"boolean","description":"Indicates the location is a legacy location. This is used to determine if this fulfillment was done before enablement of the multi-location parts feature.","example":true}}},"description":"Fulfillment information for the item's fulfillment locations."},"extraFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom Fields on the entity. Deprecated: Use `lineExtraFields` instead.","deprecated":true},"lineExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}},"partExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"321"}}}}},"costs":{"type":"array","description":"List of costs in the Purchase Order","items":{"type":"object","required":["name","type","amount"],"properties":{"id":{"type":"number","example":123,"description":"ID of the cost"},"name":{"type":"string","example":"Sales Tax","description":"Description of the cost"},"type":{"type":"string","enum":["AMOUNT_NON_TAXABLE","AMOUNT_TAXABLE","PERCENT_TAXABLE"],"example":"AMOUNT_TAXABLE","description":"Type of cost in either cents or percent. Accepted types in cents are AMOUNT_TAXABLE and AMOUNT_NON_TAXABLE. For percentage use PERCENT_TAXABLE"},"amount":{"type":"number","example":125000}}}},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the Purchase Order","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"vendorContactIds":{"type":"array","description":"List of vendor contact IDs in the Purchase Order","example":[12,34,56],"items":{"type":"number","example":12}},"shippingAddress":{"type":"object","description":"Shipping address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"billingAddress":{"type":"object","description":"Billing address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}}},"required":["id","status","items"]}}}}}},"400":{"description":"Failed to update the Purchase Order","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"error with the request"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Failed to update the Purchase Order","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"User doesn't have the right permissions"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified Purchase Order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Purchase Order Not Found"}}}}}}},"requestBody":{"description":"Purchase Order items to update","required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","description":"List of items in the Purchase Order","items":{"required":["id"],"oneOf":[{"type":"object","required":["id","fulfillments"],"properties":{"id":{"type":"number","example":23,"description":"ID of the item"},"unitCost":{"type":"number","example":125000,"description":"Price of a single item in cents"},"fulfillments":{"type":"array","items":{"type":"object","required":["quantityReceived"],"properties":{"id":{"type":"number","description":"ID of the item fulfillment","example":87},"locationId":{"type":"number","description":"ID of the location","example":852},"quantityReceived":{"type":"number","description":"Quantity of the item in this location","example":3},"isLegacy":{"type":"boolean","description":"Indicates the location is a legacy location. This is used to determine if this fulfillment was done before enablement of the multi-location parts feature.","example":true}}}}}},{"deprecated":true,"type":"object","required":["id","quantityReceived"],"properties":{"quantityReceived":{"type":"number","example":3,"description":"Quantity received for this specific item that has been received to date. Using this field will disable multi-location part on your organization. See https://help.getmaintainx.com/multi-location-parts#integration-issues-with-multi-location-parts for more information."},"id":{"type":"number","example":23,"description":"ID of the item"},"unitCost":{"type":"number","example":125000,"description":"Price of a single item in cents"}}}]}}}}}}},"tags":["Purchase Orders"]}},"/purchaseorders/{id}/status":{"patch":{"summary":"Update purchase order status","parameters":[{"schema":{"type":"number"},"name":"id","required":true,"in":"path","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"200":{"description":"Successfully updated Purchase Order","content":{"application/json":{"schema":{"type":"object","required":["purchaseOrder"],"properties":{"purchaseOrder":{"type":"object","properties":{"id":{"type":"number","example":135,"description":"Global ID of the Purchase Order"},"note":{"type":"string","nullable":true,"description":"Notes left for Purchase Orders","example":"Please deliver during business hours"},"title":{"type":"string","nullable":true,"description":"Title of the Purchase Order.","example":"Office Supplies Order"},"reviewNote":{"type":"string","nullable":true,"description":"Notes to be left for changes to be made when sending a Purchase Order for revision","example":"Please adjust quantities and resubmit"},"status":{"type":"string","nullable":true,"example":"APPROVED","description":"Status of the Purchase Order. Supported values are APPROVED, CANCELED, COMPLETED, DECLINED, PARTIALLY_FULFILLED, PENDING, REQUESTED"},"dueDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Due date of Purchase Order","nullable":true},"creatorId":{"type":"number","example":432,"description":"ID of the user that created this Purchase Order"},"vendorId":{"type":"number","example":432,"description":"ID of vendor that this Purchase Order is associated with","nullable":true},"autoGeneratedNumber":{"type":"number","example":987,"nullable":true,"description":"Autogenerated Purchase Order number"},"overrideNumber":{"type":"string","example":"A123","nullable":true,"description":"Custom number/identifier for Purchase Order"},"approverId":{"type":"number","example":135,"description":"ID of the user who approved the Purchase Order","nullable":true},"approvalDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date the Purchase Order was approved","nullable":true},"createdAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","format":"date-time","description":"Date the Purchase Order was created","nullable":true},"updatedAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date the Purchase Order was last updated","nullable":true},"deletedAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","format":"date-time","description":"Date at which the Purchase Order was deleted","nullable":true},"items":{"type":"array","description":"List of items in the Purchase Order","items":{"type":"object","required":["id","quantityOrdered"],"properties":{"id":{"type":"number","example":23,"description":"ID of the item"},"partId":{"type":"number","example":43,"description":"ID of the part this item is related to","nullable":true},"name":{"type":"string","nullable":true},"partNumber":{"type":"string","nullable":true},"price":{"type":"number","example":25000,"nullable":true,"description":"Total price of items in cents"},"priceDecimal":{"type":"string","example":"250.000000","nullable":true,"description":"Total price of items as a decimal value"},"quantityOrdered":{"type":"number","example":4,"description":"Represent the amount of units for this item that were ordered in the purchase order."},"quantityReceived":{"type":"number","example":3,"nullable":true,"description":"Represents the total amount of this specific item that has been received to date."},"unitCost":{"type":"number","example":125000,"nullable":true,"description":"Price of a single item in cents"},"unitCostDecimal":{"type":"string","example":"1250.000000","nullable":true,"description":"Price of a single item as a decimal value"},"fulfillments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","example":23,"description":"ID of the item fulfillment"},"locationId":{"type":"number","example":852,"nullable":true,"description":"ID of the location where the item was fulfilled"},"quantityReceived":{"type":"string","example":"3.000000","description":"Quantity of the item fulfilled to this location"},"isLegacy":{"type":"boolean","description":"Indicates the location is a legacy location. This is used to determine if this fulfillment was done before enablement of the multi-location parts feature.","example":true}}},"description":"Fulfillment information for the item's fulfillment locations."},"extraFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom Fields on the entity. Deprecated: Use `lineExtraFields` instead.","deprecated":true},"lineExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}},"partExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"321"}}}}},"costs":{"type":"array","description":"List of costs in the Purchase Order","items":{"type":"object","required":["name","type","amount"],"properties":{"id":{"type":"number","example":123,"description":"ID of the cost"},"name":{"type":"string","example":"Sales Tax","description":"Description of the cost"},"type":{"type":"string","enum":["AMOUNT_NON_TAXABLE","AMOUNT_TAXABLE","PERCENT_TAXABLE"],"example":"AMOUNT_TAXABLE","description":"Type of cost in either cents or percent. Accepted types in cents are AMOUNT_TAXABLE and AMOUNT_NON_TAXABLE. For percentage use PERCENT_TAXABLE"},"amount":{"type":"number","example":125000}}}},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the Purchase Order","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"vendorContactIds":{"type":"array","description":"List of vendor contact IDs in the Purchase Order","example":[12,34,56],"items":{"type":"number","example":12}},"shippingAddress":{"type":"object","description":"Shipping address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"billingAddress":{"type":"object","description":"Billing address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}}},"required":["id","status","items"]}}}}}},"400":{"description":"Failed to update the Purchase Order","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"error with the request"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Failed to update the Purchase Order","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"User doesn't have the right permissions"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified Purchase Order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Purchase Order Not Found"}}}}}}},"requestBody":{"description":"Purchase Order status to update. Optionally include a reviewNote when declining a purchase order to provide feedback for revision.","required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","example":"APPROVED","enum":["APPROVED","CANCELED","COMPLETED","DECLINED","PARTIALLY_FULFILLED","PENDING"],"description":"Here is a list of valid status transitions:\n| Current Status       | Allowed Transitions                       | Description                                           |\n|---------------------|------------------------------------------|-------------------------------------------------------|\n| `REQUESTED`         | `CANCELED` `DECLINED` `PENDING`          | Initial state when PO is first created                |\n| `PENDING`           | `APPROVED` `CANCELED` `DECLINED`         | PO is awaiting approval                               |\n| `DECLINED`          | `CANCELED` `PENDING`                     | PO was rejected and needs revision                    |\n| `APPROVED`          | `CANCELED` or start receiving items      | PO is approved and items can be received              |\n| `PARTIALLY_FULFILLED`| `COMPLETED`                             | Some items have been received                         |\n| `CANCELED`          | None                                     | PO has been canceled and cannot be modified           |\n| `COMPLETED`         | `PARTIALLY_FULFILLED`                    | All items have been received                          |\n\n*Notes*:\n- Status changes trigger notifications to relevant users and vendors\n- You can subscribe to status changes using [webhooks](#tag/Subscriptions-and-Webhooks)\n- The `DECLINED` status is displayed as 'Rejected' in the application interface\n- Moving to `PARTIALLY_FULFILLED` happens automatically when items are received\n- Use the optional `reviewNote` field to provide feedback when declining a purchase order"},"reviewNote":{"type":"string","nullable":true,"description":"Notes to be left for changes to be made when sending a Purchase Order for revision","example":"Please adjust quantities and resubmit"}}}}}},"tags":["Purchase Orders"]}},"/purchaseorders/{id}/thumbnail/{filename}":{"put":{"summary":"Update purchase order's thumbnail","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the purchase order.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the purchase order thumbnail, including the extension.","example":"motor.png"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the thumbnail.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated purchase order's thumbnail.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"You cannot edit this entity.","fieldPath":"organizationId","fieldValue":"1"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Purchase Order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Purchase Order Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Purchase Orders"]}},"/proceduretemplates":{"post":{"summary":"Create procedure template","requestBody":{"description":"The procedure template to create","required":true,"content":{"application/json":{"schema":{"type":"object","description":"The procedure template data","required":["title","fields"],"properties":{"title":{"type":"string","example":"Ladder Inspection Checklist"},"fields":{"type":"array","items":{"type":"object","required":["type","label"],"properties":{"label":{"type":"string","example":"Metal Parts: broken, loose, dented, rusty, missing"},"type":{"type":"string","example":"INSPECTION_CHECK","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"]},"description":{"type":"string","nullable":true},"choices":{"type":"array","items":{"example":"Partially","type":"string"}},"urls":{"type":"array","items":{"type":"object","required":["link"],"properties":{"label":{"type":"string","description":"Label of the url","example":"MaintainX Website"},"link":{"type":"string","description":"Link","example":"www.getmaintainx.com"}}}},"meterId":{"type":"number","example":1,"nullable":true,"description":"Id of the meter"},"isDateAndTime":{"type":"boolean","default":false,"description":"Indicate if a DATE field also contains the time","example":false},"index":{"type":"number","example":1,"description":"Order which the row is displayed"}}}}}}}}},"responses":{"201":{"description":"Successfully created the custom fields","content":{"application/json":{"schema":{"type":"object","required":["id","fields"],"properties":{"id":{"type":"number","example":1,"description":"Id of the procedure template"},"fields":{"type":"array","items":{"type":"object","required":["id","label","type"],"properties":{"id":{"type":"number","example":1},"label":{"type":"string","example":"Metal Parts: broken, loose, dented, rusty, missing"},"type":{"type":"string","example":"INSPECTION_CHECK","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"]},"description":{"type":"string","nullable":true},"choices":{"type":"array","nullable":true,"items":{"example":"Partially","type":"string"}},"meterId":{"type":"number","nullable":true,"items":{"example":1,"type":"number"}},"isDateAndTime":{"type":"boolean","nullable":true,"description":"Indicate if a DATE field also contains the time","example":false},"attachmentId":{"type":"number","nullable":true,"example":1},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the procedure row","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"urls":{"type":"array","items":{"type":"object","required":["link"],"properties":{"label":{"type":"string","description":"Label of the url","example":"MaintainX Website"},"link":{"type":"string","description":"Link","example":"www.getmaintainx.com"}}}}}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Procedure Templates"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]},"get":{"summary":"List procedure templates","description":"Endpoint used to list procedure template resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Procedure Templates returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","type":"array","items":{"type":"string","enum":["rows"]}}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Procedure Templates list","content":{"application/json":{"schema":{"type":"object","required":["procedureTemplates","nextCursor","nextPageUrl"],"properties":{"procedureTemplates":{"type":"array","items":{"type":"object","required":["id","title"],"properties":{"id":{"type":"number","description":"Global ID of the procedure template"},"title":{"type":"string","description":"Title of the procedure template"},"rows":{"type":"array","items":{"type":"object","required":["id","label","type"],"properties":{"id":{"type":"number","example":1},"label":{"type":"string","example":"Metal Parts: broken, loose, dented, rusty, missing"},"type":{"type":"string","example":"INSPECTION_CHECK","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"]},"description":{"type":"string","nullable":true},"choices":{"type":"array","nullable":true,"items":{"example":"Partially","type":"string"}},"meterId":{"type":"number","nullable":true,"items":{"example":1,"type":"number"}},"isDateAndTime":{"type":"boolean","nullable":true,"description":"Indicate if a DATE field also contains the time","example":false},"attachmentId":{"type":"number","nullable":true,"example":1},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the procedure row","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"urls":{"type":"array","items":{"type":"object","required":["link"],"properties":{"label":{"type":"string","description":"Label of the url","example":"MaintainX Website"},"link":{"type":"string","description":"Link","example":"www.getmaintainx.com"}}}}}},"nullable":true,"description":"(expand with query parameter)"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Procedure Templates.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Procedure Templates.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Procedure Templates"]}},"/proceduretemplates/{id}":{"get":{"summary":"Get procedure template","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the procedureTemplate","example":"1"},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","type":"array","items":{"type":"string","enum":["rows"]}}}],"responses":{"200":{"description":"Successfully retrieved procedureTemplate's information","content":{"application/json":{"schema":{"type":"object","required":["procedureTemplate"],"properties":{"procedureTemplate":{"type":"object","required":["id","title","createdAt","deletedAt","updatedAt"],"properties":{"id":{"type":"number","description":"Global ID of the procedure template"},"title":{"type":"string","description":"Title of the procedure template"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the procedure template was created","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the procedure template was deleted","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the procedure template was last updated","example":"2022-01-01T00:00:00.000Z"},"rows":{"type":"array","items":{"type":"object","required":["id","label","type"],"properties":{"id":{"type":"number","example":1},"label":{"type":"string","example":"Metal Parts: broken, loose, dented, rusty, missing"},"type":{"type":"string","example":"INSPECTION_CHECK","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"]},"description":{"type":"string","nullable":true},"choices":{"type":"array","nullable":true,"items":{"example":"Partially","type":"string"}},"meterId":{"type":"number","nullable":true,"items":{"example":1,"type":"number"}},"isDateAndTime":{"type":"boolean","nullable":true,"description":"Indicate if a DATE field also contains the time","example":false},"attachmentId":{"type":"number","nullable":true,"example":1},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the procedure row","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"urls":{"type":"array","items":{"type":"object","required":["link"],"properties":{"label":{"type":"string","description":"Label of the url","example":"MaintainX Website"},"link":{"type":"string","description":"Link","example":"www.getmaintainx.com"}}}}}},"nullable":true,"description":"(expand with query parameter)"}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified procedureTemplate or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Procedure Templates"]},"patch":{"summary":"Update Procedure Template","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the procedure template","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Procedure Template to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"Title of the procedure template"},"description":{"type":"string","description":"Description of the procedure template","nullable":true},"fields":{"type":"array","items":{"type":"object","anyOf":[{"type":"object","required":["type","label"],"properties":{"label":{"type":"string","example":"Metal Parts: broken, loose, dented, rusty, missing"},"type":{"type":"string","example":"INSPECTION_CHECK","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"]},"description":{"type":"string","nullable":true},"choices":{"type":"array","items":{"example":"Partially","type":"string"}},"urls":{"type":"array","items":{"type":"object","required":["link"],"properties":{"label":{"type":"string","description":"Label of the url","example":"MaintainX Website"},"link":{"type":"string","description":"Link","example":"www.getmaintainx.com"}}}},"meterId":{"type":"number","example":1,"nullable":true,"description":"Id of the meter"},"isDateAndTime":{"type":"boolean","default":false,"description":"Indicate if a DATE field also contains the time","example":false},"index":{"type":"number","example":1,"description":"Order which the row is displayed"}},"description":"Adds a new row to the template"},{"type":"object","description":"Modify existing rows of the template","required":["id"],"properties":{"id":{"type":"number","description":"Id of an existing row","example":1},"label":{"type":"string","example":"Metal Parts: broken, loose, dented, rusty, missing"},"type":{"type":"string","example":"INSPECTION_CHECK","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"]},"description":{"type":"string","nullable":true},"choices":{"type":"array","items":{"example":"Partially","type":"string"}},"urls":{"type":"array","items":{"type":"object","required":["link"],"properties":{"label":{"type":"string","description":"Label of the url","example":"MaintainX Website"},"link":{"type":"string","description":"Link","example":"www.getmaintainx.com"}}}},"meterId":{"type":"number","example":1,"nullable":true,"description":"Id of the meter"},"isDateAndTime":{"type":"boolean","default":false,"description":"Indicate if a DATE field also contains the time","example":false},"index":{"type":"number","example":1,"description":"Order which the row is displayed"}}}]}}}}}}},"responses":{"204":{"description":"Successfully edited the procedure template"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Bad request"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified procedure template.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"procedure template Not Found"}}}}}}},"tags":["Procedure Templates"]},"delete":{"summary":"Delete procedure Template","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the procedure Template","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the procedureTemplate"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified procedureTemplate.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"procedureTemplate Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Procedure Templates"]}},"/proceduretemplaterows/{id}":{"patch":{"summary":"Update Procedure Template Row","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the procedure template row","example":1},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Procedure Template Row to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","example":"Metal Parts: broken, loose, dented, rusty, missing"},"type":{"type":"string","example":"INSPECTION_CHECK","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"]},"description":{"type":"string","nullable":true},"choices":{"type":"array","items":{"example":"Partially","type":"string"}},"urls":{"type":"array","items":{"type":"object","required":["link"],"properties":{"label":{"type":"string","description":"Label of the url","example":"MaintainX Website"},"link":{"type":"string","description":"Link","example":"www.getmaintainx.com"}}}},"meterId":{"type":"number","example":1,"nullable":true,"description":"Id of the meter"},"isDateAndTime":{"type":"boolean","default":false,"description":"Indicate if a DATE field also contains the time","example":false},"index":{"type":"number","example":1,"description":"Order which the row is displayed"}}}}}},"responses":{"200":{"description":"Successfully edited the procedure template row","content":{"application/json":{"schema":{"type":"object","required":["row"],"properties":{"row":{"type":"object","required":["id","label","type"],"properties":{"id":{"type":"number","example":1},"label":{"type":"string","example":"Metal Parts: broken, loose, dented, rusty, missing"},"type":{"type":"string","example":"INSPECTION_CHECK","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"]},"description":{"type":"string","nullable":true},"choices":{"type":"array","nullable":true,"items":{"example":"Partially","type":"string"}},"meterId":{"type":"number","nullable":true,"items":{"example":1,"type":"number"}},"isDateAndTime":{"type":"boolean","nullable":true,"description":"Indicate if a DATE field also contains the time","example":false},"attachmentId":{"type":"number","nullable":true,"example":1},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the procedure row","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"urls":{"type":"array","items":{"type":"object","required":["link"],"properties":{"label":{"type":"string","description":"Label of the url","example":"MaintainX Website"},"link":{"type":"string","description":"Link","example":"www.getmaintainx.com"}}}}}}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Bad request"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified procedure template row.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"procedure template row Not Found"}}}}}}},"tags":["Procedure Template Rows"]},"delete":{"summary":"Delete procedure Template Row","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the procedure Template Row","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the procedureTemplateRow"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified procedureTemplateRow.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"procedureTemplateRow Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Procedure Template Rows"]}},"/proceduretemplaterows/{id}/attachments":{"delete":{"summary":"Remove procedure template row attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the procedure template row.","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully removed procedure template row's attachment."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified procedure template row.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"procedure template row Not Found"}}}}}}},"tags":["Procedure Template Rows"]}},"/proceduretemplaterows/{id}/attachments/{filename}":{"put":{"summary":"Update procedure template row attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the procedure template row.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"datasheet.pdf"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the attachment.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"application/x-indesign":{"schema":{"type":"object","format":"binary"}},"application/epub+zip":{"schema":{"type":"object","format":"binary"}},"application/x-xpinstall":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"schema":{"type":"object","format":"binary"}},"application/zip":{"schema":{"type":"object","format":"binary"}},"application/x-tar":{"schema":{"type":"object","format":"binary"}},"application/x-rar-compressed":{"schema":{"type":"object","format":"binary"}},"application/gzip":{"schema":{"type":"object","format":"binary"}},"application/x-bzip2":{"schema":{"type":"object","format":"binary"}},"application/x-7z-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-apple-diskimage":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.arrow.file":{"schema":{"type":"object","format":"binary"}},"video/mp4":{"schema":{"type":"object","format":"binary"}},"audio/midi":{"schema":{"type":"object","format":"binary"}},"video/matroska":{"schema":{"type":"object","format":"binary"}},"video/webm":{"schema":{"type":"object","format":"binary"}},"video/quicktime":{"schema":{"type":"object","format":"binary"}},"video/vnd.avi":{"schema":{"type":"object","format":"binary"}},"audio/wav":{"schema":{"type":"object","format":"binary"}},"audio/qcelp":{"schema":{"type":"object","format":"binary"}},"audio/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"video/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-asf":{"schema":{"type":"object","format":"binary"}},"video/mpeg":{"schema":{"type":"object","format":"binary"}},"video/3gpp":{"schema":{"type":"object","format":"binary"}},"audio/mpeg":{"schema":{"type":"object","format":"binary"}},"audio/mp4":{"schema":{"type":"object","format":"binary"}},"video/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg; codecs=opus":{"schema":{"type":"object","format":"binary"}},"application/ogg":{"schema":{"type":"object","format":"binary"}},"audio/flac":{"schema":{"type":"object","format":"binary"}},"audio/ape":{"schema":{"type":"object","format":"binary"}},"audio/wavpack":{"schema":{"type":"object","format":"binary"}},"audio/amr":{"schema":{"type":"object","format":"binary"}},"application/pdf":{"schema":{"type":"object","format":"binary"}},"application/x-elf":{"schema":{"type":"object","format":"binary"}},"application/x-mach-binary":{"schema":{"type":"object","format":"binary"}},"application/x-msdownload":{"schema":{"type":"object","format":"binary"}},"application/x-shockwave-flash":{"schema":{"type":"object","format":"binary"}},"application/rtf":{"schema":{"type":"object","format":"binary"}},"application/wasm":{"schema":{"type":"object","format":"binary"}},"font/woff":{"schema":{"type":"object","format":"binary"}},"font/woff2":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-fontobject":{"schema":{"type":"object","format":"binary"}},"font/ttf":{"schema":{"type":"object","format":"binary"}},"font/otf":{"schema":{"type":"object","format":"binary"}},"font/collection":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"video/x-flv":{"schema":{"type":"object","format":"binary"}},"application/postscript":{"schema":{"type":"object","format":"binary"}},"application/eps":{"schema":{"type":"object","format":"binary"}},"application/x-xz":{"schema":{"type":"object","format":"binary"}},"application/x-sqlite3":{"schema":{"type":"object","format":"binary"}},"application/x-nintendo-nes-rom":{"schema":{"type":"object","format":"binary"}},"application/x-google-chrome-extension":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-cab-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-deb":{"schema":{"type":"object","format":"binary"}},"application/x-unix-archive":{"schema":{"type":"object","format":"binary"}},"application/x-rpm":{"schema":{"type":"object","format":"binary"}},"application/x-compress":{"schema":{"type":"object","format":"binary"}},"application/lzip":{"schema":{"type":"object","format":"binary"}},"application/x-cfb":{"schema":{"type":"object","format":"binary"}},"application/x-mie":{"schema":{"type":"object","format":"binary"}},"application/mxf":{"schema":{"type":"object","format":"binary"}},"video/mp2t":{"schema":{"type":"object","format":"binary"}},"application/x-blender":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"audio/aiff":{"schema":{"type":"object","format":"binary"}},"application/xml":{"schema":{"type":"object","format":"binary"}},"application/x-mobipocket-ebook":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"application/dicom":{"schema":{"type":"object","format":"binary"}},"audio/x-musepack":{"schema":{"type":"object","format":"binary"}},"text/calendar":{"schema":{"type":"object","format":"binary"}},"text/vcard":{"schema":{"type":"object","format":"binary"}},"text/vtt":{"schema":{"type":"object","format":"binary"}},"model/gltf-binary":{"schema":{"type":"object","format":"binary"}},"application/vnd.tcpdump.pcap":{"schema":{"type":"object","format":"binary"}},"audio/x-dsf":{"schema":{"type":"object","format":"binary"}},"application/x-ms-shortcut":{"schema":{"type":"object","format":"binary"}},"application/x-ft-apple.alias":{"schema":{"type":"object","format":"binary"}},"audio/x-voc":{"schema":{"type":"object","format":"binary"}},"audio/vnd.dolby.dd-raw":{"schema":{"type":"object","format":"binary"}},"audio/x-m4a":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"video/x-m4v":{"schema":{"type":"object","format":"binary"}},"video/3gpp2":{"schema":{"type":"object","format":"binary"}},"application/x-esri-shape":{"schema":{"type":"object","format":"binary"}},"audio/aac":{"schema":{"type":"object","format":"binary"}},"audio/x-it":{"schema":{"type":"object","format":"binary"}},"audio/x-s3m":{"schema":{"type":"object","format":"binary"}},"audio/x-xm":{"schema":{"type":"object","format":"binary"}},"video/mp1s":{"schema":{"type":"object","format":"binary"}},"video/mp2p":{"schema":{"type":"object","format":"binary"}},"application/vnd.sketchup.skp":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"application/x-lzh-compressed":{"schema":{"type":"object","format":"binary"}},"application/pgp-encrypted":{"schema":{"type":"object","format":"binary"}},"application/x-asar":{"schema":{"type":"object","format":"binary"}},"model/stl":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-htmlhelp":{"schema":{"type":"object","format":"binary"}},"model/3mf":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"application/zstd":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-outlook":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.parquet":{"schema":{"type":"object","format":"binary"}},"application/java-vm":{"schema":{"type":"object","format":"binary"}},"application/x-arj":{"schema":{"type":"object","format":"binary"}},"application/x-cpio":{"schema":{"type":"object","format":"binary"}},"application/x-ace-compressed":{"schema":{"type":"object","format":"binary"}},"application/avro":{"schema":{"type":"object","format":"binary"}},"application/vnd.iccprofile":{"schema":{"type":"object","format":"binary"}},"application/x-ft-fbx":{"schema":{"type":"object","format":"binary"}},"application/vnd.visio":{"schema":{"type":"object","format":"binary"}},"application/vnd.android.package-archive":{"schema":{"type":"object","format":"binary"}},"application/x-ft-draco":{"schema":{"type":"object","format":"binary"}},"application/x-lz4":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.sheet.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.document.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/java-archive":{"schema":{"type":"object","format":"binary"}},"application/vnd.rn-realmedia":{"schema":{"type":"object","format":"binary"}},"application/x-spss-sav":{"schema":{"type":"object","format":"binary"}},"application/x-ms-regedit":{"schema":{"type":"object","format":"binary"}},"application/x-ft-windows-registry-hive":{"schema":{"type":"object","format":"binary"}},"application/x-jmp-data":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.keynote":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.numbers":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.pages":{"schema":{"type":"object","format":"binary"}},"application/x-apache-arrow":{"schema":{"type":"object","format":"binary"}},"application/x-lzip":{"schema":{"type":"object","format":"binary"}},"application/x.apple.alias":{"schema":{"type":"object","format":"binary"}},"application/x.ms.shortcut":{"schema":{"type":"object","format":"binary"}},"audio/opus":{"schema":{"type":"object","format":"binary"}},"audio/vnd.wave":{"schema":{"type":"object","format":"binary"}},"audio/x-flac":{"schema":{"type":"object","format":"binary"}},"video/x-matroska":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated procedure template row's attachment.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified procedure template row.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"procedure template row Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Procedure Template Rows"]}},"/subscriptions":{"post":{"summary":"Create new subscription","requestBody":{"description":"Subscription to create","required":true,"content":{"application/json":{"schema":{"type":"object","oneOf":[{"title":"API Token Created","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["API_TOKEN_CREATED"],"example":"API_TOKEN_CREATED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"API Token Revoked","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["API_TOKEN_REVOKED"],"example":"API_TOKEN_REVOKED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"Asset Status Change","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["ASSET_STATUS_CHANGE"],"example":"ASSET_STATUS_CHANGE"},"url":{"type":"string","example":"https://example.com"},"filters":{"type":"object","description":"Possible filters.","properties":{"oneOfAssetStatusTypes":{"type":"array","description":"Asset status types that will trigger the webhook","items":{"title":"Status","type":"string","enum":["IGNORE","OFFLINE","ONLINE"]}},"oneOfCustomAssetStatusesIds":{"type":"array","description":"Custom status ids that will trigger the webhook","items":{"type":"number"}}}}}},{"title":"Connector Token Revoked","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["CONNECTOR_TOKEN_REVOKED"],"example":"CONNECTOR_TOKEN_REVOKED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"Customer Change","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["CUSTOMER_CHANGE"],"example":"CUSTOMER_CHANGE"},"url":{"type":"string","example":"https://example.com"}}},{"title":"Data Export Initiated","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["DATA_EXPORT_INITIATED"],"example":"DATA_EXPORT_INITIATED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"Invite Link Archived","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["INVITE_LINK_ARCHIVED"],"example":"INVITE_LINK_ARCHIVED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"Invite Link Created","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["INVITE_LINK_CREATED"],"example":"INVITE_LINK_CREATED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"Invite Link Updated","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["INVITE_LINK_UPDATED"],"example":"INVITE_LINK_UPDATED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"Meter Trigger Status Change","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["METER_TRIGGER_STATE_CHANGE"],"example":"METER_TRIGGER_STATE_CHANGE"},"url":{"type":"string","example":"https://example.com"},"filters":{"type":"object","description":"Possible filters.","properties":{"oneOfStates":{"type":"array","description":"States that will trigger the webhook.","items":{"title":"State","type":"string","enum":["INACTIVE","INSUFFICIENT_DATA","PENDING","STABLE","TRIGGERED"]}}}}}},{"title":"New Asset","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["NEW_ASSET"],"example":"NEW_ASSET"},"url":{"type":"string","example":"https://example.com"},"options":{"type":"object","description":"Possible options","properties":{"serializeEntity":{"type":"boolean","description":"If true, the webhook will receive the Asset data"}}}}},{"title":"New Category on Work Order","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["NEW_CATEGORY_ON_WORK_ORDER"],"example":"NEW_CATEGORY_ON_WORK_ORDER"},"url":{"type":"string","example":"https://example.com"},"filters":{"type":"object","description":"Possible filters.","properties":{"oneOfCategories":{"type":"array","description":"At least one of those categories should be on the work order to trigger the webhook.","items":{"oneOf":[{"title":"Name","type":"string","description":"Category name"},{"title":"ID","type":"integer","description":"Global ID of a category"}]}}}}}},{"title":"New Comment on Work Order","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["NEW_COMMENT_ON_WORK_ORDER"],"example":"NEW_COMMENT_ON_WORK_ORDER"},"url":{"type":"string","example":"https://example.com"}}},{"title":"New Customer","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["NEW_CUSTOMER"],"example":"NEW_CUSTOMER"},"url":{"type":"string","example":"https://example.com"}}},{"title":"New Location","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["NEW_LOCATION"],"example":"NEW_LOCATION"},"url":{"type":"string","example":"https://example.com"}}},{"title":"New Part","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["NEW_PART"],"example":"NEW_PART"},"url":{"type":"string","example":"https://example.com"},"options":{"type":"object","description":"Possible options","properties":{"serializeEntity":{"type":"boolean","description":"If true, the webhook will receive the Part data"}}}}},{"title":"New Purchase Order","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["NEW_PURCHASE_ORDER"],"example":"NEW_PURCHASE_ORDER"},"url":{"type":"string","example":"https://example.com"},"options":{"type":"object","description":"Possible options","properties":{"serializeEntity":{"type":"boolean","description":"If true, the webhook will receive the Purchase Order data"},"includeOAuthTokensInPayload":{"type":"boolean","description":"If true, the webhook request will carry the OAuth access token of the user whose action triggered the webhook in an `Authorization: Bearer <token>` header, so the delivery can be forwarded to an endpoint that expects that token. The token is never included in the body. Warning: this token can be sensitive and should only be sent to a trusted destination. Only available when OIDC login is enabled for the organization."}}}}},{"title":"New Request","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["NEW_WORK_REQUEST"],"example":"NEW_WORK_REQUEST"},"url":{"type":"string","example":"https://example.com"}}},{"title":"New Slash Command","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["NEW_SLASH_COMMAND"],"example":"NEW_SLASH_COMMAND"},"url":{"type":"string","example":"https://example.com"},"filters":{"type":"object","description":"Possible filters.","properties":{"command":{"type":"string","description":"Specify the required keyword to trigger the Webhook.","example":"jira"}}}}},{"title":"New Vendor","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["NEW_VENDOR"],"example":"NEW_VENDOR"},"url":{"type":"string","example":"https://example.com"}}},{"title":"New Work Order","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["NEW_WORK_ORDER"],"example":"NEW_WORK_ORDER"},"url":{"type":"string","example":"https://example.com"},"options":{"type":"object","description":"Possible options","properties":{"serializeEntity":{"type":"boolean","description":"If true, the webhook will receive the Work Order data"},"includeOAuthTokensInPayload":{"type":"boolean","description":"If true, the webhook request will carry the OAuth access token of the user whose action triggered the webhook in an `Authorization: Bearer <token>` header, so the delivery can be forwarded to an endpoint that expects that token. The token is never included in the body. Warning: this token can be sensitive and should only be sent to a trusted destination. Only available when OIDC login is enabled for the organization."}}}}},{"title":"Part Change","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["PART_CHANGE"],"example":"PART_CHANGE"},"url":{"type":"string","example":"https://example.com"},"options":{"type":"object","description":"Possible options","properties":{"serializeEntity":{"type":"boolean","description":"If true, the webhook will receive the part data"},"onlySerializeFilteredProperties":{"type":"boolean","description":"If true and serializeEntity is also set to true, only the filtered properties will be returned on update."}}},"filters":{"type":"object","description":"Possible filters.","properties":{"oneOfPartProperties":{"type":"array","description":"Properties that will trigger the webhook. <br>*If no properties are selected, the webhook will be triggered on every change","items":{"title":"Properties","type":"string","enum":["AREA","ASSETS","AVAILABLE_QUANTITY","BARCODE","DESCRIPTION","EXTRA_FIELDS","LOCATION","LOCATIONS","MAXIMUM_QUANTITY","MINIMUM_QUANTITY","NAME","PART_TYPES","TEAMS","UNIT_COST","VENDORS"]}}}}}},{"title":"Part Delete","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["PART_DELETE"],"example":"PART_DELETE"},"url":{"type":"string","example":"https://example.com"},"options":{"type":"object","description":"Possible options","properties":{"serializeEntity":{"type":"boolean","description":"If true, the webhook will receive the part data"}}}}},{"title":"Part Quantity Changed","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["PART_QUANTITY_CHANGE"],"example":"PART_QUANTITY_CHANGE"},"url":{"type":"string","example":"https://example.com"}}},{"title":"Part Transfer","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["PART_TRANSFER"],"example":"PART_TRANSFER"},"url":{"type":"string","example":"https://example.com"}}},{"title":"Purchase Order Change","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["PURCHASE_ORDER_CHANGE"],"example":"PURCHASE_ORDER_CHANGE"},"url":{"type":"string","example":"https://example.com"},"options":{"type":"object","description":"Possible options","properties":{"serializeEntity":{"type":"boolean","description":"If true, the webhook will receive the purchase order data"},"onlySerializeFilteredProperties":{"type":"boolean","description":"If true and serializeEntity is also set to true, only the filtered properties will be returned on update."},"includeOAuthTokensInPayload":{"type":"boolean","description":"If true, the webhook request will carry the OAuth access token of the user whose action triggered the webhook in an `Authorization: Bearer <token>` header, so the delivery can be forwarded to an endpoint that expects that token. The token is never included in the body. Warning: this token can be sensitive and should only be sent to a trusted destination. Only available when OIDC login is enabled for the organization."}}},"filters":{"type":"object","description":"Possible filters.","properties":{"oneOfPurchaseOrderProperties":{"type":"array","description":"Properties that will trigger the webhook. <br>*If no properties are selected, the webhook will be triggered on every changes","items":{"title":"Properties","type":"string","enum":["ATTACHMENTS","BILLING_ADDRESS","COSTS","DUE_DATE","EXTRA_FIELDS","ITEMS","NOTE","OVERRIDE_NUMBER","SHIPPING_ADDRESS","STATUS","TITLE","VENDOR","VENDOR_CONTACTS"]}}}}}},{"title":"Purchase Order Status Change","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["PURCHASE_ORDER_STATUS_CHANGE"],"example":"PURCHASE_ORDER_STATUS_CHANGE"},"url":{"type":"string","example":"https://example.com"},"options":{"type":"object","description":"Possible options","properties":{"serializePurchaseOrder":{"type":"boolean","description":"If true, the webhook will receive the purchase order data"},"omitSendToVendorPopup":{"type":"boolean","description":"If true, if the state change was done from the UI, the UI will not prompt the user to send the purchase order to the vendor. It will be assumed that the webhook took care of it."},"includeOAuthTokensInPayload":{"type":"boolean","description":"If true, the webhook request will carry the OAuth access token of the user whose action triggered the webhook in an `Authorization: Bearer <token>` header, so the delivery can be forwarded to an endpoint that expects that token. The token is never included in the body. Warning: this token can be sensitive and should only be sent to a trusted destination. Only available when OIDC login is enabled for the organization."}}},"filters":{"type":"object","description":"Possible filters.","properties":{"oneOfStatuses":{"type":"array","description":"Statuses that will trigger the webhook","items":{"title":"Status","type":"string","enum":["APPROVED","CANCELED","COMPLETED","DECLINED","PARTIALLY_FULFILLED","PENDING","REQUESTED"]}},"vendors":{"type":"array","description":"Vendors id that will trigger the webhook","items":{"type":"number"}}}}}},{"title":"Role Archived","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["ROLE_ARCHIVED"],"example":"ROLE_ARCHIVED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"Role Created","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["ROLE_CREATED"],"example":"ROLE_CREATED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"Role Updated","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["ROLE_UPDATED"],"example":"ROLE_UPDATED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"SSO Configuration Changed","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["SSO_CONFIG_CHANGED"],"example":"SSO_CONFIG_CHANGED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"User Activated","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["USER_ACTIVATED"],"example":"USER_ACTIVATED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"User Invited","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["USER_INVITED"],"example":"USER_INVITED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"User Login Failure","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["USER_LOGIN_FAILURE"],"example":"USER_LOGIN_FAILURE"},"url":{"type":"string","example":"https://example.com"}}},{"title":"User Login Success","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["USER_LOGIN_SUCCESS"],"example":"USER_LOGIN_SUCCESS"},"url":{"type":"string","example":"https://example.com"}}},{"title":"User Logout","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["USER_LOGOUT"],"example":"USER_LOGOUT"},"url":{"type":"string","example":"https://example.com"}}},{"title":"User Permissions Changed","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["USER_PERMISSIONS_CHANGED"],"example":"USER_PERMISSIONS_CHANGED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"User Removed","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["USER_REMOVED"],"example":"USER_REMOVED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"User Role Changed","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["USER_ROLE_CHANGED"],"example":"USER_ROLE_CHANGED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"User Session Revoked","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["USER_SESSION_REVOKED"],"example":"USER_SESSION_REVOKED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"Webhook Archived","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["WEBHOOK_ARCHIVED"],"example":"WEBHOOK_ARCHIVED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"Webhook Created","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["WEBHOOK_CREATED"],"example":"WEBHOOK_CREATED"},"url":{"type":"string","example":"https://example.com"}}},{"title":"Work Order Change","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["WORK_ORDER_CHANGE"],"example":"WORK_ORDER_CHANGE"},"url":{"type":"string","example":"https://example.com"},"options":{"type":"object","description":"Possible options","properties":{"serializeEntity":{"type":"boolean","description":"If true, the webhook will receive the work order data"},"onlySerializeFilteredProperties":{"type":"boolean","description":"If true and serializeEntity is also set to true, only the filtered properties will be returned on update."},"includeOAuthTokensInPayload":{"type":"boolean","description":"If true, the webhook request will carry the OAuth access token of the user whose action triggered the webhook in an `Authorization: Bearer <token>` header, so the delivery can be forwarded to an endpoint that expects that token. The token is never included in the body. Warning: this token can be sensitive and should only be sent to a trusted destination. Only available when OIDC login is enabled for the organization."}}},"filters":{"type":"object","description":"Possible filters.","properties":{"oneOfProperties":{"type":"array","description":"Properties that will trigger the webhook. <br>*If no properties are selected, the webhook will be triggered on every changes","items":{"title":"Properties","type":"string","enum":["ASSET","ASSIGNEES","CATEGORIES","COSTS","CUSTOMER","DESCRIPTION","DUE_DATE","ESTIMATED_TIME","EXTRA_FIELDS","LOCATION","PARTS","PRIORITY","START_DATE","TEAMS","TITLE","VENDORS"]}}}}}},{"title":"Work Order Delete","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["WORK_ORDER_DELETE"],"example":"WORK_ORDER_DELETE"},"url":{"type":"string","example":"https://example.com"},"options":{"type":"object","description":"Possible options","properties":{"serializeEntity":{"type":"boolean","description":"If true, the webhook will receive the work order data"},"includeOAuthTokensInPayload":{"type":"boolean","description":"If true, the webhook request will carry the OAuth access token of the user whose action triggered the webhook in an `Authorization: Bearer <token>` header, so the delivery can be forwarded to an endpoint that expects that token. The token is never included in the body. Warning: this token can be sensitive and should only be sent to a trusted destination. Only available when OIDC login is enabled for the organization."}}}}},{"title":"Work Order Overdue","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["WORK_ORDER_OVERDUE"],"example":"WORK_ORDER_OVERDUE"},"url":{"type":"string","example":"https://example.com"}}},{"title":"Work Order Part Status Change","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["WORK_ORDER_PART_STATUS_CHANGE"],"example":"WORK_ORDER_PART_STATUS_CHANGE"},"url":{"type":"string","example":"https://example.com"},"options":{"type":"object","description":"Possible options","properties":{"serializeEntity":{"type":"boolean","description":"If true, the webhook will receive the work order data"}}},"filters":{"type":"object","description":"Possible filters.","properties":{"oneOfPartStatuses":{"type":"array","description":"Part status that will trigger the webhook. If empty or omitted, triggers for all part status changes.","items":{"title":"Part Status","type":"string","enum":["no_parts","assigned","reserved","kitted","staged","issued"]}}}}}},{"title":"Work Order Status Change","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["WORK_ORDER_STATUS_CHANGE"],"example":"WORK_ORDER_STATUS_CHANGE"},"url":{"type":"string","example":"https://example.com"},"options":{"type":"object","description":"Possible options","properties":{"serializeEntity":{"type":"boolean","description":"If true, the webhook will receive the work order data"},"includeOAuthTokensInPayload":{"type":"boolean","description":"If true, the webhook request will carry the OAuth access token of the user whose action triggered the webhook in an `Authorization: Bearer <token>` header, so the delivery can be forwarded to an endpoint that expects that token. The token is never included in the body. Warning: this token can be sensitive and should only be sent to a trusted destination. Only available when OIDC login is enabled for the organization."}}},"filters":{"type":"object","description":"Possible filters.","properties":{"oneOfStatuses":{"type":"array","description":"Statuses that will trigger the webhook.<br> Note, that `\"CANCELED\"` and `\"SKIPPED\"` statuses are only available if this feature is enabled in your organization.","items":{"title":"Status","type":"string","enum":["OPEN","IN_PROGRESS","ON_HOLD","DONE","CANCELED","SKIPPED"]}}}}}},{"title":"Work Request Status Change","type":"object","required":["type","url"],"properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["WORK_REQUEST_STATUS_CHANGE"],"example":"WORK_REQUEST_STATUS_CHANGE"},"url":{"type":"string","example":"https://example.com"},"filters":{"type":"object","description":"Possible filters.","properties":{"oneOfStatuses":{"type":"array","description":"Statuses that will trigger the webhook.","items":{"title":"Status","type":"string","enum":["APPROVED","DONE","REJECTED"]}}}}}}]}}}},"responses":{"201":{"description":"Successfully created subscription","content":{"application/json":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the subscription"},"status":{"type":"string","description":"Validation status of the subscription. Contact support if your subscription returns PENDING_APPROVAL before using the subscription.","enum":["VALID","PENDING_APPROVAL"]},"secret":{"type":"string","description":"Secret to hash the Hmac signature"}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Failed to create the subscription","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"User don't have the right permissions"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}}},"tags":["Subscriptions & Webhooks"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]}},"/subscriptions/{id}":{"get":{"summary":"Get subscription","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the subscription","example":"1"}],"responses":{"200":{"description":"Successfully retrieved subscription's information","content":{"application/json":{"schema":{"type":"object","required":["subscription"],"properties":{"subscription":{"type":"object","required":["id","type","url","status"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the subscription"},"type":{"type":"string","description":"Type of event subscribed to","enum":["API_TOKEN_CREATED","API_TOKEN_REVOKED","ASSET_STATUS_CHANGE","CONNECTOR_TOKEN_REVOKED","CUSTOMER_CHANGE","DATA_EXPORT_INITIATED","INVITE_LINK_ARCHIVED","INVITE_LINK_CREATED","INVITE_LINK_UPDATED","METER_TRIGGER_STATE_CHANGE","NEW_ASSET","NEW_CATEGORY_ON_WORK_ORDER","NEW_COMMENT_ON_WORK_ORDER","NEW_CUSTOMER","NEW_LOCATION","NEW_PART","NEW_PURCHASE_ORDER","NEW_SLASH_COMMAND","NEW_VENDOR","NEW_WORK_ORDER","NEW_WORK_REQUEST","PART_CHANGE","PART_DELETE","PART_QUANTITY_CHANGE","PART_TRANSFER","PURCHASE_ORDER_CHANGE","PURCHASE_ORDER_STATUS_CHANGE","ROLE_ARCHIVED","ROLE_CREATED","ROLE_UPDATED","SSO_CONFIG_CHANGED","USER_ACTIVATED","USER_INVITED","USER_LOGIN_FAILURE","USER_LOGIN_SUCCESS","USER_LOGOUT","USER_PERMISSIONS_CHANGED","USER_REMOVED","USER_ROLE_CHANGED","USER_SESSION_REVOKED","WEBHOOK_ARCHIVED","WEBHOOK_CREATED","WORK_ORDER_CHANGE","WORK_ORDER_DELETE","WORK_ORDER_OVERDUE","WORK_ORDER_PART_STATUS_CHANGE","WORK_ORDER_STATUS_CHANGE","WORK_REQUEST_STATUS_CHANGE"],"example":"API_TOKEN_CREATED"},"url":{"type":"string","example":"https://example.com"},"status":{"type":"string","description":"Validation status of the subscription. Contact support if your subscription returns PENDING_APPROVAL before using the subscription.","enum":["VALID","PENDING_APPROVAL"]}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified subscription or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Subscriptions & Webhooks"]},"patch":{"summary":"Update subscription","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the subscription","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"requestBody":{"description":"Subscription to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Type of event subscribed to","enum":["API_TOKEN_CREATED","API_TOKEN_REVOKED","ASSET_STATUS_CHANGE","CONNECTOR_TOKEN_REVOKED","CUSTOMER_CHANGE","DATA_EXPORT_INITIATED","INVITE_LINK_ARCHIVED","INVITE_LINK_CREATED","INVITE_LINK_UPDATED","METER_TRIGGER_STATE_CHANGE","NEW_ASSET","NEW_CATEGORY_ON_WORK_ORDER","NEW_COMMENT_ON_WORK_ORDER","NEW_CUSTOMER","NEW_LOCATION","NEW_PART","NEW_PURCHASE_ORDER","NEW_SLASH_COMMAND","NEW_VENDOR","NEW_WORK_ORDER","NEW_WORK_REQUEST","PART_CHANGE","PART_DELETE","PART_QUANTITY_CHANGE","PART_TRANSFER","PURCHASE_ORDER_CHANGE","PURCHASE_ORDER_STATUS_CHANGE","ROLE_ARCHIVED","ROLE_CREATED","ROLE_UPDATED","SSO_CONFIG_CHANGED","USER_ACTIVATED","USER_INVITED","USER_LOGIN_FAILURE","USER_LOGIN_SUCCESS","USER_LOGOUT","USER_PERMISSIONS_CHANGED","USER_REMOVED","USER_ROLE_CHANGED","USER_SESSION_REVOKED","WEBHOOK_ARCHIVED","WEBHOOK_CREATED","WORK_ORDER_CHANGE","WORK_ORDER_DELETE","WORK_ORDER_OVERDUE","WORK_ORDER_PART_STATUS_CHANGE","WORK_ORDER_STATUS_CHANGE","WORK_REQUEST_STATUS_CHANGE"],"example":"API_TOKEN_CREATED"},"url":{"type":"string","example":"https://example.com"}}}}}},"responses":{"200":{"description":"Successfully edited subscription","content":{"application/json":{"schema":{"type":"object","required":["subscription"],"properties":{"subscription":{"type":"object","required":["id","type","url","status"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the subscription"},"type":{"type":"string","description":"Type of event subscribed to","enum":["API_TOKEN_CREATED","API_TOKEN_REVOKED","ASSET_STATUS_CHANGE","CONNECTOR_TOKEN_REVOKED","CUSTOMER_CHANGE","DATA_EXPORT_INITIATED","INVITE_LINK_ARCHIVED","INVITE_LINK_CREATED","INVITE_LINK_UPDATED","METER_TRIGGER_STATE_CHANGE","NEW_ASSET","NEW_CATEGORY_ON_WORK_ORDER","NEW_COMMENT_ON_WORK_ORDER","NEW_CUSTOMER","NEW_LOCATION","NEW_PART","NEW_PURCHASE_ORDER","NEW_SLASH_COMMAND","NEW_VENDOR","NEW_WORK_ORDER","NEW_WORK_REQUEST","PART_CHANGE","PART_DELETE","PART_QUANTITY_CHANGE","PART_TRANSFER","PURCHASE_ORDER_CHANGE","PURCHASE_ORDER_STATUS_CHANGE","ROLE_ARCHIVED","ROLE_CREATED","ROLE_UPDATED","SSO_CONFIG_CHANGED","USER_ACTIVATED","USER_INVITED","USER_LOGIN_FAILURE","USER_LOGIN_SUCCESS","USER_LOGOUT","USER_PERMISSIONS_CHANGED","USER_REMOVED","USER_ROLE_CHANGED","USER_SESSION_REVOKED","WEBHOOK_ARCHIVED","WEBHOOK_CREATED","WORK_ORDER_CHANGE","WORK_ORDER_DELETE","WORK_ORDER_OVERDUE","WORK_ORDER_PART_STATUS_CHANGE","WORK_ORDER_STATUS_CHANGE","WORK_REQUEST_STATUS_CHANGE"],"example":"API_TOKEN_CREATED"},"url":{"type":"string","example":"https://example.com"},"status":{"type":"string","description":"Validation status of the subscription. Contact support if your subscription returns PENDING_APPROVAL before using the subscription.","enum":["VALID","PENDING_APPROVAL"]}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified subscription.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"subscription Not Found"}}}}}}},"tags":["Subscriptions & Webhooks"]},"delete":{"summary":"Remove subscription","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the subscription","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"204":{"description":"Successfully removed subscription"},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Failed to remove the subscription","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"User don't have the right permissions"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified subscription.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"subscription Not Found"}}}}}}},"tags":["Subscriptions & Webhooks"]}},"/subscriptions/{id}/secret":{"get":{"summary":"Get secret information","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the subscription","example":"1"}],"responses":{"200":{"description":"Successfully fetched secret","content":{"application/json":{"schema":{"type":"object","required":["secret"],"properties":{"secret":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified subscription.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"subscription Not Found"}}}}}}},"tags":["Subscriptions & Webhooks"]}},"/teams":{"post":{"summary":"Create new team","requestBody":{"description":"Team to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"Cleaning"},"description":{"type":"string","example":"Team responsible for cleaning the factory"},"assetIds":{"type":"array","items":{"type":"integer"},"description":"List of asset IDs that the team is responsible for","example":[12,46]},"locationIds":{"type":"array","items":{"type":"integer"},"description":"List of location where the team is operating","example":[7,145,988]},"memberIds":{"type":"array","items":{"type":"integer"},"description":"List of user IDs that are part of the team","example":[98,46,744]}}}}}},"responses":{"201":{"description":"Successfully created team","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the team"}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Teams"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]},"get":{"summary":"List teams","description":"Endpoint used to list team resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Teams returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Teams list","content":{"application/json":{"schema":{"type":"object","required":["teams","nextCursor","nextPageUrl"],"properties":{"teams":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the team"},"name":{"type":"string","example":"Cleaning"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Teams.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Teams.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Teams"]}},"/teams/{id}":{"get":{"summary":"Get team","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the team","example":"1"}],"responses":{"200":{"description":"Successfully retrieved team's information","content":{"application/json":{"schema":{"type":"object","required":["team"],"properties":{"team":{"type":"object","required":["id","name","membersCount"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the team"},"name":{"type":"string","example":"Cleaning"},"description":{"type":"string","example":"Team responsible for cleaning the factory"},"assetIds":{"type":"array","items":{"type":"integer"},"description":"List of asset IDs that the team is responsible for","example":[12,46]},"membersCount":{"type":"integer","example":3,"description":"Number of team members"},"locationIds":{"type":"array","items":{"type":"integer"},"description":"List of location where the team is operating","example":[7,145,988]}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified team or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Teams"]},"patch":{"summary":"Update team","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the team","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Team to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"Cleaning"},"description":{"type":"string","example":"Team responsible for cleaning the factory"},"locationIds":{"type":"array","items":{"type":"integer"},"description":"List of location where the team is operating","example":[7,145,988]},"assetIds":{"type":"array","items":{"type":"integer"},"description":"List of asset IDs that the team is responsible for","example":[12,46]},"membersCount":{"type":"integer","example":3,"description":"Number of team members"}}}}}},"responses":{"200":{"description":"Successfully edited team","content":{"application/json":{"schema":{"type":"object","required":["team"],"properties":{"team":{"type":"object","required":["id","name","membersCount"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the team"},"name":{"type":"string","example":"Cleaning"},"description":{"type":"string","example":"Team responsible for cleaning the factory"},"assetIds":{"type":"array","items":{"type":"integer"},"description":"List of asset IDs that the team is responsible for","example":[12,46]},"membersCount":{"type":"integer","example":3,"description":"Number of team members"},"locationIds":{"type":"array","items":{"type":"integer"},"description":"List of location where the team is operating","example":[7,145,988]}}}}}}}},"400":{"description":"Failed to edit the team","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"team ID is not valid"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified team.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"team Not Found"}}}}}}},"tags":["Teams"]},"delete":{"summary":"Delete team","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the team","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the team"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified team.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"team Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Teams"]}},"/teams/{id}/members":{"post":{"summary":"Add user to team","requestBody":{"description":"Member to add to team","required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the user"},"teamRole":{"type":"string","enum":["ADMIN","MEMBER"],"example":"MEMBER"}}}}}},"responses":{"201":{"description":"Successfully added team member","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the user"}}}}}},"400":{"description":"Failed to add the team member","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"ID is invalid or user is not part of the organization"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified team member.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"team member Not Found"}}}}}}},"parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the team","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"tags":["Teams"]},"get":{"summary":"List team members","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Members returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the team","example":"1"}],"responses":{"200":{"description":"Successfully fetched Members list","content":{"application/json":{"schema":{"type":"object","required":["members","nextCursor","nextPageUrl"],"properties":{"members":{"type":"array","items":{"type":"object","required":["id","teamRole"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the user"},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"teamRole":{"type":"string","enum":["ADMIN","MEMBER"],"example":"MEMBER"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Members.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Members.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Cannot find the parent resource","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}}},"tags":["Teams"]}},"/teams/{teamId}/members/{userId}":{"patch":{"summary":"Update team member","parameters":[{"schema":{"type":"integer"},"name":"teamId","in":"path","required":true,"description":"ID of the team","example":"1"},{"schema":{"type":"integer"},"name":"userId","in":"path","required":true,"description":"User ID of the member","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Team to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamRole":{"type":"string","enum":["ADMIN","MEMBER"],"example":"MEMBER"}}}}}},"responses":{"200":{"description":"Successfully edited team member","content":{"application/json":{"schema":{"type":"object","required":["member"],"properties":{"member":{"type":"object","required":["id","teamRole"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the user"},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"teamRole":{"type":"string","enum":["ADMIN","MEMBER"],"example":"MEMBER"}}}}}}}},"400":{"description":"Failed to edit the team","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"team role is not valid"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified team member.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"team member Not Found"}}}}}}},"tags":["Teams"]},"delete":{"summary":"Remove user from team","parameters":[{"schema":{"type":"integer"},"name":"teamId","in":"path","required":true,"description":"ID of the team","example":"1"},{"schema":{"type":"integer"},"name":"userId","in":"path","required":true,"description":"User ID of the member","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully removed team member"},"400":{"description":"Failed to remove the team","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Error while deleting team."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified team member.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"team member Not Found"}}}}}}},"tags":["Teams"]}},"/users":{"post":{"summary":"Create new user","requestBody":{"description":"User to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["firstName","lastName"],"properties":{"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"role":{"type":"string","nullable":true,"enum":["ADMIN","MEMBER","OPERATOR","REQUESTER","SERVICE_ACCOUNT"],"example":"MEMBER"},"customRole":{"type":"string","nullable":true,"example":"Custom Role Name","description":"Custom role name if the user has a custom role assigned"},"email":{"type":"string","nullable":true,"example":"user@example.com"},"phoneNumber":{"type":"string","nullable":true,"example":"415-555-0100"},"externalData":{"description":"Extra data that can be attached to the user, for example to help reference to a matching record in an external system.","nullable":true,"oneOf":[{"type":"object","example":{"popularErpSolutionId":"asd732da"}},{"type":"number","example":732},{"type":"string","example":"asd732da"}]},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Department\")","additionalProperties":{"type":"string"},"example":{"Department":"Engineering"}},"authType":{"type":"string","nullable":true,"enum":["NORMAL","SAML","OIDC"],"example":"SAML"},"inviteType":{"type":"string","nullable":true,"enum":["ALL","EMAIL","SMS","NONE"],"example":"ALL"},"hourlyRate":{"type":"integer","nullable":true,"example":120,"description":"Cost in cents. For example, for $1.20, put 120. Set to `null` to set the user's rate to organization default hourly rate if defined, otherwise it would set the rate to the user's hourly rate defined in any work order. If none is defined, setting `null` will set the user's hourly rate to `null`"}}}}}},"responses":{"201":{"description":"Successfully created user","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the user"}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Failed to create the user","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"You do not have permission to create this user."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified User.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"User Not Found"}}}}}}},"tags":["Users"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]},"get":{"summary":"List users","description":"Endpoint used to list user resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Users returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"onlyAssignable","schema":{"type":"boolean","description":"Will only show users that can be assigned to a work order"},"in":"query"},{"name":"email","schema":{"type":"array","description":"Filter users by email. You can filter for multiple users by specifying multiple emails like so: `/users?email=user1@example.com&email=user2@example.com`. Note that if you are using special characters in a url, you will need to URI encode them in order for us to interprete them correctly. For example, `+` should be encoded as `%2B` and though we accept `@`, they should still be encoded as `%40`. So filtering for email `user1+test@example.com`, you would use `/users?email=user1%2Btest%example.com` in your URI","items":{"type":"string"}},"in":"query"},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","description":"To expand multiple fields: `expand=role&expand=extra_fields`","type":"array","items":{"type":"string","enum":["role","extra_fields"]}}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Users list","content":{"application/json":{"schema":{"type":"object","required":["users","nextCursor","nextPageUrl"],"properties":{"users":{"type":"array","items":{"type":"object","required":["id","firstName","lastName"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the user"},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"email":{"type":"string","nullable":true,"example":"user@example.com"},"phoneNumber":{"type":"string","nullable":true,"example":"415-555-0100"},"authType":{"type":"string","nullable":true,"enum":["NORMAL","SAML","OIDC"],"example":"SAML"},"hourlyRate":{"type":"integer","nullable":true,"example":120,"description":"Cost in cents. For example, for $1.20, the value will be 120. If the hourly rate is not set specifically for the user, the API will return the default organization hourly rate, if that is also not set, it will return the hourly rate that is specifically set for the user in any work order. Otherwise, it would be `undefined`"},"lastVisitedAt":{"type":"string","format":"date-time","nullable":true,"example":"2026-05-06T12:34:56.000Z","description":"Last time the user visited this organization. Scoped to the organization the request is made against. `null` if the user has never visited (e.g. an invited user who has not yet accepted). For service accounts, returns the organization-user creation date."},"createdAt":{"type":"string","format":"date-time","nullable":true,"example":"2026-05-06T12:34:56.000Z","description":"When the user was added to this organization. Scoped to the organization the request is made against. `null` if the user is no longer part of the organization."},"role":{"type":"string","nullable":false,"enum":["ADMIN","MEMBER","OPERATOR","REQUESTER","SERVICE_ACCOUNT"],"example":"MEMBER","description":"(expand with query parameter)"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Department\") (expand with query parameter)","additionalProperties":{"type":"string"},"example":{"Department":"Engineering"},"nullable":false}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Users.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Users.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Users"]}},"/users/{id}":{"get":{"summary":"Get user","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the user","example":"1"},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully retrieved user's information","content":{"application/json":{"schema":{"type":"object","required":["user"],"properties":{"user":{"type":"object","required":["id","firstName","lastName"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the user"},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"role":{"type":"string","nullable":true,"enum":["ADMIN","MEMBER","OPERATOR","REQUESTER","SERVICE_ACCOUNT"],"example":"MEMBER"},"customRole":{"type":"string","nullable":true,"example":"Custom Role Name","description":"Custom role name if the user has a custom role assigned"},"email":{"type":"string","nullable":true,"example":"user@example.com"},"phoneNumber":{"type":"string","nullable":true,"example":"415-555-0100"},"removedFromOrganization":{"type":"boolean","example":true},"authType":{"type":"string","nullable":true,"enum":["NORMAL","SAML","OIDC"],"example":"SAML"},"hourlyRate":{"type":"integer","nullable":true,"example":120,"description":"Cost in cents. For example, for $1.20, the value will be 120. If the hourly rate is not set specifically for the user, the API will return the default organization hourly rate, if that is also not set, it will return the hourly rate that is specifically set for the user in any work order. Otherwise, it would be `undefined`"},"externalData":{"description":"Extra data that can be attached to the user, for example to help reference to a matching record in an external system.","nullable":true,"oneOf":[{"type":"object","example":{"popularErpSolutionId":"asd732da"}},{"type":"number","example":732},{"type":"string","example":"asd732da"}]},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Department\")","additionalProperties":{"type":"string"},"example":{"Department":"Engineering"}},"lastVisitedAt":{"type":"string","format":"date-time","nullable":true,"example":"2026-05-06T12:34:56.000Z","description":"Last time the user visited this organization. Scoped to the organization the request is made against. `null` if the user has never visited (e.g. an invited user who has not yet accepted). For service accounts, returns the organization-user creation date."},"createdAt":{"type":"string","format":"date-time","nullable":true,"example":"2026-05-06T12:34:56.000Z","description":"When the user was added to this organization. Scoped to the organization the request is made against. `null` if the user is no longer part of the organization."}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified user or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Users"]},"patch":{"summary":"Update user","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the user","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"requestBody":{"description":"User to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"email":{"type":"string","nullable":true,"example":"user@example.com"},"phoneNumber":{"type":"string","nullable":true,"example":"415-555-0100"},"role":{"type":"string","nullable":true,"enum":["ADMIN","MEMBER","OPERATOR","REQUESTER","SERVICE_ACCOUNT"],"example":"MEMBER"},"customRole":{"type":"string","nullable":true,"example":"Custom Role Name","description":"Custom role name if the user has a custom role assigned"},"authType":{"type":"string","nullable":true,"enum":["NORMAL","SAML","OIDC"],"example":"SAML"},"externalData":{"description":"Extra data that can be attached to the user, for example to help reference to a matching record in an external system.","nullable":true,"oneOf":[{"type":"object","example":{"popularErpSolutionId":"asd732da"}},{"type":"number","example":732},{"type":"string","example":"asd732da"}]},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Department\")","additionalProperties":{"type":"string"},"example":{"Department":"Engineering"}},"hourlyRate":{"type":"integer","nullable":true,"example":120,"description":"Cost in cents. For example, for $1.20, put 120. Set to `null` to set the user's rate to organization default hourly rate if defined, otherwise it would set the rate to the user's hourly rate defined in any work order. If none is defined, setting `null` will set the user's hourly rate to `null`"}}}}}},"responses":{"200":{"description":"Successfully edited user","content":{"application/json":{"schema":{"type":"object","required":["user"],"properties":{"user":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the user"},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"role":{"type":"string","nullable":true,"enum":["ADMIN","MEMBER","OPERATOR","REQUESTER","SERVICE_ACCOUNT"],"example":"MEMBER"},"customRole":{"type":"string","nullable":true,"example":"Custom Role Name","description":"Custom role name if the user has a custom role assigned"},"email":{"type":"string","nullable":true,"example":"user@example.com"},"phoneNumber":{"type":"string","nullable":true,"example":"415-555-0100"},"removedFromOrganization":{"type":"boolean","example":true},"authType":{"type":"string","nullable":true,"enum":["NORMAL","SAML","OIDC"],"example":"SAML"},"hourlyRate":{"type":"integer","nullable":true,"example":120,"description":"Cost in cents. For example, for $1.20, the value will be 120. If the hourly rate is not set specifically for the user, the API will return the default organization hourly rate, if that is also not set, it will return the hourly rate that is specifically set for the user in any work order. Otherwise, it would be `undefined`"},"externalData":{"description":"Extra data that can be attached to the user, for example to help reference to a matching record in an external system.","nullable":true,"oneOf":[{"type":"object","example":{"popularErpSolutionId":"asd732da"}},{"type":"number","example":732},{"type":"string","example":"asd732da"}]},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Department\")","additionalProperties":{"type":"string"},"example":{"Department":"Engineering"}},"lastVisitedAt":{"type":"string","format":"date-time","nullable":true,"example":"2026-05-06T12:34:56.000Z","description":"Last time the user visited this organization. Scoped to the organization the request is made against. `null` if the user has never visited (e.g. an invited user who has not yet accepted). For service accounts, returns the organization-user creation date."},"createdAt":{"type":"string","format":"date-time","nullable":true,"example":"2026-05-06T12:34:56.000Z","description":"When the user was added to this organization. Scoped to the organization the request is made against. `null` if the user is no longer part of the organization."}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Cannot edit Auth Type","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"You do not have permission to edit the Auth Type from SAML to NORMAL."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified user.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"user Not Found"}}}}}}},"tags":["Users"]},"delete":{"summary":"Remove user from organization","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the user","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"204":{"description":"Successfully removed user"},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified user.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"user Not Found"}}}}}}},"tags":["Users"]}},"/users/{id}/messages":{"post":{"summary":"Create new direct message to a user","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the user","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"requestBody":{"description":"Message to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"string","description":"Content of the message to post"}}}}}},"responses":{"201":{"description":"Successfully created the message","content":{"application/json":{"schema":{"type":"object","required":["conversationId"],"properties":{"conversationId":{"type":"number","description":"ID of the conversation"}}}}}},"400":{"description":"Failed to create the message","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"should have required property 'content'","fieldPath":"content"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"No conversation permissions","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"You cannot create conversations","fieldPath":"content"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified user.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"user Not Found"}}}}}}},"tags":["Users"]}},"/vendors":{"post":{"summary":"Create new vendor","requestBody":{"description":"Vendor to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"Acme Corp"},"description":{"type":"string","nullable":true,"example":"Provider of Acme service"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Qualifications\")","additionalProperties":{"type":"string"},"example":{"Qualifications":"ISO 000"}},"emails":{"type":"array","items":{"type":"string"},"example":["vendor@example.com"],"description":"List of email address","deprecated":true},"phoneNumbers":{"type":"array","items":{"type":"string"},"example":["415-555-0100"],"description":"List of phone number","deprecated":true}}}}}},"responses":{"201":{"description":"Successfully created vendor","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the vendor"}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Vendors"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]},"get":{"summary":"List vendors","description":"Endpoint used to list vendor resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Vendors returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"customFieldName","schema":{"type":"array","items":{"type":"string"},"description":"Filter vendors by custom field value. Your query parameter should be your custom field name. (ie: To filter by a custom field named \"Industry\" with the value \"Construction\", you would do this \"/vendors?Industry=Construction\").\n                    <br><br>Adding multiple instance of the same custom field act as an <code>OR</code> and adding a different custom field act as an <code>AND</code>. (ie: To filter by a custom field named <code>Industry</code> with the value <code>Construction</code> OR <code>Transportation</code> AND the custom field <code>Manufacturer</code> with the value <code>ACME</code>, you would do this <code>/vendors?Industry=Construction&Industry=Transportation&Manufacturer=ACME</code>).\n                    <br><br>If your custom field label is the same as a reserved query parameter such as <code>limit</code>, <code>sort</code>, <code>expand</code>, etc, you can add <code>__c</code> to your custom field filtering (ie: To filter by a custom field named <code>limit</code> with the value <code>ten</code>, you would do this <code>/vendors?limit__c=ten</code>).\n                    <br><br>Note that your custom field needs to be created beforehand. Only number and single line text custom field types are supported."},"in":"query"},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","type":"array","items":{"type":"string","enum":["extra_fields"]}}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Vendors list","content":{"application/json":{"schema":{"type":"object","required":["vendors","nextCursor","nextPageUrl"],"properties":{"vendors":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the vendor"},"name":{"type":"string","example":"Acme Corp"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Qualifications\") (expand with query parameter)","additionalProperties":{"type":"string"},"example":{"Qualifications":"ISO 000"},"nullable":false}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Vendors.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Vendors.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Vendors"]}},"/vendors/{id}":{"get":{"summary":"Get vendor","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the vendor","example":"1"}],"responses":{"200":{"description":"Successfully retrieved vendor's information","content":{"application/json":{"schema":{"type":"object","required":["vendor"],"properties":{"vendor":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the vendor"},"name":{"type":"string","example":"Acme Corp"},"emails":{"type":"array","items":{"type":"string"},"example":["vendor@example.com"],"description":"List of email address","deprecated":true},"phoneNumbers":{"type":"array","items":{"type":"string"},"example":["415-555-0100"],"description":"List of phone number","deprecated":true},"description":{"type":"string","nullable":true,"example":"Provider of Acme service"},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the vendor","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"contactIds":{"type":"array","items":{"type":"integer"},"example":[1,4,13],"description":"List of contact IDs"},"deletedAt":{"type":"string","format":"date-time","description":"Date that the vendor was deleted","example":"2022-01-01T00:00:00.000Z","nullable":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Qualifications\")","additionalProperties":{"type":"string"},"example":{"Qualifications":"ISO 000"}}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified vendor or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Vendors"]},"patch":{"summary":"Update vendor","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the vendor","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Vendor to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"Acme Corp"},"description":{"type":"string","nullable":true,"example":"Provider of Acme service"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Qualifications\")","additionalProperties":{"type":"string"},"example":{"Qualifications":"ISO 000"}}}}}}},"responses":{"200":{"description":"Successfully edited vendor","content":{"application/json":{"schema":{"type":"object","required":["vendor"],"properties":{"vendor":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the vendor"},"name":{"type":"string","example":"Acme Corp"},"emails":{"type":"array","items":{"type":"string"},"example":["vendor@example.com"],"description":"List of email address","deprecated":true},"phoneNumbers":{"type":"array","items":{"type":"string"},"example":["415-555-0100"],"description":"List of phone number","deprecated":true},"description":{"type":"string","nullable":true,"example":"Provider of Acme service"},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the vendor","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"contactIds":{"type":"array","items":{"type":"integer"},"example":[1,4,13],"description":"List of contact IDs"},"deletedAt":{"type":"string","format":"date-time","description":"Date that the vendor was deleted","example":"2022-01-01T00:00:00.000Z","nullable":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Qualifications\")","additionalProperties":{"type":"string"},"example":{"Qualifications":"ISO 000"}}}}}}}}},"400":{"description":"Failed to edit the vendor","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"parentId is not valid"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified vendor.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"vendor Not Found"}}}}}}},"tags":["Vendors"]},"delete":{"summary":"Delete vendor","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the vendor","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the vendor"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified vendor.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"vendor Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Vendors"]}},"/vendors/{id}/attachments/{filename}":{"put":{"summary":"Update vendor attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the vendor.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"datasheet.pdf"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the attachment.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"application/x-indesign":{"schema":{"type":"object","format":"binary"}},"application/epub+zip":{"schema":{"type":"object","format":"binary"}},"application/x-xpinstall":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"schema":{"type":"object","format":"binary"}},"application/zip":{"schema":{"type":"object","format":"binary"}},"application/x-tar":{"schema":{"type":"object","format":"binary"}},"application/x-rar-compressed":{"schema":{"type":"object","format":"binary"}},"application/gzip":{"schema":{"type":"object","format":"binary"}},"application/x-bzip2":{"schema":{"type":"object","format":"binary"}},"application/x-7z-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-apple-diskimage":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.arrow.file":{"schema":{"type":"object","format":"binary"}},"video/mp4":{"schema":{"type":"object","format":"binary"}},"audio/midi":{"schema":{"type":"object","format":"binary"}},"video/matroska":{"schema":{"type":"object","format":"binary"}},"video/webm":{"schema":{"type":"object","format":"binary"}},"video/quicktime":{"schema":{"type":"object","format":"binary"}},"video/vnd.avi":{"schema":{"type":"object","format":"binary"}},"audio/wav":{"schema":{"type":"object","format":"binary"}},"audio/qcelp":{"schema":{"type":"object","format":"binary"}},"audio/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"video/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-asf":{"schema":{"type":"object","format":"binary"}},"video/mpeg":{"schema":{"type":"object","format":"binary"}},"video/3gpp":{"schema":{"type":"object","format":"binary"}},"audio/mpeg":{"schema":{"type":"object","format":"binary"}},"audio/mp4":{"schema":{"type":"object","format":"binary"}},"video/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg; codecs=opus":{"schema":{"type":"object","format":"binary"}},"application/ogg":{"schema":{"type":"object","format":"binary"}},"audio/flac":{"schema":{"type":"object","format":"binary"}},"audio/ape":{"schema":{"type":"object","format":"binary"}},"audio/wavpack":{"schema":{"type":"object","format":"binary"}},"audio/amr":{"schema":{"type":"object","format":"binary"}},"application/pdf":{"schema":{"type":"object","format":"binary"}},"application/x-elf":{"schema":{"type":"object","format":"binary"}},"application/x-mach-binary":{"schema":{"type":"object","format":"binary"}},"application/x-msdownload":{"schema":{"type":"object","format":"binary"}},"application/x-shockwave-flash":{"schema":{"type":"object","format":"binary"}},"application/rtf":{"schema":{"type":"object","format":"binary"}},"application/wasm":{"schema":{"type":"object","format":"binary"}},"font/woff":{"schema":{"type":"object","format":"binary"}},"font/woff2":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-fontobject":{"schema":{"type":"object","format":"binary"}},"font/ttf":{"schema":{"type":"object","format":"binary"}},"font/otf":{"schema":{"type":"object","format":"binary"}},"font/collection":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"video/x-flv":{"schema":{"type":"object","format":"binary"}},"application/postscript":{"schema":{"type":"object","format":"binary"}},"application/eps":{"schema":{"type":"object","format":"binary"}},"application/x-xz":{"schema":{"type":"object","format":"binary"}},"application/x-sqlite3":{"schema":{"type":"object","format":"binary"}},"application/x-nintendo-nes-rom":{"schema":{"type":"object","format":"binary"}},"application/x-google-chrome-extension":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-cab-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-deb":{"schema":{"type":"object","format":"binary"}},"application/x-unix-archive":{"schema":{"type":"object","format":"binary"}},"application/x-rpm":{"schema":{"type":"object","format":"binary"}},"application/x-compress":{"schema":{"type":"object","format":"binary"}},"application/lzip":{"schema":{"type":"object","format":"binary"}},"application/x-cfb":{"schema":{"type":"object","format":"binary"}},"application/x-mie":{"schema":{"type":"object","format":"binary"}},"application/mxf":{"schema":{"type":"object","format":"binary"}},"video/mp2t":{"schema":{"type":"object","format":"binary"}},"application/x-blender":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"audio/aiff":{"schema":{"type":"object","format":"binary"}},"application/xml":{"schema":{"type":"object","format":"binary"}},"application/x-mobipocket-ebook":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"application/dicom":{"schema":{"type":"object","format":"binary"}},"audio/x-musepack":{"schema":{"type":"object","format":"binary"}},"text/calendar":{"schema":{"type":"object","format":"binary"}},"text/vcard":{"schema":{"type":"object","format":"binary"}},"text/vtt":{"schema":{"type":"object","format":"binary"}},"model/gltf-binary":{"schema":{"type":"object","format":"binary"}},"application/vnd.tcpdump.pcap":{"schema":{"type":"object","format":"binary"}},"audio/x-dsf":{"schema":{"type":"object","format":"binary"}},"application/x-ms-shortcut":{"schema":{"type":"object","format":"binary"}},"application/x-ft-apple.alias":{"schema":{"type":"object","format":"binary"}},"audio/x-voc":{"schema":{"type":"object","format":"binary"}},"audio/vnd.dolby.dd-raw":{"schema":{"type":"object","format":"binary"}},"audio/x-m4a":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"video/x-m4v":{"schema":{"type":"object","format":"binary"}},"video/3gpp2":{"schema":{"type":"object","format":"binary"}},"application/x-esri-shape":{"schema":{"type":"object","format":"binary"}},"audio/aac":{"schema":{"type":"object","format":"binary"}},"audio/x-it":{"schema":{"type":"object","format":"binary"}},"audio/x-s3m":{"schema":{"type":"object","format":"binary"}},"audio/x-xm":{"schema":{"type":"object","format":"binary"}},"video/mp1s":{"schema":{"type":"object","format":"binary"}},"video/mp2p":{"schema":{"type":"object","format":"binary"}},"application/vnd.sketchup.skp":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"application/x-lzh-compressed":{"schema":{"type":"object","format":"binary"}},"application/pgp-encrypted":{"schema":{"type":"object","format":"binary"}},"application/x-asar":{"schema":{"type":"object","format":"binary"}},"model/stl":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-htmlhelp":{"schema":{"type":"object","format":"binary"}},"model/3mf":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"application/zstd":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-outlook":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.parquet":{"schema":{"type":"object","format":"binary"}},"application/java-vm":{"schema":{"type":"object","format":"binary"}},"application/x-arj":{"schema":{"type":"object","format":"binary"}},"application/x-cpio":{"schema":{"type":"object","format":"binary"}},"application/x-ace-compressed":{"schema":{"type":"object","format":"binary"}},"application/avro":{"schema":{"type":"object","format":"binary"}},"application/vnd.iccprofile":{"schema":{"type":"object","format":"binary"}},"application/x-ft-fbx":{"schema":{"type":"object","format":"binary"}},"application/vnd.visio":{"schema":{"type":"object","format":"binary"}},"application/vnd.android.package-archive":{"schema":{"type":"object","format":"binary"}},"application/x-ft-draco":{"schema":{"type":"object","format":"binary"}},"application/x-lz4":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.sheet.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.document.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/java-archive":{"schema":{"type":"object","format":"binary"}},"application/vnd.rn-realmedia":{"schema":{"type":"object","format":"binary"}},"application/x-spss-sav":{"schema":{"type":"object","format":"binary"}},"application/x-ms-regedit":{"schema":{"type":"object","format":"binary"}},"application/x-ft-windows-registry-hive":{"schema":{"type":"object","format":"binary"}},"application/x-jmp-data":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.keynote":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.numbers":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.pages":{"schema":{"type":"object","format":"binary"}},"application/x-apache-arrow":{"schema":{"type":"object","format":"binary"}},"application/x-lzip":{"schema":{"type":"object","format":"binary"}},"application/x.apple.alias":{"schema":{"type":"object","format":"binary"}},"application/x.ms.shortcut":{"schema":{"type":"object","format":"binary"}},"audio/opus":{"schema":{"type":"object","format":"binary"}},"audio/vnd.wave":{"schema":{"type":"object","format":"binary"}},"audio/x-flac":{"schema":{"type":"object","format":"binary"}},"video/x-matroska":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated vendor's attachment.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified vendor.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"vendor Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Vendors"]},"delete":{"summary":"Remove vendor attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the vendor.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"attachment.xls"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully removed vendor's attachment."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Attachment.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment Not Found"}}}}}}},"tags":["Vendors"]}},"/vendors/{id}/contacts":{"post":{"summary":"Create new contact","requestBody":{"description":"Contact to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"role":{"type":"string","nullable":true,"example":"Team Lead","description":"Role/Label of the contact."},"email":{"type":"string","example":"john@doe.com","nullable":true,"description":"Email address of contact."},"phoneNumber":{"type":"string","example":"1234567890","nullable":true,"description":"Phone number of contact"},"extension":{"type":"string","example":"4682","nullable":true,"description":"Phone number extension"}}}}}},"responses":{"201":{"description":"Successfully created contact","content":{"application/json":{"schema":{"type":"object","required":["id","name","role","email","phoneNumber","extension","vendorId"],"properties":{"id":{"type":"number","example":135,"description":"Global ID of the contact"},"name":{"type":"string"},"role":{"type":"string","nullable":true,"example":"Team Lead","description":"Role/Label of the contact."},"email":{"type":"string","example":"john@doe.com","nullable":true,"description":"Email address of contact."},"phoneNumber":{"type":"string","example":"1234567890","nullable":true,"description":"Phone number of contact"},"extension":{"type":"string","example":"4682","nullable":true,"description":"Phone number extension"},"vendorId":{"type":"number","example":432,"description":"ID of vendor that contact will be associated to"}}}}}},"400":{"description":"Failed to create the contact","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"errors with request"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Vendor.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Vendor Not Found"}}}}}},"429":{"description":"Too many requests. Please retry in 10 seconds","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Too many requests. Please retry in 10 seconds"}}}}}}},"parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the vendor","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"tags":["Vendors"]},"get":{"summary":"List contacts","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Contacts returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the vendor","example":"1"}],"responses":{"200":{"description":"Successfully fetched Contacts list","content":{"application/json":{"schema":{"type":"object","required":["contacts","nextCursor","nextPageUrl"],"properties":{"contacts":{"type":"array","items":{"type":"object","required":["id","name","role","email","extension","phoneNumber","vendorId"],"properties":{"id":{"type":"number","example":135,"description":"Global ID of the contact"},"name":{"type":"string"},"role":{"type":"string","nullable":true,"example":"Team Lead","description":"Role/Label of the contact."},"email":{"type":"string","example":"john@doe.com","nullable":true,"description":"Email address of contact."},"phoneNumber":{"type":"string","example":"1234567890","nullable":true,"description":"Phone number of contact"},"extension":{"type":"string","example":"4682","nullable":true,"description":"Phone number extension"},"vendorId":{"type":"number","example":432,"description":"ID of vendor that contact will be associated to"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Contacts.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Contacts.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Cannot find the parent resource","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}}},"tags":["Vendors"]}},"/vendors/{id}/contacts/{contactId}":{"get":{"summary":"Get contact","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the vendor","example":"1"},{"schema":{"type":"integer"},"name":"contactId","in":"path","required":true,"description":"ID of the contact","example":"12"}],"responses":{"200":{"description":"Successfully got contact","content":{"application/json":{"schema":{"type":"object","required":["vendorContact"],"properties":{"vendorContact":{"type":"object","required":["id","name","role","email","phoneNumber","extension","vendorId"],"properties":{"id":{"type":"number","example":135,"description":"Global ID of the contact"},"name":{"type":"string"},"role":{"type":"string","nullable":true,"example":"Team Lead","description":"Role/Label of the contact."},"email":{"type":"string","example":"john@doe.com","nullable":true,"description":"Email address of contact."},"phoneNumber":{"type":"string","example":"1234567890","nullable":true,"description":"Phone number of contact"},"extension":{"type":"string","example":"4682","nullable":true,"description":"Phone number extension"},"vendorId":{"type":"number","example":432,"description":"ID of vendor that contact will be associated to"}}}}}}}},"400":{"description":"Failed to get contact","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"error with request"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Contact.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Contact Not Found"}}}}}}},"tags":["Vendors"]},"patch":{"summary":"Update contact","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the vendor","example":"1"},{"schema":{"type":"integer"},"name":"contactId","in":"path","required":true,"description":"ID of the contact","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Contact to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string","nullable":true,"example":"Team Lead","description":"Role/Label of the contact."},"email":{"type":"string","example":"john@doe.com","nullable":true,"description":"Email address of contact."},"phoneNumber":{"type":"string","example":"1234567890","nullable":true,"description":"Phone number of contact"},"extension":{"type":"string","example":"4682","nullable":true,"description":"Phone number extension"}}}}}},"responses":{"200":{"description":"Successfully updated contact","content":{"application/json":{"schema":{"type":"object","required":["contact"],"properties":{"contact":{"type":"object","required":["id","name","role","email","phoneNumber","extension","vendorId"],"properties":{"id":{"type":"number","example":135,"description":"Global ID of the contact"},"name":{"type":"string"},"role":{"type":"string","nullable":true,"example":"Team Lead","description":"Role/Label of the contact."},"email":{"type":"string","example":"john@doe.com","nullable":true,"description":"Email address of contact."},"phoneNumber":{"type":"string","example":"1234567890","nullable":true,"description":"Phone number of contact"},"extension":{"type":"string","example":"4682","nullable":true,"description":"Phone number extension"},"vendorId":{"type":"number","example":432,"description":"ID of vendor that contact will be associated to"}}}}}}}},"400":{"description":"Failed to update the contact","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"error with the request"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Contact.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Contact Not Found"}}}}}}},"tags":["Vendors"]},"delete":{"summary":"Delete contact","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the vendor","example":"1"},{"schema":{"type":"integer"},"name":"contactId","in":"path","required":true,"description":"ID of the contact","example":"32"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully removed contact"},"400":{"description":"Failed to remove the contact","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"error with the request"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Contact.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Contact Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Vendors"]}},"/vendors/{id}/thumbnail/{filename}":{"put":{"summary":"Update vendor's thumbnail","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the vendor.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the vendor thumbnail, including the extension.","example":"motor.png"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the thumbnail.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated vendor's thumbnail.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"You cannot edit this entity.","fieldPath":"organizationId","fieldValue":"1"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Vendor.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Vendor Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Vendors"]}},"/workorders":{"post":{"summary":"Create new work order","requestBody":{"description":"Work order to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"assetId":{"nullable":true,"type":"integer"},"assignees":{"type":"array","description":"Either the teamId, the userId or the user email address","items":{"type":"object","title":"assignees","required":["type","id"],"properties":{"type":{"type":"string","example":"USER","enum":["USER","TEAM"]},"id":{"oneOf":[{"type":"integer"},{"type":"string"}]}}}},"estimatedTime":{"type":"integer","nullable":true,"description":"The estimated time taken in seconds to complete the work order","example":3600},"requesterId":{"oneOf":[{"type":"integer","nullable":true},{"type":"string"}],"description":"ID or email of the user who requested the work order"},"workRequestId":{"nullable":true,"type":"integer","description":"ID of the Work Request that will be approved by the creation of this work order"},"workOrderTemplateId":{"type":"integer","nullable":true,"description":"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."},"categories":{"type":"array","description":"List of categories that identify the work order","items":{"type":"string","example":"Cleaning","uniqueItems":true}},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order is due","example":"2022-01-01T00:00:00.000Z"},"externalData":{"description":"Extra data that can be attached to the work order, for example to help reference to a matching record in an external system.","nullable":true,"oneOf":[{"type":"object","example":{"popularErpSolutionId":"asd732da"}},{"type":"number","example":732},{"type":"string","example":"asd732da"}]},"isParent":{"type":"boolean","nullable":true,"description":"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**"},"startDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set","example":"2022-01-01T00:00:00.000Z"},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order"},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"procedure":{"type":"object","nullable":true,"required":["title","fields"],"properties":{"id":{"type":"number","example":1234,"deprecated":true,"description":"You should favor 'procedureTemplateId' to attach a procedure template."},"title":{"type":"string","description":"Title of the procedure","example":"Control dashboard audit"},"fields":{"type":"array","items":{"type":"object","required":["type","label"],"properties":{"label":{"type":"string","example":"Metal Parts: broken, loose, dented, rusty, missing"},"type":{"type":"string","example":"INSPECTION_CHECK","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"]},"description":{"type":"string","nullable":true},"choices":{"type":"array","items":{"example":"Partially","type":"string"}},"urls":{"type":"array","items":{"type":"object","required":["link"],"properties":{"label":{"type":"string","description":"Label of the url","example":"MaintainX Website"},"link":{"type":"string","description":"Link","example":"www.getmaintainx.com"}}}},"meterId":{"type":"number","example":1,"nullable":true,"description":"Id of the meter"},"isDateAndTime":{"type":"boolean","default":false,"description":"Indicate if a DATE field also contains the time","example":false},"index":{"type":"number","example":1,"description":"Order which the row is displayed"}}},"description":"Steps of a procedure"}}},"procedureTemplateId":{"type":"number","nullable":true,"description":"ID of the procedure template to attach"},"repeatability":{"type":"object","nullable":true,"example":{"type":"WEEKLY","interval":3,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"oneOf":[{"type":"object","title":"Daily","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Weekly","required":["type","days"],"nullable":true,"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between events","minimum":1,"maximum":52,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"]}},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Monthly","required":["type","day"],"nullable":true,"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between events","minimum":1,"maximum":24,"default":1},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month the event will occur"},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Yearly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between events","minimum":1,"maximum":1000,"default":1},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Periodically","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"PERIODICALLY","enum":["PERIODICALLY"]},"interval":{"type":"integer","description":"Number of seconds between events","minimum":0},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}}]},"skipRestHook":{"type":"boolean","deprecated":true,"description":"When work order is created, will not trigger any rest hook that is subscribed"},"title":{"type":"string"},"type":{"type":"string","enum":["OTHER","REACTIVE","PREVENTIVE"],"description":"Valid types of Work Orders."},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Estimated Time Allotted\")","additionalProperties":{"type":"string"},"example":{"Estimated Time Allotted":"24 Hours"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"partsUsed":{"type":"array","description":"Parts IDs and quantities used in this work order","items":{"type":"object","required":["partId","quantityUsed"],"properties":{"partId":{"type":"integer","example":963,"description":"Global ID of the part"},"quantityUsed":{"type":"integer","description":"Quantity used in the work order.","example":120},"locationId":{"type":"integer","nullable":true,"description":"Global ID of the location of the part","example":852},"copyOnRecurring":{"type":"string","description":"Indicates if the parts will be copied to the next work order in the chain (if applicable).","default":"Default","enum":["NoCopy","Copy","Default"]}}}},"parentId":{"type":"number","nullable":true,"description":"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**"}}}}}},"parameters":[{"name":"skipWebhook","in":"query","schema":{"type":"boolean","description":"Set skipWebhook=true to skip all webhooks upon successful work order creation."}},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully created work order","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number","example":159}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Work Orders"]},"get":{"summary":"List work orders","description":"Endpoint used to list work order resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Work Orders returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"title","schema":{"type":"string","description":"To filter work orders by title"},"in":"query"},{"name":"assets","schema":{"type":"array","title":"asset ID filters","description":"To filter by multiple asset IDs: `assets=630&assets=634`","items":{"type":"integer"}},"in":"query"},{"name":"notAssets","schema":{"type":"array","title":"asset ID filters","description":"Filter work orders that have none of the provided assets.\nTo filter by multiple asset IDs: `notAssets=630&notAssets=634`","items":{"type":"integer"}},"in":"query"},{"name":"locations","schema":{"type":"array","title":"location ID filters","description":"To filter by multiple location IDs: `locations=193&locations=194&locations=195`","items":{"type":"integer"}},"in":"query"},{"name":"notLocations","schema":{"type":"array","title":"location ID filters","description":"Filter work orders that have none of the provided locations.\nTo filter by multiple location IDs: `notLocations=193&notLocations=194&notLocations=195`","items":{"type":"integer"}},"in":"query"},{"name":"parts","schema":{"type":"array","title":"part ID filters","description":"To filter by multiple part IDs: `parts=14677&parts=14687`","items":{"type":"integer"}},"in":"query"},{"name":"notParts","schema":{"type":"array","title":"part ID filters","description":"Filter work orders that have none of the provided parts.\nTo filter by multiple part IDs: `notParts=14677&notParts=14687`","items":{"type":"integer"}},"in":"query"},{"name":"vendors","schema":{"type":"array","title":"vendor ID filters","description":"To filter by multiple vendor IDs: `vendors=7123&vendors=2234`","items":{"type":"integer"}},"in":"query"},{"name":"notVendors","schema":{"type":"array","title":"vendor ID filters","description":"Filter work orders that have none of the provided vendors.\nTo filter by multiple vendor IDs: `notVendors=7123&notVendors=2234`","items":{"type":"integer"}},"in":"query"},{"name":"assignees","schema":{"type":"array","title":"assignee ID filters","description":"To filter by multiple assignee IDs: `assignees=23494&assignees=79808`","items":{"type":"integer"}},"in":"query"},{"name":"teams","schema":{"type":"array","title":"team ID filters","description":"To filter by multiple team IDs: `teams=112&teams=243`","items":{"type":"integer"}},"in":"query"},{"name":"categories","schema":{"type":"array","title":"categories filters","description":"To filter by multiple categories: `categories=123456&categories=Damage`","items":{"oneOf":[{"type":"string","description":"Label of the category","example":"Damage"},{"type":"integer","description":"Global ID of the category","example":123}]}},"in":"query"},{"name":"notCategories","schema":{"type":"array","title":"categories filters","description":"Filter work orders that have none of the provided categories.\nTo filter by multiple categories: `notCategories=123456&notCategories=Damage`","items":{"oneOf":[{"type":"string","description":"Label of the category","example":"Damage"},{"type":"integer","description":"Global ID of the category","example":123}]}},"in":"query"},{"name":"priorities","schema":{"type":"array","title":"priorities filters","description":"To filter by multiple priorities: `priorities=LOW&priorities=MEDIUM`","items":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]}},"in":"query"},{"name":"statuses","schema":{"type":"array","title":"statuses filters","description":"To filter by multiple statuses: `statuses=IN_PROGRESS&statuses=DONE`","items":{"type":"string","enum":["OPEN","IN_PROGRESS","ON_HOLD","DONE","CANCELED","SKIPPED"],"description":"<br /><em>Note:</em> It is also possible to register a webhook to get notified when the status of any work order changes. Please see the <a href=\"#tag/Subscriptions\">Subscriptions</a> section for more information."}},"in":"query"},{"name":"partStatuses","schema":{"type":"array","title":"partStatuses filters","description":"To filter by multiple partStatuses: `partStatuses=ASSIGNED&partStatuses=ISSUED`","items":{"type":"string","enum":["NO_PARTS","ASSIGNED","RESERVED","KITTED","STAGED","ISSUED"],"description":"Part stage indicates the current readiness state of parts for this work order."}},"in":"query"},{"name":"parentSubWorkOrderTypes","schema":{"type":"array","title":"parentSubWorkOrderTypes filters","description":"To filter by multiple parentSubWorkOrderTypes: `parentSubWorkOrderTypes=PARENT&parentSubWorkOrderTypes=SUB_WORK_ORDER`","items":{"type":"string","enum":["PARENT","SUB_WORK_ORDER","STANDALONE"],"description":"Hierarchical role of the work order: PARENT (has sub-work orders), SUB_WORK_ORDER (child of a parent), or STANDALONE (neither parent nor sub-work order)."}},"in":"query"},{"name":"show_upcoming","schema":{"type":"boolean","title":"show upcoming work orders","description":"Include work orders with a future start date"},"in":"query"},{"name":"updatedAt[gte]","schema":{"type":"string","format":"date-time","description":"Return records whose updatedAt is at or after this ISO 8601 date-time (UTC).","example":"2024-01-01T00:00:00.000Z"},"in":"query"},{"name":"updatedAt[lte]","schema":{"type":"string","format":"date-time","description":"Return records whose updatedAt is at or before this ISO 8601 date-time (UTC).","example":"2024-12-31T23:59:59.999Z"},"in":"query"},{"name":"createdAt[gte]","schema":{"type":"string","format":"date-time","description":"Return records whose createdAt is at or after this ISO 8601 date-time (UTC).","example":"2024-01-01T00:00:00.000Z"},"in":"query"},{"name":"createdAt[lte]","schema":{"type":"string","format":"date-time","description":"Return records whose createdAt is at or before this ISO 8601 date-time (UTC).","example":"2024-12-31T23:59:59.999Z"},"in":"query"},{"in":"query","name":"sort","schema":{"description":"Attribute on which to sort the list. (for descending order, prefix attribute with '-'). ","type":"string","enum":["updatedAt","createdAt","dueDate","startedAt","completedAt","-updatedAt","-createdAt","-dueDate","-startedAt","-completedAt"]}},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","description":"To expand multiple fields: `expand=thumbnail&expand=assignees`","type":"array","items":{"type":"string","enum":["thumbnail","assignees","categories","parts","asset","location","procedure","team_ids","vendor_ids","times","time_items","expenditures","extra_fields","part_extra_fields","asset_extra_fields","location_extra_fields","estimated_time"]}}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Work Orders list","content":{"application/json":{"schema":{"type":"object","required":["workOrders","nextCursor","nextPageUrl"],"properties":{"workOrders":{"type":"array","items":{"type":"object","required":["id","sequentialId","title","updatedAt","status"],"properties":{"id":{"type":"integer","description":"Global ID of the work order"},"sequentialId":{"type":"integer","description":"Organization specific ID of the work order"},"title":{"type":"string"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","ON_HOLD","DONE","CANCELED","SKIPPED"],"description":"<br /><em>Note:</em> It is also possible to register a webhook to get notified when the status of any work order changes. Please see the <a href=\"#tag/Subscriptions\">Subscriptions</a> section for more information."},"completedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was last marked as DONE","example":"2022-01-01T00:00:00.000Z"},"completerId":{"nullable":true,"type":"integer","description":"ID of the user who completed the work order"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was created","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"nullable":true,"type":"integer","description":"ID of the user who created the work order"},"customerId":{"nullable":true,"type":"integer","description":"ID of the customer linked to the work order","example":128},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was deleted","example":"2022-01-01T00:00:00.000Z"},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order is due","example":"2022-01-01T00:00:00.000Z"},"dueDateIsFullDay":{"nullable":true,"type":"boolean"},"lastMessageSentAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the last comment was added to the work order","example":"2022-01-01T00:00:00.000Z"},"startDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set","example":"2022-01-01T00:00:00.000Z"},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order","example":611},"nextId":{"nullable":true,"type":"integer"},"organizationId":{"type":"number"},"partsAvailability":{"type":"string","enum":["PARTS_AVAILABLE","PARTS_UNAVAILABLE","PARTIAL_PARTS","PARTS_AVAILABLE_BUT_OVERCOMMITTED"],"description":"Computed parts availability for this work order based on current inventory levels."},"partStatus":{"type":"string","enum":["NO_PARTS","ASSIGNED","RESERVED","KITTED","STAGED","ISSUED"],"description":"Part stage indicates the current readiness state of parts for this work order."},"previousId":{"nullable":true,"type":"integer"},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"recurrenceInfo":{"type":"object","nullable":true,"example":{"type":"WEEKLY","interval":3,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"oneOf":[{"type":"object","title":"Daily","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Weekly","required":["type","days"],"nullable":true,"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between events","minimum":1,"maximum":52,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"]}},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Monthly","required":["type","day"],"nullable":true,"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between events","minimum":1,"maximum":24,"default":1},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month the event will occur"},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Yearly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between events","minimum":1,"maximum":1000,"default":1},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Periodically","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"PERIODICALLY","enum":["PERIODICALLY"]},"interval":{"type":"integer","description":"Number of seconds between events","minimum":0},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}}]},"requesterId":{"nullable":true,"type":"integer","description":"ID of the user who requested the work order through the Work Request feature"},"type":{"type":"string","enum":["CYCLE_COUNT","OTHER","PREVENTIVE","REACTIVE"],"description":"Valid types of Work Orders, including options that are not available for creation/update. Historical Work Orders may have a null type.","default":null,"nullable":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Estimated Budget\") (expand with query parameter)","additionalProperties":{"type":"string"},"example":{"Estimated Budget":"$250"},"nullable":false},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"workOrderSummary":{"nullable":true,"type":"object","description":"Work Order Summary. Null when no summary is available.","properties":{"content":{"type":"string","description":"The original completion note content","example":"Replaced the motor bearings and aligned the shaft."},"summary":{"nullable":true,"type":"string","description":"AI-generated summary of the content","example":"Motor bearing replacement and shaft alignment completed."},"authorId":{"nullable":true,"type":"integer","description":"ID of the user who authored the completion note","example":963}}},"assignees":{"type":"array","description":"Either the teamId, the userId or the user email address (expand with query parameter)","items":{"type":"object","title":"assignees","required":["type","id"],"properties":{"type":{"type":"string","example":"USER","enum":["USER","TEAM"]},"id":{"oneOf":[{"type":"integer"},{"type":"string"}]}}},"nullable":false},"categories":{"type":"array","description":"List of categories that identify the work order (expand with query parameter)","items":{"type":"string","example":"Cleaning","uniqueItems":true},"nullable":false},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":false,"description":"(expand with query parameter)"},"asset":{"type":"object","required":["id","name","description","parentId","criticalityId","locationId","serialNumber","createdAt","updatedAt","creatorId"],"description":"Asset linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"},"name":{"type":"string","example":"Forklift"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the asset creator"},"assetExtraFields":{"type":"object","description":"Asset-level custom field values. Present (possibly an empty object) when `asset_extra_fields` is requested and the parent Asset is present. Requesting this implicitly enables `asset` if not already requested.","additionalProperties":{"type":"string"}}},"nullable":true},"location":{"type":"object","required":["id","name"],"description":"Location linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the location"},"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the location was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the location was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"locationExtraFields":{"type":"object","description":"Location-level custom field values. Present (possibly an empty object) when `location_extra_fields` is requested and the parent Location is present. Requesting this implicitly enables `location` if not already requested.","additionalProperties":{"type":"string"}}},"nullable":true},"parts":{"type":"array","description":"Parts attached to the Work Order (expand with query parameter)","items":{"type":"object","required":["id","name","description","area","unitCost","availableQuantity","minimumQuantity","barcode","quantityUsed","copyOnRecurring"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the part"},"name":{"type":"string","example":"Locknut - 1/8"},"description":{"type":"string","nullable":true,"example":""},"area":{"type":"string","example":"tool room","nullable":true},"unitCost":{"type":"integer","nullable":true,"description":"Cost in cents. For example, for $1.20, put 120.","example":120},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"quantityUsed":{"type":"integer","description":"Quantity used in the work order.","example":120},"copyOnRecurring":{"type":"string","description":"Indicates if the parts will be copied to the next work order in the chain (if applicable).","default":"Default","enum":["NoCopy","Copy","Default"]},"locationId":{"type":"number","description":"Global ID of the location of the part","nullable":true,"example":852},"extraFields":{"type":"object","description":"Work Order-scoped custom fields for this Part on this specific Work Order. These are distinct from Part-level custom fields (see `partExtraFields`).","additionalProperties":{"type":"string"}},"partExtraFields":{"type":"object","description":"Part-level custom fields defined on the Part itself (not specific to this Work Order). Present (possibly an empty object) when `part_extra_fields` is requested and Parts are present. Requesting this implicitly enables `parts` if not already requested.","additionalProperties":{"type":"string"}}}},"nullable":false},"procedure":{"type":"object","description":"Procedure attached to the work order (expand with query parameter)","nullable":false,"required":["title","fields"],"properties":{"id":{"type":"number","example":1234,"description":"ID representing a procedure"},"templateIds":{"type":"array","items":{"type":"number"},"example":[1234,1235],"description":"IDs of the procedure template of the procedure","nullable":true},"title":{"type":"string","description":"Title of the procedure","example":"Control dashboard audit"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure"},"score":{"type":"number","example":1,"description":"Score of a procedure"},"fields":{"type":"array","items":{"type":"object","required":["id","label","required","type","value"],"properties":{"id":{"type":"number","example":1234,"description":"ID of the procedure field"},"parentId":{"type":"number","example":1233,"nullable":true,"description":"ID of the parent of the current procedure field"},"procedureTemplateId":{"type":"number","example":1234,"nullable":true,"description":"ID of the procedure template this field originated from."},"procedureTemplateFieldId":{"type":"number","example":5678,"nullable":true,"description":"ID of the procedure template field this field originated from."},"required":{"type":"boolean","description":"Indicate if field is required to be filled."},"description":{"example":"Number of green lights","type":"string","nullable":true,"description":"Description of the procedure field"},"type":{"type":"string","example":"NUMBER","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"],"description":"Type of procedure field"},"label":{"type":"string","example":"Number of green lights","description":"Label of a procedure field"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure field"},"score":{"type":"number","example":1,"description":"Score of a procedure field"},"value":{"type":"object","description":"Current value of a procedure field","properties":{"text":{"type":"string","example":"12","nullable":true},"attachment":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"deprecated":true},"attachments":{"type":"array","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"notes":{"nullable":true,"type":"object","properties":{"text":{"type":"string","example":"1 light bulb is burned out."}},"description":"Note added to a procedure field"},"hasAttachments":{"type":"boolean","example":"true","nullable":true}}},"meter":{"nullable":true,"type":"object","properties":{"id":{"type":"number","description":"Global ID of the meter.","example":123},"name":{"type":"string","description":"Name of the meters"}},"description":"Meter of a procedure field. Will be filled if the type of the field is meter"},"assignees":{"nullable":true,"type":"object","properties":{"userIds":{"type":"array","items":{"type":"number"}},"teamIds":{"type":"array","items":{"type":"number"}}}},"isDateAndTime":{"type":"boolean","nullable":true,"description":"Indicate if a DATE field also contains the time","example":false}}}}}},"teamIds":{"type":"array","description":"List of team ids assigned to the work order (expand with query parameter)","items":{"type":"integer"},"nullable":false},"times":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Type of the entry","enum":["EXPENSE","PART","TIME"]},"costPerUnit":{"type":"number","nullable":true,"description":"Cost per part in cents or cents per hour"},"description":{"type":"string","nullable":true,"description":"Description of the expense or part description "},"quantity":{"type":"number","description":"Number of parts or number of hours"},"rowTotal":{"type":"number","description":"Total cost in cents"},"durationTotal":{"type":"number","description":"Total duration in seconds"},"userId":{"type":"integer","nullable":true,"description":"ID of the user who logged the time entry"},"partId":{"type":"integer","nullable":true,"description":"ID of the part used in this cost entry"}}}},"timeItems":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Type of the entry","enum":["EXPENSE","PART","TIME"]},"costPerUnit":{"type":"number","nullable":true,"description":"Cost per part in cents or cents per hour"},"description":{"type":"string","nullable":true,"description":"Description of the expense or part description "},"quantity":{"type":"number","description":"Number of parts or number of hours"},"rowTotal":{"type":"number","description":"Total cost in cents"},"durationTotal":{"type":"number","description":"Total duration in seconds"},"userId":{"type":"integer","nullable":true,"description":"ID of the user who logged the time entry"},"partId":{"type":"integer","nullable":true,"description":"ID of the part used in this cost entry"}}}},"expenditures":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Type of the entry","enum":["EXPENSE","PART","TIME"]},"costPerUnit":{"type":"number","nullable":true,"description":"Cost per part in cents or cents per hour"},"description":{"type":"string","nullable":true,"description":"Description of the expense or part description "},"quantity":{"type":"number","description":"Number of parts or number of hours"},"rowTotal":{"type":"number","description":"Total cost in cents"},"durationTotal":{"type":"number","description":"Total duration in seconds"},"userId":{"type":"integer","nullable":true,"description":"ID of the user who logged the time entry"},"partId":{"type":"integer","nullable":true,"description":"ID of the part used in this cost entry"}}}}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Work Orders.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Work Orders.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Work Orders"]}},"/workorders/{id}":{"get":{"summary":"Get work order","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the workOrder","example":"1"},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","description":"To expand multiple fields: `expand=assignees&expand=asset`","type":"array","items":{"type":"string","enum":["assignees","asset","estimated_time","location","parts","times","time_items","expenditures","extra_fields","part_extra_fields","asset_extra_fields","location_extra_fields"]}}},{"name":"useSequentialId","schema":{"type":"boolean","description":"Whether to use the sequential ID instead of the global ID"},"in":"query"}],"responses":{"200":{"description":"Successfully retrieved workOrder's information","content":{"application/json":{"schema":{"type":"object","required":["workOrder"],"properties":{"workOrder":{"type":"object","required":["updatedAt","status","title","createdAt","creatorId","id","sequentialId","organizationId"],"properties":{"id":{"type":"integer","description":"Global ID of the work order"},"sequentialId":{"type":"integer","description":"Organization specific ID of the work order"},"assetId":{"nullable":true,"type":"integer","example":42},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the work order","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"categories":{"type":"array","description":"List of categories that identify the work order","items":{"type":"string","example":"Cleaning","uniqueItems":true}},"completedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was last marked as DONE","example":"2022-01-01T00:00:00.000Z"},"completerId":{"nullable":true,"type":"integer","description":"ID of the user who completed the work order"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was created","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"nullable":true,"type":"integer","description":"ID of the user who created the work order"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was deleted","example":"2022-01-01T00:00:00.000Z"},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDateIsFullDay":{"nullable":true,"type":"boolean"},"dueDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order is due","example":"2022-01-01T00:00:00.000Z"},"estimatedTime":{"type":"integer","nullable":true,"description":"The estimated time taken in seconds to complete the work order (expand with query parameter)","example":3600},"externalData":{"description":"Extra data that can be attached to the work order, for example to help reference to a matching record in an external system.","nullable":true,"oneOf":[{"type":"object","example":{"popularErpSolutionId":"asd732da"}},{"type":"number","example":732},{"type":"string","example":"asd732da"}]},"isParent":{"nullable":true,"type":"boolean","description":"If this is a parent work order"},"lastMessageSentAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the last comment was added to the work order","example":"2022-01-01T00:00:00.000Z"},"startDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set","example":"2022-01-01T00:00:00.000Z"},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order","example":611},"nextId":{"nullable":true,"type":"integer"},"organizationId":{"type":"number"},"parentId":{"nullable":true,"type":"integer","description":"The ID of the parent work order"},"partsAvailability":{"type":"string","enum":["PARTS_AVAILABLE","PARTS_UNAVAILABLE","PARTIAL_PARTS","PARTS_AVAILABLE_BUT_OVERCOMMITTED"],"description":"Computed parts availability for this work order based on current inventory levels."},"partStatus":{"type":"string","enum":["NO_PARTS","ASSIGNED","RESERVED","KITTED","STAGED","ISSUED"],"description":"Part stage indicates the current readiness state of parts for this work order."},"previousId":{"nullable":true,"type":"integer"},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"recurrenceInfo":{"type":"object","nullable":true,"example":{"type":"WEEKLY","interval":3,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"oneOf":[{"type":"object","title":"Daily","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Weekly","required":["type","days"],"nullable":true,"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between events","minimum":1,"maximum":52,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"]}},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Monthly","required":["type","day"],"nullable":true,"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between events","minimum":1,"maximum":24,"default":1},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month the event will occur"},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Yearly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between events","minimum":1,"maximum":1000,"default":1},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Periodically","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"PERIODICALLY","enum":["PERIODICALLY"]},"interval":{"type":"integer","description":"Number of seconds between events","minimum":0},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}}]},"requesterId":{"nullable":true,"type":"integer","description":"ID of the user who requested the work order through the Work Request feature"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","ON_HOLD","DONE","CANCELED","SKIPPED"],"description":"<br /><em>Note:</em> It is also possible to register a webhook to get notified when the status of any work order changes. Please see the <a href=\"#tag/Subscriptions\">Subscriptions</a> section for more information."},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"title":{"type":"string"},"type":{"type":"string","enum":["CYCLE_COUNT","OTHER","PREVENTIVE","REACTIVE"],"description":"Valid types of Work Orders, including options that are not available for creation/update. Historical Work Orders may have a null type.","default":null,"nullable":true},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Estimated Budget\") (expand with query parameter)","additionalProperties":{"type":"string"},"example":{"Estimated Budget":"$250"},"nullable":false},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"assigneeIds":{"type":"array","description":"List of user ids assigned to the work order","items":{"type":"integer"}},"teamIds":{"type":"array","description":"List of team ids assigned to the work order","items":{"type":"integer"}},"customerId":{"nullable":true,"type":"integer","description":"ID of the customer linked to the work order","example":128},"procedure":{"type":"object","description":"Procedure attached to the work order","nullable":true,"required":["title","fields"],"properties":{"id":{"type":"number","example":1234,"description":"ID representing a procedure"},"templateIds":{"type":"array","items":{"type":"number"},"example":[1234,1235],"description":"IDs of the procedure template of the procedure","nullable":true},"title":{"type":"string","description":"Title of the procedure","example":"Control dashboard audit"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure"},"score":{"type":"number","example":1,"description":"Score of a procedure"},"fields":{"type":"array","items":{"type":"object","required":["id","label","required","type","value"],"properties":{"id":{"type":"number","example":1234,"description":"ID of the procedure field"},"parentId":{"type":"number","example":1233,"nullable":true,"description":"ID of the parent of the current procedure field"},"procedureTemplateId":{"type":"number","example":1234,"nullable":true,"description":"ID of the procedure template this field originated from."},"procedureTemplateFieldId":{"type":"number","example":5678,"nullable":true,"description":"ID of the procedure template field this field originated from."},"required":{"type":"boolean","description":"Indicate if field is required to be filled."},"description":{"example":"Number of green lights","type":"string","nullable":true,"description":"Description of the procedure field"},"type":{"type":"string","example":"NUMBER","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"],"description":"Type of procedure field"},"label":{"type":"string","example":"Number of green lights","description":"Label of a procedure field"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure field"},"score":{"type":"number","example":1,"description":"Score of a procedure field"},"value":{"type":"object","description":"Current value of a procedure field","properties":{"text":{"type":"string","example":"12","nullable":true},"attachment":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"deprecated":true},"attachments":{"type":"array","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"notes":{"nullable":true,"type":"object","properties":{"text":{"type":"string","example":"1 light bulb is burned out."}},"description":"Note added to a procedure field"},"hasAttachments":{"type":"boolean","example":"true","nullable":true}}},"meter":{"nullable":true,"type":"object","properties":{"id":{"type":"number","description":"Global ID of the meter.","example":123},"name":{"type":"string","description":"Name of the meters"}},"description":"Meter of a procedure field. Will be filled if the type of the field is meter"},"assignees":{"nullable":true,"type":"object","properties":{"userIds":{"type":"array","items":{"type":"number"}},"teamIds":{"type":"array","items":{"type":"number"}}}},"isDateAndTime":{"type":"boolean","nullable":true,"description":"Indicate if a DATE field also contains the time","example":false}}}}}},"progress":{"type":"object","description":"Progress information on the work order","nullable":true,"properties":{"openCount":{"type":"number","example":1},"inProgressCount":{"type":"number","example":1},"onHoldCount":{"type":"number","example":1},"doneCount":{"type":"number","example":1}}},"workOrderSummary":{"nullable":true,"type":"object","description":"Work Order Summary. Null when no summary is available.","properties":{"content":{"type":"string","description":"The original completion note content","example":"Replaced the motor bearings and aligned the shaft."},"summary":{"nullable":true,"type":"string","description":"AI-generated summary of the content","example":"Motor bearing replacement and shaft alignment completed."},"authorId":{"nullable":true,"type":"integer","description":"ID of the user who authored the completion note","example":963}}},"assignees":{"type":"array","description":"Either the teamId, the userId or the user email address (expand with query parameter)","items":{"type":"object","title":"assignees","required":["type","id"],"properties":{"type":{"type":"string","example":"USER","enum":["USER","TEAM"]},"id":{"oneOf":[{"type":"integer"},{"type":"string"}]}}},"nullable":false},"asset":{"type":"object","required":["id","name","description","parentId","criticalityId","locationId","serialNumber","createdAt","updatedAt","creatorId"],"description":"Asset linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"},"name":{"type":"string","example":"Forklift"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the asset creator"},"assetExtraFields":{"type":"object","description":"Asset-level custom field values. Present (possibly an empty object) when `asset_extra_fields` is requested and the parent Asset is present. Requesting this implicitly enables `asset` if not already requested.","additionalProperties":{"type":"string"}}},"nullable":true},"location":{"type":"object","required":["id","name"],"description":"Location linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the location"},"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the location was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the location was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"locationExtraFields":{"type":"object","description":"Location-level custom field values. Present (possibly an empty object) when `location_extra_fields` is requested and the parent Location is present. Requesting this implicitly enables `location` if not already requested.","additionalProperties":{"type":"string"}}},"nullable":true},"parts":{"type":"array","description":"Parts attached to the Work Order (expand with query parameter)","items":{"type":"object","required":["id","name","description","area","unitCost","availableQuantity","minimumQuantity","barcode","quantityUsed","copyOnRecurring"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the part"},"name":{"type":"string","example":"Locknut - 1/8"},"description":{"type":"string","nullable":true,"example":""},"area":{"type":"string","example":"tool room","nullable":true},"unitCost":{"type":"integer","nullable":true,"description":"Cost in cents. For example, for $1.20, put 120.","example":120},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"quantityUsed":{"type":"integer","description":"Quantity used in the work order.","example":120},"copyOnRecurring":{"type":"string","description":"Indicates if the parts will be copied to the next work order in the chain (if applicable).","default":"Default","enum":["NoCopy","Copy","Default"]},"locationId":{"type":"number","description":"Global ID of the location of the part","nullable":true,"example":852},"extraFields":{"type":"object","description":"Work Order-scoped custom fields for this Part on this specific Work Order. These are distinct from Part-level custom fields (see `partExtraFields`).","additionalProperties":{"type":"string"}},"partExtraFields":{"type":"object","description":"Part-level custom fields defined on the Part itself (not specific to this Work Order). Present (possibly an empty object) when `part_extra_fields` is requested and Parts are present. Requesting this implicitly enables `parts` if not already requested.","additionalProperties":{"type":"string"}}}},"nullable":false},"times":{"type":"array","description":"Time entries on the Work Order. Grouped by users (expand with query parameter)","items":{"type":"object","properties":{"type":{"type":"string","description":"Type of the entry","enum":["EXPENSE","PART","TIME"]},"costPerUnit":{"type":"number","nullable":true,"description":"Cost per part in cents or cents per hour"},"description":{"type":"string","nullable":true,"description":"Description of the expense or part description "},"quantity":{"type":"number","description":"Number of parts or number of hours"},"rowTotal":{"type":"number","description":"Total cost in cents"},"durationTotal":{"type":"number","description":"Total duration in seconds"},"userId":{"type":"integer","nullable":true,"description":"ID of the user who logged the time entry"},"partId":{"type":"integer","nullable":true,"description":"ID of the part used in this cost entry"}}},"nullable":false},"timeItems":{"type":"array","description":"Time entries on the Work Order. (expand with query parameter)","items":{"type":"object","properties":{"type":{"type":"string","description":"Type of the entry","enum":["EXPENSE","PART","TIME"]},"costPerUnit":{"type":"number","nullable":true,"description":"Cost per part in cents or cents per hour"},"description":{"type":"string","nullable":true,"description":"Description of the expense or part description "},"quantity":{"type":"number","description":"Number of parts or number of hours"},"rowTotal":{"type":"number","description":"Total cost in cents"},"durationTotal":{"type":"number","description":"Total duration in seconds"},"userId":{"type":"integer","nullable":true,"description":"ID of the user who logged the time entry"},"partId":{"type":"integer","nullable":true,"description":"ID of the part used in this cost entry"}}},"nullable":false},"expenditures":{"type":"array","description":"Other cost entries on the Work Order. Grouped by users (expand with query parameter)","items":{"type":"object","properties":{"type":{"type":"string","description":"Type of the entry","enum":["EXPENSE","PART","TIME"]},"costPerUnit":{"type":"number","nullable":true,"description":"Cost per part in cents or cents per hour"},"description":{"type":"string","nullable":true,"description":"Description of the expense or part description "},"quantity":{"type":"number","description":"Number of parts or number of hours"},"rowTotal":{"type":"number","description":"Total cost in cents"},"durationTotal":{"type":"number","description":"Total duration in seconds"},"userId":{"type":"integer","nullable":true,"description":"ID of the user who logged the time entry"},"partId":{"type":"integer","nullable":true,"description":"ID of the part used in this cost entry"}}},"nullable":false}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified workOrder or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Work Orders"]},"patch":{"summary":"Update work order","parameters":[{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","description":"To expand multiple fields: `expand=assignees&expand=asset`","type":"array","items":{"type":"string","enum":["assignees","asset","estimated_time","location","parts","times","time_items","expenditures","extra_fields"]}}},{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the work order","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Update data","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assetId":{"nullable":true,"type":"integer"},"assignees":{"type":"array","description":"Either the teamId, the userId or the user email address","items":{"type":"object","title":"assignees","required":["type","id"],"properties":{"type":{"type":"string","example":"USER","enum":["USER","TEAM"]},"id":{"oneOf":[{"type":"integer"},{"type":"string"}]}}}},"requesterId":{"oneOf":[{"type":"integer","nullable":true},{"type":"string"}],"description":"ID or email of the user who requested the work order"},"categories":{"type":"array","description":"List of categories that identify the work order","items":{"type":"string","example":"Cleaning","uniqueItems":true}},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order is due","example":"2022-01-01T00:00:00.000Z"},"estimatedTime":{"type":"integer","nullable":true,"description":"The estimated time taken in seconds to complete the work order","example":3600},"externalData":{"description":"Extra data that can be attached to the work order, for example to help reference to a matching record in an external system.","nullable":true,"oneOf":[{"type":"object","example":{"popularErpSolutionId":"asd732da"}},{"type":"number","example":732},{"type":"string","example":"asd732da"}]},"startDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set","example":"2022-01-01T00:00:00.000Z"},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order"},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"procedure":{"type":"object","nullable":true,"required":["title","fields"],"properties":{"id":{"type":"number","example":1234,"deprecated":true,"description":"You should favor 'procedureTemplateId' to attach a procedure template."},"title":{"type":"string","description":"Title of the procedure","example":"Control dashboard audit"},"fields":{"type":"array","items":{"type":"object","required":["type","label"],"properties":{"label":{"type":"string","example":"Metal Parts: broken, loose, dented, rusty, missing"},"type":{"type":"string","example":"INSPECTION_CHECK","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"]},"description":{"type":"string","nullable":true},"choices":{"type":"array","items":{"example":"Partially","type":"string"}},"urls":{"type":"array","items":{"type":"object","required":["link"],"properties":{"label":{"type":"string","description":"Label of the url","example":"MaintainX Website"},"link":{"type":"string","description":"Link","example":"www.getmaintainx.com"}}}},"meterId":{"type":"number","example":1,"nullable":true,"description":"Id of the meter"},"isDateAndTime":{"type":"boolean","default":false,"description":"Indicate if a DATE field also contains the time","example":false},"index":{"type":"number","example":1,"description":"Order which the row is displayed"}}},"description":"Steps of a procedure"}}},"procedureTemplateId":{"type":"number","nullable":true,"description":"ID of the procedure template to attach"},"recurrenceInfo":{"type":"object","nullable":true,"example":{"type":"WEEKLY","interval":3,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"oneOf":[{"type":"object","title":"Daily","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Weekly","required":["type","days"],"nullable":true,"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between events","minimum":1,"maximum":52,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"]}},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Monthly","required":["type","day"],"nullable":true,"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between events","minimum":1,"maximum":24,"default":1},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month the event will occur"},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Yearly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between events","minimum":1,"maximum":1000,"default":1},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Periodically","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"PERIODICALLY","enum":["PERIODICALLY"]},"interval":{"type":"integer","description":"Number of seconds between events","minimum":0},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}}]},"title":{"type":"string"},"type":{"type":"string","enum":["OTHER","REACTIVE","PREVENTIVE"],"description":"Valid types of Work Orders."},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Estimated Time Allotted\")","additionalProperties":{"type":"string"},"example":{"Estimated Time Allotted":"24 Hours"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"partsUsed":{"type":"array","description":"Parts IDs and quantities used in this work order","items":{"type":"object","required":["partId"],"properties":{"partId":{"type":"integer","example":963,"description":"Global ID of the part"},"quantityUsed":{"type":"integer","description":"Quantity used in the work order.","example":120},"locationId":{"type":"integer","nullable":true,"description":"Global ID of the location of the part","example":852},"copyOnRecurring":{"type":"string","description":"Indicates if the parts will be copied to the next work order in the chain (if applicable).","default":"Default","enum":["NoCopy","Copy","Default"]}}}}}}}}},"responses":{"200":{"description":"Successfully updated work order's information","content":{"application/json":{"schema":{"title":"WorkOrder","type":"object","description":"Work order information","properties":{"workOrder":{"title":"","type":"object","required":["updatedAt","status","title","createdAt","creatorId","id","sequentialId","organizationId"],"properties":{"id":{"type":"integer","description":"Global ID of the work order"},"sequentialId":{"type":"integer","description":"Organization specific ID of the work order"},"assetId":{"nullable":true,"type":"integer","example":42},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the work order","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"categories":{"type":"array","description":"List of categories that identify the work order","items":{"type":"string","example":"Cleaning","uniqueItems":true}},"completedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was last marked as DONE","example":"2022-01-01T00:00:00.000Z"},"completerId":{"nullable":true,"type":"integer","description":"ID of the user who completed the work order"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was created","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"nullable":true,"type":"integer","description":"ID of the user who created the work order"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was deleted","example":"2022-01-01T00:00:00.000Z"},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDateIsFullDay":{"nullable":true,"type":"boolean"},"dueDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order is due","example":"2022-01-01T00:00:00.000Z"},"estimatedTime":{"type":"integer","nullable":true,"description":"The estimated time taken in seconds to complete the work order","example":3600},"externalData":{"description":"Extra data that can be attached to the work order, for example to help reference to a matching record in an external system.","nullable":true,"oneOf":[{"type":"object","example":{"popularErpSolutionId":"asd732da"}},{"type":"number","example":732},{"type":"string","example":"asd732da"}]},"isParent":{"nullable":true,"type":"boolean","description":"If this is a parent work order"},"lastMessageSentAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the last comment was added to the work order","example":"2022-01-01T00:00:00.000Z"},"startDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set","example":"2022-01-01T00:00:00.000Z"},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order","example":611},"nextId":{"nullable":true,"type":"integer"},"organizationId":{"type":"number"},"parentId":{"nullable":true,"type":"integer","description":"The ID of the parent work order"},"partsAvailability":{"type":"string","enum":["PARTS_AVAILABLE","PARTS_UNAVAILABLE","PARTIAL_PARTS","PARTS_AVAILABLE_BUT_OVERCOMMITTED"],"description":"Computed parts availability for this work order based on current inventory levels."},"partStatus":{"type":"string","enum":["NO_PARTS","ASSIGNED","RESERVED","KITTED","STAGED","ISSUED"],"description":"Part stage indicates the current readiness state of parts for this work order."},"previousId":{"nullable":true,"type":"integer"},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"recurrenceInfo":{"type":"object","nullable":true,"example":{"type":"WEEKLY","interval":3,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"oneOf":[{"type":"object","title":"Daily","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Weekly","required":["type","days"],"nullable":true,"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between events","minimum":1,"maximum":52,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"]}},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Monthly","required":["type","day"],"nullable":true,"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between events","minimum":1,"maximum":24,"default":1},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month the event will occur"},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Yearly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between events","minimum":1,"maximum":1000,"default":1},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Periodically","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"PERIODICALLY","enum":["PERIODICALLY"]},"interval":{"type":"integer","description":"Number of seconds between events","minimum":0},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}}]},"requesterId":{"nullable":true,"type":"integer","description":"ID of the user who requested the work order through the Work Request feature"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","ON_HOLD","DONE","CANCELED","SKIPPED"],"description":"<br /><em>Note:</em> It is also possible to register a webhook to get notified when the status of any work order changes. Please see the <a href=\"#tag/Subscriptions\">Subscriptions</a> section for more information."},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"title":{"type":"string"},"type":{"type":"string","enum":["CYCLE_COUNT","OTHER","PREVENTIVE","REACTIVE"],"description":"Valid types of Work Orders, including options that are not available for creation/update. Historical Work Orders may have a null type.","default":null,"nullable":true},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Estimated Time Allotted\")","additionalProperties":{"type":"string"},"example":{"Estimated Time Allotted":"24 Hours"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"assigneeIds":{"type":"array","description":"List of user ids assigned to the work order","items":{"type":"integer"}},"teamIds":{"type":"array","description":"List of team ids assigned to the work order","items":{"type":"integer"}},"customerId":{"nullable":true,"type":"integer","description":"ID of the customer linked to the work order","example":128},"procedure":{"type":"object","description":"Procedure attached to the work order","nullable":true,"required":["title","fields"],"properties":{"id":{"type":"number","example":1234,"description":"ID representing a procedure"},"templateIds":{"type":"array","items":{"type":"number"},"example":[1234,1235],"description":"IDs of the procedure template of the procedure","nullable":true},"title":{"type":"string","description":"Title of the procedure","example":"Control dashboard audit"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure"},"score":{"type":"number","example":1,"description":"Score of a procedure"},"fields":{"type":"array","items":{"type":"object","required":["id","label","required","type","value"],"properties":{"id":{"type":"number","example":1234,"description":"ID of the procedure field"},"parentId":{"type":"number","example":1233,"nullable":true,"description":"ID of the parent of the current procedure field"},"procedureTemplateId":{"type":"number","example":1234,"nullable":true,"description":"ID of the procedure template this field originated from."},"procedureTemplateFieldId":{"type":"number","example":5678,"nullable":true,"description":"ID of the procedure template field this field originated from."},"required":{"type":"boolean","description":"Indicate if field is required to be filled."},"description":{"example":"Number of green lights","type":"string","nullable":true,"description":"Description of the procedure field"},"type":{"type":"string","example":"NUMBER","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"],"description":"Type of procedure field"},"label":{"type":"string","example":"Number of green lights","description":"Label of a procedure field"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure field"},"score":{"type":"number","example":1,"description":"Score of a procedure field"},"value":{"type":"object","description":"Current value of a procedure field","properties":{"text":{"type":"string","example":"12","nullable":true},"attachment":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"deprecated":true},"attachments":{"type":"array","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"notes":{"nullable":true,"type":"object","properties":{"text":{"type":"string","example":"1 light bulb is burned out."}},"description":"Note added to a procedure field"},"hasAttachments":{"type":"boolean","example":"true","nullable":true}}},"meter":{"nullable":true,"type":"object","properties":{"id":{"type":"number","description":"Global ID of the meter.","example":123},"name":{"type":"string","description":"Name of the meters"}},"description":"Meter of a procedure field. Will be filled if the type of the field is meter"},"assignees":{"nullable":true,"type":"object","properties":{"userIds":{"type":"array","items":{"type":"number"}},"teamIds":{"type":"array","items":{"type":"number"}}}},"isDateAndTime":{"type":"boolean","nullable":true,"description":"Indicate if a DATE field also contains the time","example":false}}}}}},"progress":{"type":"object","description":"Progress information on the work order","nullable":true,"properties":{"openCount":{"type":"number","example":1},"inProgressCount":{"type":"number","example":1},"onHoldCount":{"type":"number","example":1},"doneCount":{"type":"number","example":1}}},"workOrderSummary":{"nullable":true,"type":"object","description":"Work Order Summary. Null when no summary is available.","properties":{"content":{"type":"string","description":"The original completion note content","example":"Replaced the motor bearings and aligned the shaft."},"summary":{"nullable":true,"type":"string","description":"AI-generated summary of the content","example":"Motor bearing replacement and shaft alignment completed."},"authorId":{"nullable":true,"type":"integer","description":"ID of the user who authored the completion note","example":963}}}}}}}}}},"400":{"description":"Could not update the work order","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Invalid priority","fieldPath":"priority","fieldValue":"Happy Birthday"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Work Order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Work Order Not Found"}}}}}}},"tags":["Work Orders"]},"delete":{"summary":"Delete workOrder","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the workOrder","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the workOrder"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified workOrder.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"workOrder Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Work Orders"]}},"/workorders/{id}/attachments/{filename}":{"put":{"summary":"Update work order attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the work order.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"datasheet.pdf"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the attachment.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"application/x-indesign":{"schema":{"type":"object","format":"binary"}},"application/epub+zip":{"schema":{"type":"object","format":"binary"}},"application/x-xpinstall":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"schema":{"type":"object","format":"binary"}},"application/zip":{"schema":{"type":"object","format":"binary"}},"application/x-tar":{"schema":{"type":"object","format":"binary"}},"application/x-rar-compressed":{"schema":{"type":"object","format":"binary"}},"application/gzip":{"schema":{"type":"object","format":"binary"}},"application/x-bzip2":{"schema":{"type":"object","format":"binary"}},"application/x-7z-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-apple-diskimage":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.arrow.file":{"schema":{"type":"object","format":"binary"}},"video/mp4":{"schema":{"type":"object","format":"binary"}},"audio/midi":{"schema":{"type":"object","format":"binary"}},"video/matroska":{"schema":{"type":"object","format":"binary"}},"video/webm":{"schema":{"type":"object","format":"binary"}},"video/quicktime":{"schema":{"type":"object","format":"binary"}},"video/vnd.avi":{"schema":{"type":"object","format":"binary"}},"audio/wav":{"schema":{"type":"object","format":"binary"}},"audio/qcelp":{"schema":{"type":"object","format":"binary"}},"audio/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"video/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-asf":{"schema":{"type":"object","format":"binary"}},"video/mpeg":{"schema":{"type":"object","format":"binary"}},"video/3gpp":{"schema":{"type":"object","format":"binary"}},"audio/mpeg":{"schema":{"type":"object","format":"binary"}},"audio/mp4":{"schema":{"type":"object","format":"binary"}},"video/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg; codecs=opus":{"schema":{"type":"object","format":"binary"}},"application/ogg":{"schema":{"type":"object","format":"binary"}},"audio/flac":{"schema":{"type":"object","format":"binary"}},"audio/ape":{"schema":{"type":"object","format":"binary"}},"audio/wavpack":{"schema":{"type":"object","format":"binary"}},"audio/amr":{"schema":{"type":"object","format":"binary"}},"application/pdf":{"schema":{"type":"object","format":"binary"}},"application/x-elf":{"schema":{"type":"object","format":"binary"}},"application/x-mach-binary":{"schema":{"type":"object","format":"binary"}},"application/x-msdownload":{"schema":{"type":"object","format":"binary"}},"application/x-shockwave-flash":{"schema":{"type":"object","format":"binary"}},"application/rtf":{"schema":{"type":"object","format":"binary"}},"application/wasm":{"schema":{"type":"object","format":"binary"}},"font/woff":{"schema":{"type":"object","format":"binary"}},"font/woff2":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-fontobject":{"schema":{"type":"object","format":"binary"}},"font/ttf":{"schema":{"type":"object","format":"binary"}},"font/otf":{"schema":{"type":"object","format":"binary"}},"font/collection":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"video/x-flv":{"schema":{"type":"object","format":"binary"}},"application/postscript":{"schema":{"type":"object","format":"binary"}},"application/eps":{"schema":{"type":"object","format":"binary"}},"application/x-xz":{"schema":{"type":"object","format":"binary"}},"application/x-sqlite3":{"schema":{"type":"object","format":"binary"}},"application/x-nintendo-nes-rom":{"schema":{"type":"object","format":"binary"}},"application/x-google-chrome-extension":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-cab-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-deb":{"schema":{"type":"object","format":"binary"}},"application/x-unix-archive":{"schema":{"type":"object","format":"binary"}},"application/x-rpm":{"schema":{"type":"object","format":"binary"}},"application/x-compress":{"schema":{"type":"object","format":"binary"}},"application/lzip":{"schema":{"type":"object","format":"binary"}},"application/x-cfb":{"schema":{"type":"object","format":"binary"}},"application/x-mie":{"schema":{"type":"object","format":"binary"}},"application/mxf":{"schema":{"type":"object","format":"binary"}},"video/mp2t":{"schema":{"type":"object","format":"binary"}},"application/x-blender":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"audio/aiff":{"schema":{"type":"object","format":"binary"}},"application/xml":{"schema":{"type":"object","format":"binary"}},"application/x-mobipocket-ebook":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"application/dicom":{"schema":{"type":"object","format":"binary"}},"audio/x-musepack":{"schema":{"type":"object","format":"binary"}},"text/calendar":{"schema":{"type":"object","format":"binary"}},"text/vcard":{"schema":{"type":"object","format":"binary"}},"text/vtt":{"schema":{"type":"object","format":"binary"}},"model/gltf-binary":{"schema":{"type":"object","format":"binary"}},"application/vnd.tcpdump.pcap":{"schema":{"type":"object","format":"binary"}},"audio/x-dsf":{"schema":{"type":"object","format":"binary"}},"application/x-ms-shortcut":{"schema":{"type":"object","format":"binary"}},"application/x-ft-apple.alias":{"schema":{"type":"object","format":"binary"}},"audio/x-voc":{"schema":{"type":"object","format":"binary"}},"audio/vnd.dolby.dd-raw":{"schema":{"type":"object","format":"binary"}},"audio/x-m4a":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"video/x-m4v":{"schema":{"type":"object","format":"binary"}},"video/3gpp2":{"schema":{"type":"object","format":"binary"}},"application/x-esri-shape":{"schema":{"type":"object","format":"binary"}},"audio/aac":{"schema":{"type":"object","format":"binary"}},"audio/x-it":{"schema":{"type":"object","format":"binary"}},"audio/x-s3m":{"schema":{"type":"object","format":"binary"}},"audio/x-xm":{"schema":{"type":"object","format":"binary"}},"video/mp1s":{"schema":{"type":"object","format":"binary"}},"video/mp2p":{"schema":{"type":"object","format":"binary"}},"application/vnd.sketchup.skp":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"application/x-lzh-compressed":{"schema":{"type":"object","format":"binary"}},"application/pgp-encrypted":{"schema":{"type":"object","format":"binary"}},"application/x-asar":{"schema":{"type":"object","format":"binary"}},"model/stl":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-htmlhelp":{"schema":{"type":"object","format":"binary"}},"model/3mf":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"application/zstd":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-outlook":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.parquet":{"schema":{"type":"object","format":"binary"}},"application/java-vm":{"schema":{"type":"object","format":"binary"}},"application/x-arj":{"schema":{"type":"object","format":"binary"}},"application/x-cpio":{"schema":{"type":"object","format":"binary"}},"application/x-ace-compressed":{"schema":{"type":"object","format":"binary"}},"application/avro":{"schema":{"type":"object","format":"binary"}},"application/vnd.iccprofile":{"schema":{"type":"object","format":"binary"}},"application/x-ft-fbx":{"schema":{"type":"object","format":"binary"}},"application/vnd.visio":{"schema":{"type":"object","format":"binary"}},"application/vnd.android.package-archive":{"schema":{"type":"object","format":"binary"}},"application/x-ft-draco":{"schema":{"type":"object","format":"binary"}},"application/x-lz4":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.sheet.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.document.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/java-archive":{"schema":{"type":"object","format":"binary"}},"application/vnd.rn-realmedia":{"schema":{"type":"object","format":"binary"}},"application/x-spss-sav":{"schema":{"type":"object","format":"binary"}},"application/x-ms-regedit":{"schema":{"type":"object","format":"binary"}},"application/x-ft-windows-registry-hive":{"schema":{"type":"object","format":"binary"}},"application/x-jmp-data":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.keynote":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.numbers":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.pages":{"schema":{"type":"object","format":"binary"}},"application/x-apache-arrow":{"schema":{"type":"object","format":"binary"}},"application/x-lzip":{"schema":{"type":"object","format":"binary"}},"application/x.apple.alias":{"schema":{"type":"object","format":"binary"}},"application/x.ms.shortcut":{"schema":{"type":"object","format":"binary"}},"audio/opus":{"schema":{"type":"object","format":"binary"}},"audio/vnd.wave":{"schema":{"type":"object","format":"binary"}},"audio/x-flac":{"schema":{"type":"object","format":"binary"}},"video/x-matroska":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated work order's attachment.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified work order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"work order Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Work Orders"]},"delete":{"summary":"Remove work order attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the work order.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"attachment.xls"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully removed work order's attachment."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Attachment.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment Not Found"}}}}}}},"tags":["Work Orders"]}},"/workorders/{id}/comments":{"post":{"summary":"Create new comment on a work order","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"Global ID of the work order","example":"12345"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Comment to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"string","description":"Content of the comment to post"}}}}}},"responses":{"201":{"description":"Successfully created the comment","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number","description":"Global ID of the comment"}}}}}},"400":{"description":"Failed to create the comment","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"should have required property 'content'","fieldPath":"content"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Work Order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Work Order Not Found"}}}}}}},"tags":["Work Orders"]},"get":{"summary":"List work order comments","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Comments returned","type":"integer","minimum":1,"maximum":200,"default":100}}],"responses":{"200":{"description":"Successfully fetched Comments list","content":{"application/json":{"schema":{"type":"object","required":["comments","nextCursor","nextPageUrl"],"properties":{"comments":{"type":"array","items":{"type":"object","required":["id","authorId","content","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the comment"},"authorId":{"type":"number","description":"ID of the user who created the comment"},"content":{"type":"string","description":"Content of the comment to post"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the comment was created","example":"2022-01-01T00:00:00.000Z"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Comments.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Comments.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Cannot find the parent resource","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}}},"tags":["Work Orders"]}},"/workorders/{id}/costs":{"post":{"summary":"Create new cost on a work order","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"Global ID of the work order","example":"12345"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Cost to create","required":true,"content":{"application/json":{"schema":{"type":"object","oneOf":[{"title":"EXPENSE","type":"object","required":["type","costType","costPerUnit"],"properties":{"type":{"type":"string","description":"Type of the entry","enum":["EXPENSE"]},"costType":{"type":"string","description":"Cost type","enum":["LABOR","OTHER","TRAVEL"]},"costPerUnit":{"type":"number","description":"Cost per unit in cents.","nullable":true},"description":{"type":"string","nullable":true,"description":"Description of the expense or the time cost "}}},{"title":"TIME","type":"object","required":["type","costType","durationTotal"],"properties":{"type":{"type":"string","description":"Type of the entry","enum":["TIME"]},"costType":{"type":"string","description":"Cost type.","enum":["INSPECTION","OTHER","WORK"]},"durationTotal":{"type":"number","nullable":true,"description":"Total duration, in seconds."},"hourlyRate":{"type":"number","nullable":true,"description":"Hourly rate, in cents"},"description":{"type":"string","nullable":true,"description":"Description of the expense or the time cost "}}}]}}}},"responses":{"201":{"description":"Successfully created the cost","content":{"application/json":{"schema":{"type":"object","required":["total","id"],"properties":{"type":{"type":"string","description":"Type of the entry","enum":["EXPENSE","PART","TIME"]},"costPerUnit":{"type":"number","nullable":true,"description":"Cost per part in cents or cents per hour"},"description":{"type":"string","nullable":true,"description":"Description of the expense or part description "},"quantity":{"type":"number","description":"Number of parts or number of hours"},"rowTotal":{"type":"number","description":"Total cost in cents"},"durationTotal":{"type":"number","description":"Total duration in seconds"},"userId":{"type":"integer","nullable":true,"description":"ID of the user who logged the time entry"},"partId":{"type":"integer","nullable":true,"description":"ID of the part used in this cost entry"},"total":{"description":"Total cost in cents of the Work order","type":"number"},"id":{"description":"Created cost Id","type":"number"}}}}}},"400":{"description":"Failed to create the cost","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"should have required properties 'type', 'costType'","fieldPath":"type"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Work Order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Work Order Not Found"}}}}}}},"tags":["Work Orders"]},"get":{"summary":"Get costs information","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the work order","example":"1"}],"responses":{"200":{"description":"Successfully fetched costs","content":{"application/json":{"schema":{"type":"object","required":["costs"],"properties":{"costs":{"type":"object","required":["total","rows"],"properties":{"total":{"description":"Total cost in cents of the Work order","type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Type of the entry","enum":["EXPENSE","PART","TIME"]},"costPerUnit":{"type":"number","nullable":true,"description":"Cost per part in cents or cents per hour"},"description":{"type":"string","nullable":true,"description":"Description of the expense or part description "},"quantity":{"type":"number","description":"Number of parts or number of hours"},"rowTotal":{"type":"number","description":"Total cost in cents"},"durationTotal":{"type":"number","description":"Total duration in seconds"},"userId":{"type":"integer","nullable":true,"description":"ID of the user who logged the time entry"},"partId":{"type":"integer","nullable":true,"description":"ID of the part used in this cost entry"}}}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Work Order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Work Order Not Found"}}}}}}},"tags":["Work Orders"]}},"/workorders/{id}/emails":{"post":{"summary":"Send work order as an email","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"Global ID of the work order","example":"12345"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"email to create","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emails":{"type":"array","description":"Emails to send the Work Order to","items":{"type":"string","example":"example@gmail.com"}},"customMessage":{"type":"string","description":"Custom message to send with the Work Order","example":"This is a custom message","nullable":true},"exportOptions":{"type":"object","description":"Type of export options for the work order attached to the email","nullable":true,"properties":{"attachments":{"type":"boolean","description":"Include attachments","example":true,"nullable":true},"comments":{"type":"boolean","description":"Include comments","example":true,"nullable":true},"costs":{"type":"string","description":"Include cost-related information","example":"DETAILED","nullable":true,"enum":["DETAILED","NONE","SUMMARY"]},"history":{"type":"boolean","description":"Include work order history","nullable":true},"procedureFormat":{"type":"string","description":"Include procedure format","example":"DETAILED","nullable":true,"enum":["DETAILED","FLAGS_FAILS","NONE","SUMMARY"]},"images":{"type":"string","description":"Include images","example":"FULL_SIZE","nullable":true,"enum":["FULL_SIZE","ORIGINAL_SIZE","REGULAR_SIZE","SHOW_AS_FILE","THUMBNAIL_SIZE"]},"includeBasicInformation":{"type":"boolean","description":"Include basic information","example":true,"nullable":true},"includeExportInformation":{"type":"boolean","description":"Include export information","example":true,"nullable":true},"includeLocationAddress":{"type":"boolean","description":"Include location address","example":true,"nullable":true},"includedCustomFields":{"type":"array","description":"Include custom fields","nullable":true,"items":{"type":"string","example":"customField1"}},"priority":{"type":"boolean","description":"Include priority information","example":true,"nullable":true},"qrCode":{"type":"boolean","description":"Include QR code","example":true,"nullable":true},"signatureBox":{"type":"boolean","description":"Include signature box","example":true,"nullable":true},"vendorInformation":{"type":"boolean","description":"Include vendor information","example":true,"nullable":true},"vendors":{"type":"boolean","description":"Include vendors","example":true,"nullable":true},"workOrderInfo":{"type":"boolean","description":"Include work order information","example":true,"nullable":true}}}}}}}},"responses":{"201":{"description":"Successfully created the email","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"Global ID of the work order","example":12345}}}}}},"400":{"description":"Failed to create the email","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"An error occurred while sending the email","fieldPath":"type"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"You do not have permission to send this email","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Forbidden","fieldPath":"type"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified Work Order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Work Order Not Found"}}}}}}},"tags":["Work Orders"]}},"/workorders/{id}/partStatus":{"patch":{"summary":"Update work order part status","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the workOrder","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Update data","required":true,"content":{"application/json":{"schema":{"type":"object","required":["partStatus"],"properties":{"partStatus":{"type":"string","enum":["NO_PARTS","ASSIGNED","RESERVED","KITTED","STAGED","ISSUED"],"description":"Part stage indicates the current readiness state of parts for this work order."}}}}}},"responses":{"200":{"description":"Successfully updated work order's part status","content":{"application/json":{"schema":{"title":"WorkOrder","type":"object","description":"Work order information","required":["workOrder"],"properties":{"workOrder":{"title":"","type":"object","required":["updatedAt","status","title","createdAt","creatorId","id","sequentialId","organizationId"],"properties":{"id":{"type":"integer","description":"Global ID of the work order"},"sequentialId":{"type":"integer","description":"Organization specific ID of the work order"},"assetId":{"nullable":true,"type":"integer","example":42},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the work order","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"categories":{"type":"array","description":"List of categories that identify the work order","items":{"type":"string","example":"Cleaning","uniqueItems":true}},"completedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was last marked as DONE","example":"2022-01-01T00:00:00.000Z"},"completerId":{"nullable":true,"type":"integer","description":"ID of the user who completed the work order"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was created","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"nullable":true,"type":"integer","description":"ID of the user who created the work order"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was deleted","example":"2022-01-01T00:00:00.000Z"},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDateIsFullDay":{"nullable":true,"type":"boolean"},"dueDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order is due","example":"2022-01-01T00:00:00.000Z"},"estimatedTime":{"type":"integer","nullable":true,"description":"The estimated time taken in seconds to complete the work order","example":3600},"externalData":{"description":"Extra data that can be attached to the work order, for example to help reference to a matching record in an external system.","nullable":true,"oneOf":[{"type":"object","example":{"popularErpSolutionId":"asd732da"}},{"type":"number","example":732},{"type":"string","example":"asd732da"}]},"isParent":{"nullable":true,"type":"boolean","description":"If this is a parent work order"},"lastMessageSentAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the last comment was added to the work order","example":"2022-01-01T00:00:00.000Z"},"startDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set","example":"2022-01-01T00:00:00.000Z"},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order","example":611},"nextId":{"nullable":true,"type":"integer"},"organizationId":{"type":"number"},"parentId":{"nullable":true,"type":"integer","description":"The ID of the parent work order"},"partsAvailability":{"type":"string","enum":["PARTS_AVAILABLE","PARTS_UNAVAILABLE","PARTIAL_PARTS","PARTS_AVAILABLE_BUT_OVERCOMMITTED"],"description":"Computed parts availability for this work order based on current inventory levels."},"partStatus":{"type":"string","enum":["NO_PARTS","ASSIGNED","RESERVED","KITTED","STAGED","ISSUED"],"description":"Part stage indicates the current readiness state of parts for this work order."},"previousId":{"nullable":true,"type":"integer"},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"recurrenceInfo":{"type":"object","nullable":true,"example":{"type":"WEEKLY","interval":3,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"oneOf":[{"type":"object","title":"Daily","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Weekly","required":["type","days"],"nullable":true,"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between events","minimum":1,"maximum":52,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"]}},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Monthly","required":["type","day"],"nullable":true,"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between events","minimum":1,"maximum":24,"default":1},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month the event will occur"},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Yearly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between events","minimum":1,"maximum":1000,"default":1},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Periodically","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"PERIODICALLY","enum":["PERIODICALLY"]},"interval":{"type":"integer","description":"Number of seconds between events","minimum":0},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}}]},"requesterId":{"nullable":true,"type":"integer","description":"ID of the user who requested the work order through the Work Request feature"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","ON_HOLD","DONE","CANCELED","SKIPPED"],"description":"<br /><em>Note:</em> It is also possible to register a webhook to get notified when the status of any work order changes. Please see the <a href=\"#tag/Subscriptions\">Subscriptions</a> section for more information."},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"title":{"type":"string"},"type":{"type":"string","enum":["CYCLE_COUNT","OTHER","PREVENTIVE","REACTIVE"],"description":"Valid types of Work Orders, including options that are not available for creation/update. Historical Work Orders may have a null type.","default":null,"nullable":true},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Estimated Time Allotted\")","additionalProperties":{"type":"string"},"example":{"Estimated Time Allotted":"24 Hours"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"assigneeIds":{"type":"array","description":"List of user ids assigned to the work order","items":{"type":"integer"}},"teamIds":{"type":"array","description":"List of team ids assigned to the work order","items":{"type":"integer"}},"customerId":{"nullable":true,"type":"integer","description":"ID of the customer linked to the work order","example":128},"procedure":{"type":"object","description":"Procedure attached to the work order","nullable":true,"required":["title","fields"],"properties":{"id":{"type":"number","example":1234,"description":"ID representing a procedure"},"templateIds":{"type":"array","items":{"type":"number"},"example":[1234,1235],"description":"IDs of the procedure template of the procedure","nullable":true},"title":{"type":"string","description":"Title of the procedure","example":"Control dashboard audit"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure"},"score":{"type":"number","example":1,"description":"Score of a procedure"},"fields":{"type":"array","items":{"type":"object","required":["id","label","required","type","value"],"properties":{"id":{"type":"number","example":1234,"description":"ID of the procedure field"},"parentId":{"type":"number","example":1233,"nullable":true,"description":"ID of the parent of the current procedure field"},"procedureTemplateId":{"type":"number","example":1234,"nullable":true,"description":"ID of the procedure template this field originated from."},"procedureTemplateFieldId":{"type":"number","example":5678,"nullable":true,"description":"ID of the procedure template field this field originated from."},"required":{"type":"boolean","description":"Indicate if field is required to be filled."},"description":{"example":"Number of green lights","type":"string","nullable":true,"description":"Description of the procedure field"},"type":{"type":"string","example":"NUMBER","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"],"description":"Type of procedure field"},"label":{"type":"string","example":"Number of green lights","description":"Label of a procedure field"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure field"},"score":{"type":"number","example":1,"description":"Score of a procedure field"},"value":{"type":"object","description":"Current value of a procedure field","properties":{"text":{"type":"string","example":"12","nullable":true},"attachment":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"deprecated":true},"attachments":{"type":"array","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"notes":{"nullable":true,"type":"object","properties":{"text":{"type":"string","example":"1 light bulb is burned out."}},"description":"Note added to a procedure field"},"hasAttachments":{"type":"boolean","example":"true","nullable":true}}},"meter":{"nullable":true,"type":"object","properties":{"id":{"type":"number","description":"Global ID of the meter.","example":123},"name":{"type":"string","description":"Name of the meters"}},"description":"Meter of a procedure field. Will be filled if the type of the field is meter"},"assignees":{"nullable":true,"type":"object","properties":{"userIds":{"type":"array","items":{"type":"number"}},"teamIds":{"type":"array","items":{"type":"number"}}}},"isDateAndTime":{"type":"boolean","nullable":true,"description":"Indicate if a DATE field also contains the time","example":false}}}}}},"progress":{"type":"object","description":"Progress information on the work order","nullable":true,"properties":{"openCount":{"type":"number","example":1},"inProgressCount":{"type":"number","example":1},"onHoldCount":{"type":"number","example":1},"doneCount":{"type":"number","example":1}}},"workOrderSummary":{"nullable":true,"type":"object","description":"Work Order Summary. Null when no summary is available.","properties":{"content":{"type":"string","description":"The original completion note content","example":"Replaced the motor bearings and aligned the shaft."},"summary":{"nullable":true,"type":"string","description":"AI-generated summary of the content","example":"Motor bearing replacement and shaft alignment completed."},"authorId":{"nullable":true,"type":"integer","description":"ID of the user who authored the completion note","example":963}}}}}}}}}},"400":{"description":"Could not update the work order","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Invalid part status","fieldPath":"partStatus","fieldValue":"Happy Birthday"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Work Order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Work Order Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Work Orders"]}},"/workorders/{id}/procedure":{"delete":{"summary":"Detach procedure from work order","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the work order","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully detached procedure from work order."},"400":{"description":"Could not update the work order","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Invalid status","fieldPath":"status","fieldValue":"Happy Birthday"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified procedure.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not found"}}}}}}},"tags":["Work Orders"]}},"/workorders/{id}/procedure/fields/{index}/attachment":{"delete":{"summary":"Delete procedure field attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the work order","example":"1"},{"schema":{"type":"integer"},"name":"index","in":"path","required":true,"description":"Sequential index of the field in the procedure","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted procedure field's attachment."},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"You cannot edit this entity.","fieldPath":"organizationId","fieldValue":"1"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified attachment.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"attachment Not Found"}}}}}}},"tags":["Work Orders"]}},"/workorders/{id}/procedure/fields/{index}/attachment/{filename}":{"put":{"summary":"Update procedure field attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the work order","example":"1"},{"schema":{"type":"integer"},"name":"index","in":"path","required":true,"description":"Sequential index of the field in the procedure","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"datasheet.pdf"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the attachment.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"application/x-indesign":{"schema":{"type":"object","format":"binary"}},"application/epub+zip":{"schema":{"type":"object","format":"binary"}},"application/x-xpinstall":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"schema":{"type":"object","format":"binary"}},"application/zip":{"schema":{"type":"object","format":"binary"}},"application/x-tar":{"schema":{"type":"object","format":"binary"}},"application/x-rar-compressed":{"schema":{"type":"object","format":"binary"}},"application/gzip":{"schema":{"type":"object","format":"binary"}},"application/x-bzip2":{"schema":{"type":"object","format":"binary"}},"application/x-7z-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-apple-diskimage":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.arrow.file":{"schema":{"type":"object","format":"binary"}},"video/mp4":{"schema":{"type":"object","format":"binary"}},"audio/midi":{"schema":{"type":"object","format":"binary"}},"video/matroska":{"schema":{"type":"object","format":"binary"}},"video/webm":{"schema":{"type":"object","format":"binary"}},"video/quicktime":{"schema":{"type":"object","format":"binary"}},"video/vnd.avi":{"schema":{"type":"object","format":"binary"}},"audio/wav":{"schema":{"type":"object","format":"binary"}},"audio/qcelp":{"schema":{"type":"object","format":"binary"}},"audio/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"video/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-asf":{"schema":{"type":"object","format":"binary"}},"video/mpeg":{"schema":{"type":"object","format":"binary"}},"video/3gpp":{"schema":{"type":"object","format":"binary"}},"audio/mpeg":{"schema":{"type":"object","format":"binary"}},"audio/mp4":{"schema":{"type":"object","format":"binary"}},"video/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg; codecs=opus":{"schema":{"type":"object","format":"binary"}},"application/ogg":{"schema":{"type":"object","format":"binary"}},"audio/flac":{"schema":{"type":"object","format":"binary"}},"audio/ape":{"schema":{"type":"object","format":"binary"}},"audio/wavpack":{"schema":{"type":"object","format":"binary"}},"audio/amr":{"schema":{"type":"object","format":"binary"}},"application/pdf":{"schema":{"type":"object","format":"binary"}},"application/x-elf":{"schema":{"type":"object","format":"binary"}},"application/x-mach-binary":{"schema":{"type":"object","format":"binary"}},"application/x-msdownload":{"schema":{"type":"object","format":"binary"}},"application/x-shockwave-flash":{"schema":{"type":"object","format":"binary"}},"application/rtf":{"schema":{"type":"object","format":"binary"}},"application/wasm":{"schema":{"type":"object","format":"binary"}},"font/woff":{"schema":{"type":"object","format":"binary"}},"font/woff2":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-fontobject":{"schema":{"type":"object","format":"binary"}},"font/ttf":{"schema":{"type":"object","format":"binary"}},"font/otf":{"schema":{"type":"object","format":"binary"}},"font/collection":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"video/x-flv":{"schema":{"type":"object","format":"binary"}},"application/postscript":{"schema":{"type":"object","format":"binary"}},"application/eps":{"schema":{"type":"object","format":"binary"}},"application/x-xz":{"schema":{"type":"object","format":"binary"}},"application/x-sqlite3":{"schema":{"type":"object","format":"binary"}},"application/x-nintendo-nes-rom":{"schema":{"type":"object","format":"binary"}},"application/x-google-chrome-extension":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-cab-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-deb":{"schema":{"type":"object","format":"binary"}},"application/x-unix-archive":{"schema":{"type":"object","format":"binary"}},"application/x-rpm":{"schema":{"type":"object","format":"binary"}},"application/x-compress":{"schema":{"type":"object","format":"binary"}},"application/lzip":{"schema":{"type":"object","format":"binary"}},"application/x-cfb":{"schema":{"type":"object","format":"binary"}},"application/x-mie":{"schema":{"type":"object","format":"binary"}},"application/mxf":{"schema":{"type":"object","format":"binary"}},"video/mp2t":{"schema":{"type":"object","format":"binary"}},"application/x-blender":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"audio/aiff":{"schema":{"type":"object","format":"binary"}},"application/xml":{"schema":{"type":"object","format":"binary"}},"application/x-mobipocket-ebook":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"application/dicom":{"schema":{"type":"object","format":"binary"}},"audio/x-musepack":{"schema":{"type":"object","format":"binary"}},"text/calendar":{"schema":{"type":"object","format":"binary"}},"text/vcard":{"schema":{"type":"object","format":"binary"}},"text/vtt":{"schema":{"type":"object","format":"binary"}},"model/gltf-binary":{"schema":{"type":"object","format":"binary"}},"application/vnd.tcpdump.pcap":{"schema":{"type":"object","format":"binary"}},"audio/x-dsf":{"schema":{"type":"object","format":"binary"}},"application/x-ms-shortcut":{"schema":{"type":"object","format":"binary"}},"application/x-ft-apple.alias":{"schema":{"type":"object","format":"binary"}},"audio/x-voc":{"schema":{"type":"object","format":"binary"}},"audio/vnd.dolby.dd-raw":{"schema":{"type":"object","format":"binary"}},"audio/x-m4a":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"video/x-m4v":{"schema":{"type":"object","format":"binary"}},"video/3gpp2":{"schema":{"type":"object","format":"binary"}},"application/x-esri-shape":{"schema":{"type":"object","format":"binary"}},"audio/aac":{"schema":{"type":"object","format":"binary"}},"audio/x-it":{"schema":{"type":"object","format":"binary"}},"audio/x-s3m":{"schema":{"type":"object","format":"binary"}},"audio/x-xm":{"schema":{"type":"object","format":"binary"}},"video/mp1s":{"schema":{"type":"object","format":"binary"}},"video/mp2p":{"schema":{"type":"object","format":"binary"}},"application/vnd.sketchup.skp":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"application/x-lzh-compressed":{"schema":{"type":"object","format":"binary"}},"application/pgp-encrypted":{"schema":{"type":"object","format":"binary"}},"application/x-asar":{"schema":{"type":"object","format":"binary"}},"model/stl":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-htmlhelp":{"schema":{"type":"object","format":"binary"}},"model/3mf":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"application/zstd":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-outlook":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.parquet":{"schema":{"type":"object","format":"binary"}},"application/java-vm":{"schema":{"type":"object","format":"binary"}},"application/x-arj":{"schema":{"type":"object","format":"binary"}},"application/x-cpio":{"schema":{"type":"object","format":"binary"}},"application/x-ace-compressed":{"schema":{"type":"object","format":"binary"}},"application/avro":{"schema":{"type":"object","format":"binary"}},"application/vnd.iccprofile":{"schema":{"type":"object","format":"binary"}},"application/x-ft-fbx":{"schema":{"type":"object","format":"binary"}},"application/vnd.visio":{"schema":{"type":"object","format":"binary"}},"application/vnd.android.package-archive":{"schema":{"type":"object","format":"binary"}},"application/x-ft-draco":{"schema":{"type":"object","format":"binary"}},"application/x-lz4":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.sheet.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.document.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/java-archive":{"schema":{"type":"object","format":"binary"}},"application/vnd.rn-realmedia":{"schema":{"type":"object","format":"binary"}},"application/x-spss-sav":{"schema":{"type":"object","format":"binary"}},"application/x-ms-regedit":{"schema":{"type":"object","format":"binary"}},"application/x-ft-windows-registry-hive":{"schema":{"type":"object","format":"binary"}},"application/x-jmp-data":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.keynote":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.numbers":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.pages":{"schema":{"type":"object","format":"binary"}},"application/x-apache-arrow":{"schema":{"type":"object","format":"binary"}},"application/x-lzip":{"schema":{"type":"object","format":"binary"}},"application/x.apple.alias":{"schema":{"type":"object","format":"binary"}},"application/x.ms.shortcut":{"schema":{"type":"object","format":"binary"}},"audio/opus":{"schema":{"type":"object","format":"binary"}},"audio/vnd.wave":{"schema":{"type":"object","format":"binary"}},"audio/x-flac":{"schema":{"type":"object","format":"binary"}},"video/x-matroska":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated procedure field's attachment.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"You cannot edit this entity.","fieldPath":"organizationId","fieldValue":"1"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified attachment.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"attachment Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Work Orders"]}},"/workorders/{id}/status":{"patch":{"summary":"Update work order status","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the workOrder","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Update data","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["OPEN","IN_PROGRESS","ON_HOLD","DONE","CANCELED"],"description":"<br /><em>Note:</em> It is also possible to register a webhook to get notified when the status of any work order changes. Please see the <a href=\"#tag/Subscriptions\">Subscriptions</a> section for more information."}}}}}},"responses":{"200":{"description":"Successfully updated work order's status","content":{"application/json":{"schema":{"title":"WorkOrder","type":"object","description":"Work order information","properties":{"workOrder":{"title":"","type":"object","required":["updatedAt","status","title","createdAt","creatorId","id","sequentialId","organizationId"],"properties":{"id":{"type":"integer","description":"Global ID of the work order"},"sequentialId":{"type":"integer","description":"Organization specific ID of the work order"},"assetId":{"nullable":true,"type":"integer","example":42},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the work order","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"categories":{"type":"array","description":"List of categories that identify the work order","items":{"type":"string","example":"Cleaning","uniqueItems":true}},"completedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was last marked as DONE","example":"2022-01-01T00:00:00.000Z"},"completerId":{"nullable":true,"type":"integer","description":"ID of the user who completed the work order"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was created","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"nullable":true,"type":"integer","description":"ID of the user who created the work order"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was deleted","example":"2022-01-01T00:00:00.000Z"},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDateIsFullDay":{"nullable":true,"type":"boolean"},"dueDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order is due","example":"2022-01-01T00:00:00.000Z"},"estimatedTime":{"type":"integer","nullable":true,"description":"The estimated time taken in seconds to complete the work order","example":3600},"externalData":{"description":"Extra data that can be attached to the work order, for example to help reference to a matching record in an external system.","nullable":true,"oneOf":[{"type":"object","example":{"popularErpSolutionId":"asd732da"}},{"type":"number","example":732},{"type":"string","example":"asd732da"}]},"isParent":{"nullable":true,"type":"boolean","description":"If this is a parent work order"},"lastMessageSentAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the last comment was added to the work order","example":"2022-01-01T00:00:00.000Z"},"startDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set","example":"2022-01-01T00:00:00.000Z"},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order","example":611},"nextId":{"nullable":true,"type":"integer"},"organizationId":{"type":"number"},"parentId":{"nullable":true,"type":"integer","description":"The ID of the parent work order"},"partsAvailability":{"type":"string","enum":["PARTS_AVAILABLE","PARTS_UNAVAILABLE","PARTIAL_PARTS","PARTS_AVAILABLE_BUT_OVERCOMMITTED"],"description":"Computed parts availability for this work order based on current inventory levels."},"partStatus":{"type":"string","enum":["NO_PARTS","ASSIGNED","RESERVED","KITTED","STAGED","ISSUED"],"description":"Part stage indicates the current readiness state of parts for this work order."},"previousId":{"nullable":true,"type":"integer"},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"recurrenceInfo":{"type":"object","nullable":true,"example":{"type":"WEEKLY","interval":3,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"oneOf":[{"type":"object","title":"Daily","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Weekly","required":["type","days"],"nullable":true,"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between events","minimum":1,"maximum":52,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"]}},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Monthly","required":["type","day"],"nullable":true,"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between events","minimum":1,"maximum":24,"default":1},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month the event will occur"},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Yearly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between events","minimum":1,"maximum":1000,"default":1},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Periodically","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"PERIODICALLY","enum":["PERIODICALLY"]},"interval":{"type":"integer","description":"Number of seconds between events","minimum":0},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}}]},"requesterId":{"nullable":true,"type":"integer","description":"ID of the user who requested the work order through the Work Request feature"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","ON_HOLD","DONE","CANCELED","SKIPPED"],"description":"<br /><em>Note:</em> It is also possible to register a webhook to get notified when the status of any work order changes. Please see the <a href=\"#tag/Subscriptions\">Subscriptions</a> section for more information."},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"title":{"type":"string"},"type":{"type":"string","enum":["CYCLE_COUNT","OTHER","PREVENTIVE","REACTIVE"],"description":"Valid types of Work Orders, including options that are not available for creation/update. Historical Work Orders may have a null type.","default":null,"nullable":true},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Estimated Time Allotted\")","additionalProperties":{"type":"string"},"example":{"Estimated Time Allotted":"24 Hours"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"assigneeIds":{"type":"array","description":"List of user ids assigned to the work order","items":{"type":"integer"}},"teamIds":{"type":"array","description":"List of team ids assigned to the work order","items":{"type":"integer"}},"customerId":{"nullable":true,"type":"integer","description":"ID of the customer linked to the work order","example":128},"procedure":{"type":"object","description":"Procedure attached to the work order","nullable":true,"required":["title","fields"],"properties":{"id":{"type":"number","example":1234,"description":"ID representing a procedure"},"templateIds":{"type":"array","items":{"type":"number"},"example":[1234,1235],"description":"IDs of the procedure template of the procedure","nullable":true},"title":{"type":"string","description":"Title of the procedure","example":"Control dashboard audit"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure"},"score":{"type":"number","example":1,"description":"Score of a procedure"},"fields":{"type":"array","items":{"type":"object","required":["id","label","required","type","value"],"properties":{"id":{"type":"number","example":1234,"description":"ID of the procedure field"},"parentId":{"type":"number","example":1233,"nullable":true,"description":"ID of the parent of the current procedure field"},"procedureTemplateId":{"type":"number","example":1234,"nullable":true,"description":"ID of the procedure template this field originated from."},"procedureTemplateFieldId":{"type":"number","example":5678,"nullable":true,"description":"ID of the procedure template field this field originated from."},"required":{"type":"boolean","description":"Indicate if field is required to be filled."},"description":{"example":"Number of green lights","type":"string","nullable":true,"description":"Description of the procedure field"},"type":{"type":"string","example":"NUMBER","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"],"description":"Type of procedure field"},"label":{"type":"string","example":"Number of green lights","description":"Label of a procedure field"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure field"},"score":{"type":"number","example":1,"description":"Score of a procedure field"},"value":{"type":"object","description":"Current value of a procedure field","properties":{"text":{"type":"string","example":"12","nullable":true},"attachment":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"deprecated":true},"attachments":{"type":"array","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"notes":{"nullable":true,"type":"object","properties":{"text":{"type":"string","example":"1 light bulb is burned out."}},"description":"Note added to a procedure field"},"hasAttachments":{"type":"boolean","example":"true","nullable":true}}},"meter":{"nullable":true,"type":"object","properties":{"id":{"type":"number","description":"Global ID of the meter.","example":123},"name":{"type":"string","description":"Name of the meters"}},"description":"Meter of a procedure field. Will be filled if the type of the field is meter"},"assignees":{"nullable":true,"type":"object","properties":{"userIds":{"type":"array","items":{"type":"number"}},"teamIds":{"type":"array","items":{"type":"number"}}}},"isDateAndTime":{"type":"boolean","nullable":true,"description":"Indicate if a DATE field also contains the time","example":false}}}}}},"progress":{"type":"object","description":"Progress information on the work order","nullable":true,"properties":{"openCount":{"type":"number","example":1},"inProgressCount":{"type":"number","example":1},"onHoldCount":{"type":"number","example":1},"doneCount":{"type":"number","example":1}}},"workOrderSummary":{"nullable":true,"type":"object","description":"Work Order Summary. Null when no summary is available.","properties":{"content":{"type":"string","description":"The original completion note content","example":"Replaced the motor bearings and aligned the shaft."},"summary":{"nullable":true,"type":"string","description":"AI-generated summary of the content","example":"Motor bearing replacement and shaft alignment completed."},"authorId":{"nullable":true,"type":"integer","description":"ID of the user who authored the completion note","example":963}}}}}}}}}},"400":{"description":"Could not update the work order","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Invalid status","fieldPath":"status","fieldValue":"Happy Birthday"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Work Order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Work Order Not Found"}}}}}}},"tags":["Work Orders"]}},"/workorders/{id}/subworkorders":{"get":{"summary":"List sub work orders","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Subworkorders returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","description":"To expand multiple fields: `expand=assignees&expand=asset`","type":"array","items":{"type":"string","enum":["assignees","asset","categories","estimated_time","location","parts","procedure","times","time_items","expenditures","extra_fields","part_extra_fields","asset_extra_fields","location_extra_fields"]}}}],"responses":{"200":{"description":"Successfully fetched Subworkorders list","content":{"application/json":{"schema":{"type":"object","required":["subworkorders","nextCursor","nextPageUrl"],"properties":{"subworkorders":{"type":"array","items":{"type":"object","required":["id","sequentialId","title","updatedAt","status"],"properties":{"id":{"type":"integer","description":"Global ID of the work order"},"sequentialId":{"type":"integer","description":"Organization specific ID of the work order"},"assetId":{"nullable":true,"type":"integer","example":42},"completedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was last marked as DONE","example":"2022-01-01T00:00:00.000Z"},"completerId":{"nullable":true,"type":"integer","description":"ID of the user who completed the work order"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was created","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"nullable":true,"type":"integer","description":"ID of the user who created the work order"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was deleted","example":"2022-01-01T00:00:00.000Z"},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order is due","example":"2022-01-01T00:00:00.000Z"},"lastMessageSentAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the last comment was added to the work order","example":"2022-01-01T00:00:00.000Z"},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order","example":611},"nextId":{"nullable":true,"type":"integer"},"organizationId":{"type":"number"},"partsAvailability":{"type":"string","enum":["PARTS_AVAILABLE","PARTS_UNAVAILABLE","PARTIAL_PARTS","PARTS_AVAILABLE_BUT_OVERCOMMITTED"],"description":"Computed parts availability for this work order based on current inventory levels."},"partStatus":{"type":"string","enum":["NO_PARTS","ASSIGNED","RESERVED","KITTED","STAGED","ISSUED"],"description":"Part stage indicates the current readiness state of parts for this work order."},"previousId":{"nullable":true,"type":"integer"},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"requesterId":{"nullable":true,"type":"integer","description":"ID of the user who requested the work order through the Work Request feature"},"startDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set","example":"2022-01-01T00:00:00.000Z"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","ON_HOLD","DONE","CANCELED","SKIPPED"],"description":"<br /><em>Note:</em> It is also possible to register a webhook to get notified when the status of any work order changes. Please see the <a href=\"#tag/Subscriptions\">Subscriptions</a> section for more information."},"title":{"type":"string"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"assignees":{"type":"array","description":"Either the teamId, the userId or the user email address (expand with query parameter)","items":{"type":"object","title":"assignees","required":["type","id"],"properties":{"type":{"type":"string","example":"USER","enum":["USER","TEAM"]},"id":{"oneOf":[{"type":"integer"},{"type":"string"}]}}},"nullable":false},"asset":{"type":"object","required":["id","name","description","parentId","criticalityId","locationId","serialNumber","createdAt","updatedAt","creatorId"],"description":"Asset linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"},"name":{"type":"string","example":"Forklift"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the asset creator"},"assetExtraFields":{"type":"object","description":"Asset-level custom field values. Present (possibly an empty object) when `asset_extra_fields` is requested and the parent Asset is present. Requesting this implicitly enables `asset` if not already requested.","additionalProperties":{"type":"string"}}},"nullable":true},"location":{"type":"object","required":["id","name"],"description":"Location linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the location"},"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the location was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the location was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"locationExtraFields":{"type":"object","description":"Location-level custom field values. Present (possibly an empty object) when `location_extra_fields` is requested and the parent Location is present. Requesting this implicitly enables `location` if not already requested.","additionalProperties":{"type":"string"}}},"nullable":true},"parts":{"type":"array","description":"Parts attached to the Work Order (expand with query parameter)","items":{"type":"object","required":["id","name","description","area","unitCost","availableQuantity","minimumQuantity","barcode","quantityUsed","copyOnRecurring"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the part"},"name":{"type":"string","example":"Locknut - 1/8"},"description":{"type":"string","nullable":true,"example":""},"area":{"type":"string","example":"tool room","nullable":true},"unitCost":{"type":"integer","nullable":true,"description":"Cost in cents. For example, for $1.20, put 120.","example":120},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"quantityUsed":{"type":"integer","description":"Quantity used in the work order.","example":120},"copyOnRecurring":{"type":"string","description":"Indicates if the parts will be copied to the next work order in the chain (if applicable).","default":"Default","enum":["NoCopy","Copy","Default"]},"locationId":{"type":"number","description":"Global ID of the location of the part","nullable":true,"example":852},"extraFields":{"type":"object","description":"Work Order-scoped custom fields for this Part on this specific Work Order. These are distinct from Part-level custom fields (see `partExtraFields`).","additionalProperties":{"type":"string"}},"partExtraFields":{"type":"object","description":"Part-level custom fields defined on the Part itself (not specific to this Work Order). Present (possibly an empty object) when `part_extra_fields` is requested and Parts are present. Requesting this implicitly enables `parts` if not already requested.","additionalProperties":{"type":"string"}}}},"nullable":false},"times":{"type":"array","description":"Time entries on the Work Order. Grouped by users (expand with query parameter)","items":{"type":"object","properties":{"type":{"type":"string","description":"Type of the entry","enum":["EXPENSE","PART","TIME"]},"costPerUnit":{"type":"number","nullable":true,"description":"Cost per part in cents or cents per hour"},"description":{"type":"string","nullable":true,"description":"Description of the expense or part description "},"quantity":{"type":"number","description":"Number of parts or number of hours"},"rowTotal":{"type":"number","description":"Total cost in cents"},"durationTotal":{"type":"number","description":"Total duration in seconds"},"userId":{"type":"integer","nullable":true,"description":"ID of the user who logged the time entry"},"partId":{"type":"integer","nullable":true,"description":"ID of the part used in this cost entry"}}},"nullable":false},"timeItems":{"type":"array","description":"Time entries on the Work Order. (expand with query parameter)","items":{"type":"object","properties":{"type":{"type":"string","description":"Type of the entry","enum":["EXPENSE","PART","TIME"]},"costPerUnit":{"type":"number","nullable":true,"description":"Cost per part in cents or cents per hour"},"description":{"type":"string","nullable":true,"description":"Description of the expense or part description "},"quantity":{"type":"number","description":"Number of parts or number of hours"},"rowTotal":{"type":"number","description":"Total cost in cents"},"durationTotal":{"type":"number","description":"Total duration in seconds"},"userId":{"type":"integer","nullable":true,"description":"ID of the user who logged the time entry"},"partId":{"type":"integer","nullable":true,"description":"ID of the part used in this cost entry"}}},"nullable":false},"expenditures":{"type":"array","description":"Other cost entries on the Work Order. Grouped by users (expand with query parameter)","items":{"type":"object","properties":{"type":{"type":"string","description":"Type of the entry","enum":["EXPENSE","PART","TIME"]},"costPerUnit":{"type":"number","nullable":true,"description":"Cost per part in cents or cents per hour"},"description":{"type":"string","nullable":true,"description":"Description of the expense or part description "},"quantity":{"type":"number","description":"Number of parts or number of hours"},"rowTotal":{"type":"number","description":"Total cost in cents"},"durationTotal":{"type":"number","description":"Total duration in seconds"},"userId":{"type":"integer","nullable":true,"description":"ID of the user who logged the time entry"},"partId":{"type":"integer","nullable":true,"description":"ID of the part used in this cost entry"}}},"nullable":false},"categories":{"type":"array","description":"List of categories that identify the work order (expand with query parameter)","items":{"type":"string","example":"Cleaning","uniqueItems":true},"nullable":false},"estimatedTime":{"type":"integer","nullable":true,"description":"The estimated time taken in seconds to complete the work order (expand with query parameter)","example":3600},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Estimated Budget\") (expand with query parameter)","additionalProperties":{"type":"string"},"example":{"Estimated Budget":"$250"},"nullable":true},"procedure":{"type":"object","description":"Procedure attached to the work order (expand with query parameter)","nullable":true,"required":["title","fields"],"properties":{"id":{"type":"number","example":1234,"description":"ID representing a procedure"},"templateIds":{"type":"array","items":{"type":"number"},"example":[1234,1235],"description":"IDs of the procedure template of the procedure","nullable":true},"title":{"type":"string","description":"Title of the procedure","example":"Control dashboard audit"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure"},"score":{"type":"number","example":1,"description":"Score of a procedure"},"fields":{"type":"array","items":{"type":"object","required":["id","label","required","type","value"],"properties":{"id":{"type":"number","example":1234,"description":"ID of the procedure field"},"parentId":{"type":"number","example":1233,"nullable":true,"description":"ID of the parent of the current procedure field"},"procedureTemplateId":{"type":"number","example":1234,"nullable":true,"description":"ID of the procedure template this field originated from."},"procedureTemplateFieldId":{"type":"number","example":5678,"nullable":true,"description":"ID of the procedure template field this field originated from."},"required":{"type":"boolean","description":"Indicate if field is required to be filled."},"description":{"example":"Number of green lights","type":"string","nullable":true,"description":"Description of the procedure field"},"type":{"type":"string","example":"NUMBER","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"],"description":"Type of procedure field"},"label":{"type":"string","example":"Number of green lights","description":"Label of a procedure field"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure field"},"score":{"type":"number","example":1,"description":"Score of a procedure field"},"value":{"type":"object","description":"Current value of a procedure field","properties":{"text":{"type":"string","example":"12","nullable":true},"attachment":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"deprecated":true},"attachments":{"type":"array","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"notes":{"nullable":true,"type":"object","properties":{"text":{"type":"string","example":"1 light bulb is burned out."}},"description":"Note added to a procedure field"},"hasAttachments":{"type":"boolean","example":"true","nullable":true}}},"meter":{"nullable":true,"type":"object","properties":{"id":{"type":"number","description":"Global ID of the meter.","example":123},"name":{"type":"string","description":"Name of the meters"}},"description":"Meter of a procedure field. Will be filled if the type of the field is meter"},"assignees":{"nullable":true,"type":"object","properties":{"userIds":{"type":"array","items":{"type":"number"}},"teamIds":{"type":"array","items":{"type":"number"}}}},"isDateAndTime":{"type":"boolean","nullable":true,"description":"Indicate if a DATE field also contains the time","example":false}}}}}}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Subworkorders.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Subworkorders.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Cannot find the parent resource","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}}},"tags":["Work Orders"]}},"/workorders/{id}/thumbnail/{filename}":{"put":{"summary":"Update work order's thumbnail","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the work order.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the work order thumbnail, including the extension.","example":"motor.png"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the thumbnail.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated work order's thumbnail.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"You cannot edit this entity.","fieldPath":"organizationId","fieldValue":"1"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Work Order.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Work Order Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Work Orders"]}},"/workPermits/{id}/sign":{"post":{"summary":"Sign a work permit","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the id","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Sign a work permit","required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalLinkUuid","signerName"],"properties":{"externalLinkUuid":{"type":"string","example":"2042e4f1-751d-4314-be8a-36a44f32b659","description":"Global UUID of the External Link used to sign the Work Permit"},"signerName":{"type":"string","example":"John Doe","description":"Name of the signer when using an External Link"}}}}}},"responses":{"201":{"description":"Successfully signed work permit","content":{"application/json":{"schema":{"type":"object","required":["success","workPermit","workOrder"],"properties":{"success":{"type":"boolean","example":true},"workPermit":{"type":"object","required":["id","status"],"properties":{"id":{"type":"integer"},"status":{"type":"string"}}},"workOrder":{"type":"object","required":["id","blockedByWorkPermitReason"],"properties":{"id":{"type":"integer"},"blockedByWorkPermitReason":{"type":"string","nullable":true}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"You are forbidden to perform the requested action, to access this resource or the feature is disabled by your administrator","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Forbidden"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}}},"security":[],"tags":["Work Permits"]}},"/workrequests":{"post":{"summary":"Create work request","requestBody":{"description":"Work request to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"description":{"type":"string","example":"A forklift that needs to be reviewed for any potential problems","nullable":true},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"title":{"type":"string","example":"Forklift Preventive Maintenance Form"},"assetId":{"type":"number","format":"integer","example":843,"nullable":true},"locationId":{"type":"number","format":"integer","example":852,"nullable":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Request Type\")","additionalProperties":{"type":"string"},"example":{"Request Type":"Water Leak"}},"approverTeamId":{"type":"number","format":"integer","example":254,"nullable":true,"description":"ID of the team that is reponsible for approving the request."},"creatorContactInfo":{"type":"string","nullable":true,"example":"james@example.com","description":"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"}}}}}},"responses":{"200":{"description":"Successfully created work request","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number","example":963,"description":"Global ID of the work request"}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Work Requests"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]},"get":{"summary":"List work requests","description":"Endpoint used to list work request resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Work Requests returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"title","schema":{"type":"string","description":"To filter work orders by title or sequential ID"},"in":"query"},{"name":"assets","schema":{"type":"array","title":"asset ID filters","description":"To filter by multiple asset IDs: `assets=630&assets=634`","items":{"type":"integer"}},"in":"query"},{"name":"locations","schema":{"type":"array","title":"location ID filters","description":"To filter by multiple location IDs: `locations=193&locations=194&locations=195`","items":{"type":"integer"}},"in":"query"},{"name":"priorities","schema":{"type":"array","title":"priorities filters","description":"To filter by multiple priorities: `priorities=LOW&priorities=MEDIUM`","items":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]}},"in":"query"},{"name":"statuses","schema":{"type":"array","title":"statuses filters","description":"To filter by multiple statuses: `statuses=APPROVED&statuses=DONE`","items":{"type":"string","example":"APPROVED","enum":["PENDING","REJECTED","APPROVED","DONE"]}},"in":"query"},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","description":"To expand multiple fields: `expand=asset&expand=location`","type":"array","items":{"type":"string","enum":["asset","location","work_order","extra_fields"]}}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Work Requests list","content":{"application/json":{"schema":{"type":"object","required":["workRequests","nextCursor","nextPageUrl"],"properties":{"workRequests":{"type":"array","items":{"type":"object","required":["id","priority","title","requestStatus"],"properties":{"id":{"type":"number","example":963,"description":"Global ID of the work request"},"title":{"type":"string","example":"Forklift Preventive Maintenance Form"},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the Work Request","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"description":{"type":"string","example":"A forklift that needs to be reviewed for any potential problems","nullable":true},"requestStatus":{"type":"string","enum":["PENDING","REJECTED","APPROVED","DONE"],"example":"PENDING"},"assetId":{"type":"number","format":"integer","example":843,"nullable":true},"locationId":{"type":"number","format":"integer","example":852,"nullable":true},"workOrderId":{"type":"number","format":"integer","example":254,"nullable":true,"description":"Global ID of the work order attached to the work request. A work order is created once a work request is approved."},"sendEmailNotification":{"type":"boolean","example":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Request Type\") (expand with query parameter)","additionalProperties":{"type":"string"},"example":{"Request Type":"Water Leak"},"nullable":false},"approverTeamId":{"type":"number","format":"integer","example":254,"nullable":true,"description":"ID of the team that is reponsible for approving the request."},"creatorContactInfo":{"type":"object","nullable":true,"description":"The creator's contact information associated with this work order request","properties":{"type":{"type":"string","example":"EMAIL","enum":["PHONE","EMAIL","OTHER"]},"value":{"type":"string","example":"james@example.com"}}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the work request was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the work request was last updated","example":"2022-01-01T00:00:00.000Z"},"asset":{"type":"object","required":["id","name","description","parentId","criticalityId","locationId","serialNumber","createdAt","updatedAt","creatorId"],"description":"Asset linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"},"name":{"type":"string","example":"Forklift"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the asset creator"}},"nullable":false},"location":{"type":"object","required":["id","name"],"description":"Location linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the location"},"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the location was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the location was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"}},"nullable":false},"workOrder":{"type":"object","required":["updatedAt","status","title","createdAt","creatorId","id","sequentialId","organizationId"],"description":"Work Order linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","description":"Global ID of the work order"},"sequentialId":{"type":"integer","description":"Organization specific ID of the work order"},"assetId":{"nullable":true,"type":"integer","example":42},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the work order","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"categories":{"type":"array","description":"List of categories that identify the work order","items":{"type":"string","example":"Cleaning","uniqueItems":true}},"completedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was last marked as DONE","example":"2022-01-01T00:00:00.000Z"},"completerId":{"nullable":true,"type":"integer","description":"ID of the user who completed the work order"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was created","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"nullable":true,"type":"integer","description":"ID of the user who created the work order"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was deleted","example":"2022-01-01T00:00:00.000Z"},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDateIsFullDay":{"nullable":true,"type":"boolean"},"dueDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order is due","example":"2022-01-01T00:00:00.000Z"},"estimatedTime":{"type":"integer","nullable":true,"description":"The estimated time taken in seconds to complete the work order","example":3600},"externalData":{"description":"Extra data that can be attached to the work order, for example to help reference to a matching record in an external system.","nullable":true,"oneOf":[{"type":"object","example":{"popularErpSolutionId":"asd732da"}},{"type":"number","example":732},{"type":"string","example":"asd732da"}]},"isParent":{"nullable":true,"type":"boolean","description":"If this is a parent work order"},"lastMessageSentAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the last comment was added to the work order","example":"2022-01-01T00:00:00.000Z"},"startDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set","example":"2022-01-01T00:00:00.000Z"},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order","example":611},"nextId":{"nullable":true,"type":"integer"},"organizationId":{"type":"number"},"parentId":{"nullable":true,"type":"integer","description":"The ID of the parent work order"},"partsAvailability":{"type":"string","enum":["PARTS_AVAILABLE","PARTS_UNAVAILABLE","PARTIAL_PARTS","PARTS_AVAILABLE_BUT_OVERCOMMITTED"],"description":"Computed parts availability for this work order based on current inventory levels."},"partStatus":{"type":"string","enum":["NO_PARTS","ASSIGNED","RESERVED","KITTED","STAGED","ISSUED"],"description":"Part stage indicates the current readiness state of parts for this work order."},"previousId":{"nullable":true,"type":"integer"},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"recurrenceInfo":{"type":"object","nullable":true,"example":{"type":"WEEKLY","interval":3,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"oneOf":[{"type":"object","title":"Daily","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Weekly","required":["type","days"],"nullable":true,"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between events","minimum":1,"maximum":52,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"]}},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Monthly","required":["type","day"],"nullable":true,"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between events","minimum":1,"maximum":24,"default":1},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month the event will occur"},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Yearly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between events","minimum":1,"maximum":1000,"default":1},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Periodically","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"PERIODICALLY","enum":["PERIODICALLY"]},"interval":{"type":"integer","description":"Number of seconds between events","minimum":0},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}}]},"requesterId":{"nullable":true,"type":"integer","description":"ID of the user who requested the work order through the Work Request feature"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","ON_HOLD","DONE","CANCELED","SKIPPED"],"description":"<br /><em>Note:</em> It is also possible to register a webhook to get notified when the status of any work order changes. Please see the <a href=\"#tag/Subscriptions\">Subscriptions</a> section for more information."},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"title":{"type":"string"},"type":{"type":"string","enum":["CYCLE_COUNT","OTHER","PREVENTIVE","REACTIVE"],"description":"Valid types of Work Orders, including options that are not available for creation/update. Historical Work Orders may have a null type.","default":null,"nullable":true},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Estimated Time Allotted\")","additionalProperties":{"type":"string"},"example":{"Estimated Time Allotted":"24 Hours"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"assigneeIds":{"type":"array","description":"List of user ids assigned to the work order","items":{"type":"integer"}},"teamIds":{"type":"array","description":"List of team ids assigned to the work order","items":{"type":"integer"}},"customerId":{"nullable":true,"type":"integer","description":"ID of the customer linked to the work order","example":128},"procedure":{"type":"object","description":"Procedure attached to the work order","nullable":true,"required":["title","fields"],"properties":{"id":{"type":"number","example":1234,"description":"ID representing a procedure"},"templateIds":{"type":"array","items":{"type":"number"},"example":[1234,1235],"description":"IDs of the procedure template of the procedure","nullable":true},"title":{"type":"string","description":"Title of the procedure","example":"Control dashboard audit"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure"},"score":{"type":"number","example":1,"description":"Score of a procedure"},"fields":{"type":"array","items":{"type":"object","required":["id","label","required","type","value"],"properties":{"id":{"type":"number","example":1234,"description":"ID of the procedure field"},"parentId":{"type":"number","example":1233,"nullable":true,"description":"ID of the parent of the current procedure field"},"procedureTemplateId":{"type":"number","example":1234,"nullable":true,"description":"ID of the procedure template this field originated from."},"procedureTemplateFieldId":{"type":"number","example":5678,"nullable":true,"description":"ID of the procedure template field this field originated from."},"required":{"type":"boolean","description":"Indicate if field is required to be filled."},"description":{"example":"Number of green lights","type":"string","nullable":true,"description":"Description of the procedure field"},"type":{"type":"string","example":"NUMBER","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"],"description":"Type of procedure field"},"label":{"type":"string","example":"Number of green lights","description":"Label of a procedure field"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure field"},"score":{"type":"number","example":1,"description":"Score of a procedure field"},"value":{"type":"object","description":"Current value of a procedure field","properties":{"text":{"type":"string","example":"12","nullable":true},"attachment":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"deprecated":true},"attachments":{"type":"array","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"notes":{"nullable":true,"type":"object","properties":{"text":{"type":"string","example":"1 light bulb is burned out."}},"description":"Note added to a procedure field"},"hasAttachments":{"type":"boolean","example":"true","nullable":true}}},"meter":{"nullable":true,"type":"object","properties":{"id":{"type":"number","description":"Global ID of the meter.","example":123},"name":{"type":"string","description":"Name of the meters"}},"description":"Meter of a procedure field. Will be filled if the type of the field is meter"},"assignees":{"nullable":true,"type":"object","properties":{"userIds":{"type":"array","items":{"type":"number"}},"teamIds":{"type":"array","items":{"type":"number"}}}},"isDateAndTime":{"type":"boolean","nullable":true,"description":"Indicate if a DATE field also contains the time","example":false}}}}}},"progress":{"type":"object","description":"Progress information on the work order","nullable":true,"properties":{"openCount":{"type":"number","example":1},"inProgressCount":{"type":"number","example":1},"onHoldCount":{"type":"number","example":1},"doneCount":{"type":"number","example":1}}},"workOrderSummary":{"nullable":true,"type":"object","description":"Work Order Summary. Null when no summary is available.","properties":{"content":{"type":"string","description":"The original completion note content","example":"Replaced the motor bearings and aligned the shaft."},"summary":{"nullable":true,"type":"string","description":"AI-generated summary of the content","example":"Motor bearing replacement and shaft alignment completed."},"authorId":{"nullable":true,"type":"integer","description":"ID of the user who authored the completion note","example":963}}}},"nullable":false}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Work Requests.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Work Requests.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Work Requests"]}},"/workrequests/{id}":{"get":{"summary":"Get work request","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the workRequest","example":"1"},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","description":"To expand multiple fields: `expand=asset&expand=location`","type":"array","items":{"type":"string","enum":["asset","location","work_order","extra_fields"]}}}],"responses":{"200":{"description":"Successfully retrieved workRequest's information","content":{"application/json":{"schema":{"type":"object","required":["workRequest"],"properties":{"workRequest":{"type":"object","required":["id","priority","title","requestStatus"],"properties":{"id":{"type":"number","example":963,"description":"Global ID of the work request"},"title":{"type":"string","example":"Forklift Preventive Maintenance Form"},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the Work Request","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"description":{"type":"string","example":"A forklift that needs to be reviewed for any potential problems","nullable":true},"requestStatus":{"type":"string","enum":["PENDING","REJECTED","APPROVED","DONE"],"example":"PENDING"},"assetId":{"type":"number","format":"integer","example":843,"nullable":true},"locationId":{"type":"number","format":"integer","example":852,"nullable":true},"workOrderId":{"type":"number","format":"integer","example":254,"nullable":true,"description":"Global ID of the work order attached to the work request. A work order is created once a work request is approved."},"sendEmailNotification":{"type":"boolean","example":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Request Type\") (expand with query parameter)","additionalProperties":{"type":"string"},"example":{"Request Type":"Water Leak"},"nullable":false},"approverTeamId":{"type":"number","format":"integer","example":254,"nullable":true,"description":"ID of the team that is reponsible for approving the request."},"creatorContactInfo":{"type":"object","nullable":true,"description":"The creator's contact information associated with this work order request","properties":{"type":{"type":"string","example":"EMAIL","enum":["PHONE","EMAIL","OTHER"]},"value":{"type":"string","example":"james@example.com"}}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the work request was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the work request was last updated","example":"2022-01-01T00:00:00.000Z"},"asset":{"type":"object","required":["id","name","description","parentId","criticalityId","locationId","serialNumber","createdAt","updatedAt","creatorId"],"description":"Asset linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"},"name":{"type":"string","example":"Forklift"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the asset creator"}},"nullable":false},"location":{"type":"object","required":["id","name"],"description":"Location linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the location"},"name":{"type":"string","example":"Warehouses"},"description":{"type":"string","nullable":true,"example":"The warehouse where we store the forklifts"},"address":{"type":"string","nullable":true,"example":"1090 main street, Franklin","description":"Postal address of the location"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent location"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the location was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the location was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"}},"nullable":false},"workOrder":{"type":"object","required":["updatedAt","status","title","createdAt","creatorId","id","sequentialId","organizationId"],"description":"Work Order linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","description":"Global ID of the work order"},"sequentialId":{"type":"integer","description":"Organization specific ID of the work order"},"assetId":{"nullable":true,"type":"integer","example":42},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the work order","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"categories":{"type":"array","description":"List of categories that identify the work order","items":{"type":"string","example":"Cleaning","uniqueItems":true}},"completedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was last marked as DONE","example":"2022-01-01T00:00:00.000Z"},"completerId":{"nullable":true,"type":"integer","description":"ID of the user who completed the work order"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was created","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"nullable":true,"type":"integer","description":"ID of the user who created the work order"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the work order was deleted","example":"2022-01-01T00:00:00.000Z"},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDateIsFullDay":{"nullable":true,"type":"boolean"},"dueDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order is due","example":"2022-01-01T00:00:00.000Z"},"estimatedTime":{"type":"integer","nullable":true,"description":"The estimated time taken in seconds to complete the work order","example":3600},"externalData":{"description":"Extra data that can be attached to the work order, for example to help reference to a matching record in an external system.","nullable":true,"oneOf":[{"type":"object","example":{"popularErpSolutionId":"asd732da"}},{"type":"number","example":732},{"type":"string","example":"asd732da"}]},"isParent":{"nullable":true,"type":"boolean","description":"If this is a parent work order"},"lastMessageSentAt":{"nullable":true,"type":"string","format":"date-time","description":"Date & time at which the last comment was added to the work order","example":"2022-01-01T00:00:00.000Z"},"startDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set","example":"2022-01-01T00:00:00.000Z"},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order","example":611},"nextId":{"nullable":true,"type":"integer"},"organizationId":{"type":"number"},"parentId":{"nullable":true,"type":"integer","description":"The ID of the parent work order"},"partsAvailability":{"type":"string","enum":["PARTS_AVAILABLE","PARTS_UNAVAILABLE","PARTIAL_PARTS","PARTS_AVAILABLE_BUT_OVERCOMMITTED"],"description":"Computed parts availability for this work order based on current inventory levels."},"partStatus":{"type":"string","enum":["NO_PARTS","ASSIGNED","RESERVED","KITTED","STAGED","ISSUED"],"description":"Part stage indicates the current readiness state of parts for this work order."},"previousId":{"nullable":true,"type":"integer"},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"recurrenceInfo":{"type":"object","nullable":true,"example":{"type":"WEEKLY","interval":3,"days":["MONDAY","WEDNESDAY","FRIDAY"]},"oneOf":[{"type":"object","title":"Daily","nullable":true,"required":["type"],"properties":{"type":{"type":"string","pattern":"DAILY","enum":["DAILY"]},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Weekly","required":["type","days"],"nullable":true,"properties":{"type":{"type":"string","pattern":"WEEKLY","enum":["WEEKLY"]},"interval":{"type":"integer","description":"Number of weeks between events","minimum":1,"maximum":52,"default":1},"days":{"type":"array","description":"Days of the week the event will occur","items":{"type":"string","enum":["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"]}},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Monthly","required":["type","day"],"nullable":true,"properties":{"type":{"type":"string","pattern":"MONTHLY","enum":["MONTHLY"]},"interval":{"type":"integer","description":"Number of months between events","minimum":1,"maximum":24,"default":1},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month the event will occur"},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Yearly","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"YEARLY","enum":["YEARLY"]},"interval":{"type":"integer","description":"Number of years between events","minimum":1,"maximum":1000,"default":1},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}},{"type":"object","title":"Periodically","required":["type"],"nullable":true,"properties":{"type":{"type":"string","pattern":"PERIODICALLY","enum":["PERIODICALLY"]},"interval":{"type":"integer","description":"Number of seconds between events","minimum":0},"automationMeterTrigger":{"type":"object","description":"Automation meter trigger configuration","properties":{"automationTriggerInput":{"type":"object","properties":{"conditions":{"type":"array","description":"Conditions to trigger automation","items":{"type":"object","properties":{"operator":{"type":"string","enum":["increasedBy","decreasedBy"],"description":"Operator for the condition"},"value":{"type":"number","description":"Value for the condition"}},"required":["operator","value"]}},"meterId":{"type":"integer","description":"ID of the meter to trigger the automation"}},"required":["meterId","conditions"]},"lastTriggerValue":{"type":"number","description":"Last trigger value for the meter"},"newDueDateOffsetSeconds":{"type":"integer","description":"Offset in seconds for new due date. If you want to set the due date to 2 days from now set this to 172800 - (24 * 60 * 60 * 2)","example":86400}},"nullable":true}}}]},"requesterId":{"nullable":true,"type":"integer","description":"ID of the user who requested the work order through the Work Request feature"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","ON_HOLD","DONE","CANCELED","SKIPPED"],"description":"<br /><em>Note:</em> It is also possible to register a webhook to get notified when the status of any work order changes. Please see the <a href=\"#tag/Subscriptions\">Subscriptions</a> section for more information."},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"title":{"type":"string"},"type":{"type":"string","enum":["CYCLE_COUNT","OTHER","PREVENTIVE","REACTIVE"],"description":"Valid types of Work Orders, including options that are not available for creation/update. Historical Work Orders may have a null type.","default":null,"nullable":true},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the work order was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Estimated Time Allotted\")","additionalProperties":{"type":"string"},"example":{"Estimated Time Allotted":"24 Hours"}},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"assigneeIds":{"type":"array","description":"List of user ids assigned to the work order","items":{"type":"integer"}},"teamIds":{"type":"array","description":"List of team ids assigned to the work order","items":{"type":"integer"}},"customerId":{"nullable":true,"type":"integer","description":"ID of the customer linked to the work order","example":128},"procedure":{"type":"object","description":"Procedure attached to the work order","nullable":true,"required":["title","fields"],"properties":{"id":{"type":"number","example":1234,"description":"ID representing a procedure"},"templateIds":{"type":"array","items":{"type":"number"},"example":[1234,1235],"description":"IDs of the procedure template of the procedure","nullable":true},"title":{"type":"string","description":"Title of the procedure","example":"Control dashboard audit"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure"},"score":{"type":"number","example":1,"description":"Score of a procedure"},"fields":{"type":"array","items":{"type":"object","required":["id","label","required","type","value"],"properties":{"id":{"type":"number","example":1234,"description":"ID of the procedure field"},"parentId":{"type":"number","example":1233,"nullable":true,"description":"ID of the parent of the current procedure field"},"procedureTemplateId":{"type":"number","example":1234,"nullable":true,"description":"ID of the procedure template this field originated from."},"procedureTemplateFieldId":{"type":"number","example":5678,"nullable":true,"description":"ID of the procedure template field this field originated from."},"required":{"type":"boolean","description":"Indicate if field is required to be filled."},"description":{"example":"Number of green lights","type":"string","nullable":true,"description":"Description of the procedure field"},"type":{"type":"string","example":"NUMBER","enum":["NUMBER","AMOUNT","TEXT","UNSUPPORTED","HEADING","FILE","SIGNATURE","MULTIPLE_CHOICE","INSPECTION_CHECK","YES_NO_NA","CHECKBOX","CHECKLIST","METER","DATE","CYCLE_COUNT"],"description":"Type of procedure field"},"label":{"type":"string","example":"Number of green lights","description":"Label of a procedure field"},"maxScore":{"type":"number","example":2,"description":"Maximum score of a procedure field"},"score":{"type":"number","example":1,"description":"Score of a procedure field"},"value":{"type":"object","description":"Current value of a procedure field","properties":{"text":{"type":"string","example":"12","nullable":true},"attachment":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"deprecated":true},"attachments":{"type":"array","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"notes":{"nullable":true,"type":"object","properties":{"text":{"type":"string","example":"1 light bulb is burned out."}},"description":"Note added to a procedure field"},"hasAttachments":{"type":"boolean","example":"true","nullable":true}}},"meter":{"nullable":true,"type":"object","properties":{"id":{"type":"number","description":"Global ID of the meter.","example":123},"name":{"type":"string","description":"Name of the meters"}},"description":"Meter of a procedure field. Will be filled if the type of the field is meter"},"assignees":{"nullable":true,"type":"object","properties":{"userIds":{"type":"array","items":{"type":"number"}},"teamIds":{"type":"array","items":{"type":"number"}}}},"isDateAndTime":{"type":"boolean","nullable":true,"description":"Indicate if a DATE field also contains the time","example":false}}}}}},"progress":{"type":"object","description":"Progress information on the work order","nullable":true,"properties":{"openCount":{"type":"number","example":1},"inProgressCount":{"type":"number","example":1},"onHoldCount":{"type":"number","example":1},"doneCount":{"type":"number","example":1}}},"workOrderSummary":{"nullable":true,"type":"object","description":"Work Order Summary. Null when no summary is available.","properties":{"content":{"type":"string","description":"The original completion note content","example":"Replaced the motor bearings and aligned the shaft."},"summary":{"nullable":true,"type":"string","description":"AI-generated summary of the content","example":"Motor bearing replacement and shaft alignment completed."},"authorId":{"nullable":true,"type":"integer","description":"ID of the user who authored the completion note","example":963}}}},"nullable":false}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified workRequest or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Work Requests"]},"delete":{"summary":"Delete workRequest","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the workRequest","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the workRequest"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified workRequest.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"workRequest Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Work Requests"]},"patch":{"summary":"Update work request","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the work request","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Work request to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","example":"Forklift Preventive Maintenance Form"},"description":{"type":"string","example":"A forklift that needs to be reviewed for any potential problems","nullable":true},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"assetId":{"type":"number","format":"integer","example":843,"nullable":true},"locationId":{"type":"number","format":"integer","example":852,"nullable":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Request Type\")","additionalProperties":{"type":"string"},"example":{"Request Type":"Water Leak"}},"approverTeamId":{"type":"number","format":"integer","example":254,"nullable":true,"description":"ID of the team that is reponsible for approving the request."},"creatorContactInfo":{"type":"string","nullable":true,"example":"james@example.com","description":"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"}}}}}},"responses":{"200":{"description":"Successfully edited work request","content":{"application/json":{"schema":{"type":"object","required":["workRequest"],"properties":{"workRequest":{"type":"object","required":["id","title","priority","requestStatus"],"properties":{"id":{"type":"number","example":963,"description":"Global ID of the work request"},"title":{"type":"string","example":"Forklift Preventive Maintenance Form"},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the Work Request","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"description":{"type":"string","example":"A forklift that needs to be reviewed for any potential problems","nullable":true},"requestStatus":{"type":"string","enum":["PENDING","REJECTED","APPROVED","DONE"],"example":"PENDING"},"assetId":{"type":"number","format":"integer","example":843,"nullable":true},"locationId":{"type":"number","format":"integer","example":852,"nullable":true},"workOrderId":{"type":"number","format":"integer","example":254,"nullable":true,"description":"Global ID of the work order attached to the work request. A work order is created once a work request is approved."},"sendEmailNotification":{"type":"boolean","example":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Request Type\")","additionalProperties":{"type":"string"},"example":{"Request Type":"Water Leak"}},"approverTeamId":{"type":"number","format":"integer","example":254,"nullable":true,"description":"ID of the team that is reponsible for approving the request."},"creatorContactInfo":{"type":"object","nullable":true,"description":"The creator's contact information associated with this work order request","properties":{"type":{"type":"string","example":"EMAIL","enum":["PHONE","EMAIL","OTHER"]},"value":{"type":"string","example":"james@example.com"}}},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the work request was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the work request was last updated","example":"2022-01-01T00:00:00.000Z"}}}}}}}},"400":{"description":"Failed to edit the work request","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"parentId is not valid"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified work request.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"work request Not Found"}}}}}}},"tags":["Work Requests"]}},"/workrequests/{id}/attachments/{filename}":{"put":{"summary":"Update work request attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the work request.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"datasheet.pdf"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the attachment.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"application/x-indesign":{"schema":{"type":"object","format":"binary"}},"application/epub+zip":{"schema":{"type":"object","format":"binary"}},"application/x-xpinstall":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"schema":{"type":"object","format":"binary"}},"application/zip":{"schema":{"type":"object","format":"binary"}},"application/x-tar":{"schema":{"type":"object","format":"binary"}},"application/x-rar-compressed":{"schema":{"type":"object","format":"binary"}},"application/gzip":{"schema":{"type":"object","format":"binary"}},"application/x-bzip2":{"schema":{"type":"object","format":"binary"}},"application/x-7z-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-apple-diskimage":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.arrow.file":{"schema":{"type":"object","format":"binary"}},"video/mp4":{"schema":{"type":"object","format":"binary"}},"audio/midi":{"schema":{"type":"object","format":"binary"}},"video/matroska":{"schema":{"type":"object","format":"binary"}},"video/webm":{"schema":{"type":"object","format":"binary"}},"video/quicktime":{"schema":{"type":"object","format":"binary"}},"video/vnd.avi":{"schema":{"type":"object","format":"binary"}},"audio/wav":{"schema":{"type":"object","format":"binary"}},"audio/qcelp":{"schema":{"type":"object","format":"binary"}},"audio/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"video/x-ms-asf":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-asf":{"schema":{"type":"object","format":"binary"}},"video/mpeg":{"schema":{"type":"object","format":"binary"}},"video/3gpp":{"schema":{"type":"object","format":"binary"}},"audio/mpeg":{"schema":{"type":"object","format":"binary"}},"audio/mp4":{"schema":{"type":"object","format":"binary"}},"video/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg":{"schema":{"type":"object","format":"binary"}},"audio/ogg; codecs=opus":{"schema":{"type":"object","format":"binary"}},"application/ogg":{"schema":{"type":"object","format":"binary"}},"audio/flac":{"schema":{"type":"object","format":"binary"}},"audio/ape":{"schema":{"type":"object","format":"binary"}},"audio/wavpack":{"schema":{"type":"object","format":"binary"}},"audio/amr":{"schema":{"type":"object","format":"binary"}},"application/pdf":{"schema":{"type":"object","format":"binary"}},"application/x-elf":{"schema":{"type":"object","format":"binary"}},"application/x-mach-binary":{"schema":{"type":"object","format":"binary"}},"application/x-msdownload":{"schema":{"type":"object","format":"binary"}},"application/x-shockwave-flash":{"schema":{"type":"object","format":"binary"}},"application/rtf":{"schema":{"type":"object","format":"binary"}},"application/wasm":{"schema":{"type":"object","format":"binary"}},"font/woff":{"schema":{"type":"object","format":"binary"}},"font/woff2":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-fontobject":{"schema":{"type":"object","format":"binary"}},"font/ttf":{"schema":{"type":"object","format":"binary"}},"font/otf":{"schema":{"type":"object","format":"binary"}},"font/collection":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"video/x-flv":{"schema":{"type":"object","format":"binary"}},"application/postscript":{"schema":{"type":"object","format":"binary"}},"application/eps":{"schema":{"type":"object","format":"binary"}},"application/x-xz":{"schema":{"type":"object","format":"binary"}},"application/x-sqlite3":{"schema":{"type":"object","format":"binary"}},"application/x-nintendo-nes-rom":{"schema":{"type":"object","format":"binary"}},"application/x-google-chrome-extension":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-cab-compressed":{"schema":{"type":"object","format":"binary"}},"application/x-deb":{"schema":{"type":"object","format":"binary"}},"application/x-unix-archive":{"schema":{"type":"object","format":"binary"}},"application/x-rpm":{"schema":{"type":"object","format":"binary"}},"application/x-compress":{"schema":{"type":"object","format":"binary"}},"application/lzip":{"schema":{"type":"object","format":"binary"}},"application/x-cfb":{"schema":{"type":"object","format":"binary"}},"application/x-mie":{"schema":{"type":"object","format":"binary"}},"application/mxf":{"schema":{"type":"object","format":"binary"}},"video/mp2t":{"schema":{"type":"object","format":"binary"}},"application/x-blender":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"audio/aiff":{"schema":{"type":"object","format":"binary"}},"application/xml":{"schema":{"type":"object","format":"binary"}},"application/x-mobipocket-ebook":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"application/dicom":{"schema":{"type":"object","format":"binary"}},"audio/x-musepack":{"schema":{"type":"object","format":"binary"}},"text/calendar":{"schema":{"type":"object","format":"binary"}},"text/vcard":{"schema":{"type":"object","format":"binary"}},"text/vtt":{"schema":{"type":"object","format":"binary"}},"model/gltf-binary":{"schema":{"type":"object","format":"binary"}},"application/vnd.tcpdump.pcap":{"schema":{"type":"object","format":"binary"}},"audio/x-dsf":{"schema":{"type":"object","format":"binary"}},"application/x-ms-shortcut":{"schema":{"type":"object","format":"binary"}},"application/x-ft-apple.alias":{"schema":{"type":"object","format":"binary"}},"audio/x-voc":{"schema":{"type":"object","format":"binary"}},"audio/vnd.dolby.dd-raw":{"schema":{"type":"object","format":"binary"}},"audio/x-m4a":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"video/x-m4v":{"schema":{"type":"object","format":"binary"}},"video/3gpp2":{"schema":{"type":"object","format":"binary"}},"application/x-esri-shape":{"schema":{"type":"object","format":"binary"}},"audio/aac":{"schema":{"type":"object","format":"binary"}},"audio/x-it":{"schema":{"type":"object","format":"binary"}},"audio/x-s3m":{"schema":{"type":"object","format":"binary"}},"audio/x-xm":{"schema":{"type":"object","format":"binary"}},"video/mp1s":{"schema":{"type":"object","format":"binary"}},"video/mp2p":{"schema":{"type":"object","format":"binary"}},"application/vnd.sketchup.skp":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"application/x-lzh-compressed":{"schema":{"type":"object","format":"binary"}},"application/pgp-encrypted":{"schema":{"type":"object","format":"binary"}},"application/x-asar":{"schema":{"type":"object","format":"binary"}},"model/stl":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-htmlhelp":{"schema":{"type":"object","format":"binary"}},"model/3mf":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"application/zstd":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-outlook":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}},"application/vnd.apache.parquet":{"schema":{"type":"object","format":"binary"}},"application/java-vm":{"schema":{"type":"object","format":"binary"}},"application/x-arj":{"schema":{"type":"object","format":"binary"}},"application/x-cpio":{"schema":{"type":"object","format":"binary"}},"application/x-ace-compressed":{"schema":{"type":"object","format":"binary"}},"application/avro":{"schema":{"type":"object","format":"binary"}},"application/vnd.iccprofile":{"schema":{"type":"object","format":"binary"}},"application/x-ft-fbx":{"schema":{"type":"object","format":"binary"}},"application/vnd.visio":{"schema":{"type":"object","format":"binary"}},"application/vnd.android.package-archive":{"schema":{"type":"object","format":"binary"}},"application/x-ft-draco":{"schema":{"type":"object","format":"binary"}},"application/x-lz4":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.presentationml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.text-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.spreadsheet-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.presentation-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics":{"schema":{"type":"object","format":"binary"}},"application/vnd.oasis.opendocument.graphics-template":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-excel.sheet.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.document.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-word.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.template.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"schema":{"type":"object","format":"binary"}},"application/java-archive":{"schema":{"type":"object","format":"binary"}},"application/vnd.rn-realmedia":{"schema":{"type":"object","format":"binary"}},"application/x-spss-sav":{"schema":{"type":"object","format":"binary"}},"application/x-ms-regedit":{"schema":{"type":"object","format":"binary"}},"application/x-ft-windows-registry-hive":{"schema":{"type":"object","format":"binary"}},"application/x-jmp-data":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.keynote":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.numbers":{"schema":{"type":"object","format":"binary"}},"application/vnd.apple.pages":{"schema":{"type":"object","format":"binary"}},"application/x-apache-arrow":{"schema":{"type":"object","format":"binary"}},"application/x-lzip":{"schema":{"type":"object","format":"binary"}},"application/x.apple.alias":{"schema":{"type":"object","format":"binary"}},"application/x.ms.shortcut":{"schema":{"type":"object","format":"binary"}},"audio/opus":{"schema":{"type":"object","format":"binary"}},"audio/vnd.wave":{"schema":{"type":"object","format":"binary"}},"audio/x-flac":{"schema":{"type":"object","format":"binary"}},"video/x-matroska":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated work request's attachment.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified work request.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"work request Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Work Requests"]},"delete":{"summary":"Remove work request attachment","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the work request.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the attachment, including the extension.","example":"attachment.xls"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully removed work request's attachment."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Attachment.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment Not Found"}}}}}}},"tags":["Work Requests"]}},"/workrequests/{id}/thumbnail/{filename}":{"put":{"summary":"Update work request's thumbnail","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the work request.","example":"1"},{"schema":{"type":"string"},"name":"filename","in":"path","required":true,"description":"Name of the work request thumbnail, including the extension.","example":"motor.png"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Content type should be `application/octet-stream` and payload should use binary format for the thumbnail.","required":true,"content":{"application/octet-stream":{"schema":{"type":"object","format":"binary"}},"image/jpeg":{"schema":{"type":"object","format":"binary"}},"image/png":{"schema":{"type":"object","format":"binary"}},"image/gif":{"schema":{"type":"object","format":"binary"}},"image/webp":{"schema":{"type":"object","format":"binary"}},"image/flif":{"schema":{"type":"object","format":"binary"}},"image/x-xcf":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr2":{"schema":{"type":"object","format":"binary"}},"image/x-canon-cr3":{"schema":{"type":"object","format":"binary"}},"image/tiff":{"schema":{"type":"object","format":"binary"}},"image/bmp":{"schema":{"type":"object","format":"binary"}},"image/vnd.ms-photo":{"schema":{"type":"object","format":"binary"}},"image/vnd.adobe.photoshop":{"schema":{"type":"object","format":"binary"}},"image/x-icon":{"schema":{"type":"object","format":"binary"}},"image/bpg":{"schema":{"type":"object","format":"binary"}},"image/j2c":{"schema":{"type":"object","format":"binary"}},"image/jp2":{"schema":{"type":"object","format":"binary"}},"image/jpx":{"schema":{"type":"object","format":"binary"}},"image/jpm":{"schema":{"type":"object","format":"binary"}},"image/mj2":{"schema":{"type":"object","format":"binary"}},"image/heif":{"schema":{"type":"object","format":"binary"}},"image/heif-sequence":{"schema":{"type":"object","format":"binary"}},"image/heic":{"schema":{"type":"object","format":"binary"}},"image/heic-sequence":{"schema":{"type":"object","format":"binary"}},"image/icns":{"schema":{"type":"object","format":"binary"}},"image/ktx":{"schema":{"type":"object","format":"binary"}},"image/apng":{"schema":{"type":"object","format":"binary"}},"image/x-olympus-orf":{"schema":{"type":"object","format":"binary"}},"image/x-sony-arw":{"schema":{"type":"object","format":"binary"}},"image/x-adobe-dng":{"schema":{"type":"object","format":"binary"}},"image/x-nikon-nef":{"schema":{"type":"object","format":"binary"}},"image/x-panasonic-rw2":{"schema":{"type":"object","format":"binary"}},"image/x-fujifilm-raf":{"schema":{"type":"object","format":"binary"}},"image/avif":{"schema":{"type":"object","format":"binary"}},"image/jxl":{"schema":{"type":"object","format":"binary"}},"image/jls":{"schema":{"type":"object","format":"binary"}},"image/vnd.dwg":{"schema":{"type":"object","format":"binary"}}}},"responses":{"201":{"description":"Successfully updated work request's thumbnail.","content":{"application/json":{"schema":{"type":"object","properties":{"publicUrl":{"type":"string"},"filename":{"type":"string"},"fileKey":{"type":"string"}}}}}},"400":{"description":"Bad arguments.","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"You cannot edit this entity.","fieldPath":"organizationId","fieldValue":"1"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Work Request.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Work Request Not Found"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Attachment size must not exceed 1mB"}}}}}}},"tags":["Work Requests"]}},"/work-shifts":{"post":{"summary":"Set user work shifts","description":"Set per-day work shift capacity for one or more users. Re-sending a (user, date) pair overwrites the previous override. A maximum of 250 work shifts can be set per request.","requestBody":{"description":"Per-day work shift overrides to set for one or more users.","required":true,"content":{"application/json":{"schema":{"type":"object","required":["workShifts"],"properties":{"workShifts":{"type":"array","maxItems":250,"items":{"type":"object","required":["userId","date","seconds"],"properties":{"userId":{"type":"number","example":1,"description":"Global ID of the user whose daily capacity is being set."},"date":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"The specific day being overridden (ISO 8601 UTC datetime). Clients must convert from the organization's timezone to UTC before sending. For example, 2024-06-17 in America/Chicago (UTC-5) becomes 2024-06-17T05:00:00Z."},"seconds":{"type":"number","example":28800,"minimum":0,"maximum":86400,"description":"Capacity in seconds for that day. Must be between 0 and 86400."},"status":{"type":"string","enum":["NON_WORKING","TIME_OFF","WORKING"],"nullable":true,"example":"WORKING","description":"Work shift status. If omitted or null, it is derived from seconds: WORKING when seconds > 0, otherwise NON_WORKING. Note that omitting status on a day that already has an override will overwrite the existing status with the new derived value. TIME_OFF requires the Custom Work Rotations feature. TIME_OFF and NON_WORKING must have seconds set to 0."}}}}}}}}},"responses":{"201":{"description":"Successfully set the work shifts."},"400":{"description":"The request body was invalid. Possible causes: seconds outside 0–86400; NON_WORKING or TIME_OFF with non-zero seconds; WORKING with zero seconds; or more than 250 work shifts in one request.","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"seconds must be between 0 and 86400","fieldPath":"seconds"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"You do not have permission to edit workload capacity.","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Forbidden"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified user.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"user Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Users"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]}},"/customfields/{entity}":{"post":{"summary":"Create custom field","parameters":[{"schema":{"type":"string","enum":["assets","locations","parts","workOrders","vendors","purchaseOrders","lineItemPurchaseOrders"]},"name":"entity","in":"path","required":true,"description":"Type of entity","example":"assets"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"requestBody":{"description":"Custom fields to create","required":true,"content":{"application/json":{"schema":{"type":"object","description":"The custom field data","required":["fields"],"properties":{"fields":{"type":"array","items":{"type":"object","required":["label","type"],"properties":{"label":{"type":"string","example":"Date Purchased"},"type":{"type":"string","enum":["oneline","multiline","number","singleSelect","date","datetime","link"]},"options":{"nullable":true,"type":"array","items":{"type":"string"}},"includeInRecurrence":{"nullable":true,"type":"boolean","description":"Only relevent in the context of Work Orders"},"required":{"nullable":true,"type":"boolean","description":"Mark this field as required. This only affect the frontend."},"unlisted":{"nullable":true,"type":"boolean","description":"Mark this custom field as unlisted. Once unlisted it will only be editable through the Rest API. When the custom field contains data, it will be displayed in the frontend; otherwise, it will remain hidden."}}}}}}}}},"responses":{"200":{"description":"Successfully created the custom fields","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","label","type","sortOrder"],"properties":{"id":{"type":"number","description":"ID of the custom field","example":1},"label":{"type":"string","description":"The label of the custom field","example":"Date Purchased"},"sortOrder":{"type":"integer","description":"The order which the field will be displayed in the UI","example":25},"type":{"type":"string","enum":["oneline","multiline","number","singleSelect","date","datetime","link"]},"options":{"type":"array","description":"The possible choices to the field (if applicable).","items":{"type":"string"}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Failed to create the custom field","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"User don't have the right permissions"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified custom field.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"custom field Not Found"}}}}}}},"tags":["Custom Fields"]},"get":{"summary":"List custom fields","parameters":[{"schema":{"type":"string","enum":["assets","locations","parts","workOrders","vendors","purchaseOrders","lineItemPurchaseOrders"]},"name":"entity","in":"path","required":true,"description":"Type of entity","example":"assets"},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched the custom fields","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","label","type","sortOrder"],"properties":{"id":{"type":"number","description":"ID of the custom field","example":1},"label":{"type":"string","description":"The label of the custom field","example":"Date Purchased"},"sortOrder":{"type":"integer","description":"A weighted value used to sort the custom fields. Fields are sorted lowest to highest. This is different from sortIndex.","example":25},"type":{"type":"string","enum":["oneline","multiline","number","singleSelect","date","datetime","link"]},"required":{"nullable":true,"type":"boolean","description":"This field is marked as required. This only affect the frontend."},"unlisted":{"nullable":true,"type":"boolean","description":"This field is marked as unlisted. Once unlisted it will only be editable through the Rest API. When the custom field contains data, it will be displayed in the frontend; otherwise, it will remain hidden."},"options":{"type":"array","description":"The possible choices to the field (if applicable).","items":{"type":"string"}}}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified custom field.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"custom field Not Found"}}}}}}},"tags":["Custom Fields"]}},"/customfields/{entity}/{id}":{"patch":{"summary":"Edit custom field","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the custom field","example":"1"},{"schema":{"type":"string","enum":["assets","locations","parts","workOrders","vendors","purchaseOrders","lineItemPurchaseOrders"]},"name":"entity","in":"path","required":true,"description":"Type of entity","example":"assets"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Custom field to create","required":true,"content":{"application/json":{"schema":{"type":"object","description":"The custom field data","required":["field"],"properties":{"field":{"type":"object","properties":{"label":{"type":"string","example":"Date Purchased"},"type":{"type":"string","enum":["oneline","multiline","number","singleSelect","date","datetime","link"]},"options":{"nullable":true,"type":"array","items":{"type":"string"}},"includeInRecurrence":{"nullable":true,"type":"boolean","description":"Only relevent in the context of Work Orders"},"sortIndex":{"type":"integer","description":"Represents the actual index (zero based) that you wish the element to be set at. For example, if you have 6 custom fields, and would like to set the field as the second element, you would pass sortIndex: 1. This would in turn affect the sortOrder weight."},"required":{"nullable":true,"type":"boolean","description":"Mark this custom field as required"},"unlisted":{"nullable":true,"type":"boolean","description":"Mark this custom field as unlisted"}}}}}}}},"responses":{"204":{"description":"Successfully edited the custom field"},"400":{"description":"Failed to edit the custom field","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Invalid Property"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"Failed to edit the custom field","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"User don't have the right permissions"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"404":{"description":"Could not find the specified custom field.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"custom field Not Found"}}}}}}},"tags":["Custom Fields"]},"delete":{"summary":"Delete custom field","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the custom field","example":"1"},{"schema":{"type":"string","enum":["assets","locations","parts","workOrders","vendors","purchaseOrders","lineItemPurchaseOrders"]},"name":"entity","in":"path","required":true,"description":"Type of entity","example":"assets"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the Custom Fields"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified Custom Fields.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Custom Fields Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Custom Fields"]}},"/rootcauseanalysisreports":{"get":{"summary":"List root cause analysis reports","description":"Endpoint used to list root cause analysis report resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Root Cause Analysis Reports returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"assets","schema":{"type":"array","title":"asset ID filters","description":"To filter by multiple asset IDs: `assets=630&assets=634`","items":{"type":"integer"}},"in":"query"},{"name":"statuses","schema":{"type":"array","title":"statuses filters","description":"To filter by multiple statuses: `statuses=DRAFT&statuses=DONE`","items":{"type":"string","enum":["DONE","DRAFT"],"description":"Status of the Root Cause Analysis report"}},"in":"query"},{"name":"creators","schema":{"type":"array","title":"creator ID filters","description":"To filter by multiple creator IDs: `creators=23494&creators=79808`","items":{"type":"integer"}},"in":"query"},{"name":"archived","schema":{"type":"boolean","title":"archived","description":"When true, return only archived reports. Defaults to false."},"in":"query"},{"name":"createdAfter","schema":{"type":"string","format":"date-time","title":"createdAfter","description":"Return reports whose `createdAt` is at or after this ISO 8601 date-time (UTC)."},"in":"query"},{"name":"createdBefore","schema":{"type":"string","format":"date-time","title":"createdBefore","description":"Return reports whose `createdAt` is at or before this ISO 8601 date-time (UTC)."},"in":"query"},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","description":"To expand multiple fields: `expand=main_asset&expand=main_asset_status`","type":"array","items":{"type":"string","enum":["main_asset","main_asset_status","problems"]}}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Root Cause Analysis Reports list","content":{"application/json":{"schema":{"type":"object","required":["rootCauseAnalysisReports","nextCursor","nextPageUrl"],"properties":{"rootCauseAnalysisReports":{"type":"array","items":{"type":"object","required":["id","status","mainAssetId","mainAssetStatusId","createdAt","updatedAt","completedAt","incidentStartedAt","incidentEndedAt","incidentDuration","repairTime","notes","creatorId","updaterId","archivedAt","relatedAssetIds","workOrderIds"],"properties":{"id":{"type":"integer","description":"Global ID of the Root Cause Analysis report.","example":4242},"organizationId":{"type":"integer","example":1,"description":"ID of the organization that owns this resource"},"status":{"type":"string","enum":["DONE","DRAFT"],"description":"Status of the Root Cause Analysis report"},"mainAssetId":{"type":"integer","description":"ID of the asset the Root Cause Analysis report is primarily about.","example":963},"mainAssetStatusId":{"type":"integer","nullable":true,"description":"ID of the asset status that was active on the main asset when the report was created. Null when no status was captured or the status has since been deleted.","example":8123},"createdAt":{"type":"string","format":"date-time","description":"Creation date of the report.","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","nullable":true,"description":"Last update date of the report. Null for reports that have not been edited.","example":"2022-01-01T00:00:00.000Z"},"completedAt":{"type":"string","format":"date-time","nullable":true,"description":"Date the report was marked as completed (status transitioned to DONE).","example":"2022-01-01T00:00:00.000Z"},"incidentStartedAt":{"type":"string","format":"date-time","nullable":true,"description":"Date and time the incident the report covers started.","example":"2022-01-01T00:00:00.000Z"},"incidentEndedAt":{"type":"string","format":"date-time","nullable":true,"description":"Date and time the incident the report covers ended.","example":"2022-01-01T00:00:00.000Z"},"incidentDuration":{"type":"integer","nullable":true,"description":"Duration of the incident in seconds. Null when either incident date is missing.","example":86400},"repairTime":{"type":"integer","nullable":true,"description":"Repair time in seconds.","example":7200},"notes":{"type":"object","nullable":true,"required":["text"],"properties":{"text":{"type":"string","description":"Plain-text representation of the notes.","example":"Loose coupling caused the conveyor to skip."}},"description":"Optional free-text notes for the report."},"creatorId":{"type":"integer","description":"ID of the user that created the report.","example":23494},"updaterId":{"type":"integer","nullable":true,"description":"ID of the user that last updated the report. Null for reports that have not been edited.","example":23494},"archivedAt":{"type":"string","format":"date-time","nullable":true,"description":"Date the report was archived. Null when the report is active.","example":"2022-01-01T00:00:00.000Z"},"relatedAssetIds":{"type":"array","description":"IDs of additional assets linked to this report. Excludes the main asset (see `mainAssetId`).","items":{"type":"integer"}},"workOrderIds":{"type":"array","description":"IDs of work orders linked to this report.","items":{"type":"integer"}},"mainAsset":{"type":"object","required":["id","name","description","parentId","criticalityId","locationId","serialNumber","createdAt","updatedAt","creatorId"],"description":"Asset linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"},"name":{"type":"string","example":"Forklift"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the asset creator"}},"nullable":true},"mainAssetStatus":{"type":"object","description":"Asset status that was active on the main asset when the report was created. (expand with query parameter)","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset status."},"customStatus":{"type":"object","required":["label"],"properties":{"id":{"type":"number","example":"Global ID of the custom asset status."},"label":{"type":"string","example":"Decommissioned"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was created.","example":"2022-01-01T12:34:56.123Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was last updated.","example":"2022-01-01T12:34:56.123Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the asset custom status was deleted.","format":"date-time","example":"2022-01-01T12:34:56.123Z"},"downtimeType":{"type":"string","nullable":true,"example":null,"enum":["PLANNED","UNPLANNED"],"deprecated":true,"description":"Downtime type on asset custom statuses will always return null. Use downtime type on asset status instead."}},"description":"Custom status assigned to asset.","nullable":true},"customStatusId":{"type":"number","description":"Id of the custom status assigned to asset.","nullable":true,"example":53},"status":{"type":"string","example":"OFFLINE","description":"Asset status value.","enum":["IGNORE","OFFLINE","ONLINE"]},"downtimeType":{"type":"string","nullable":true,"example":"PLANNED","enum":["PLANNED","UNPLANNED"]},"startedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective start date."},"endedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective end date.","nullable":true},"description":{"type":"string","example":"Overheated - needs servicing.","nullable":true},"createdAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was created."},"updatedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was last updated."},"deletedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was deleted.","nullable":true}},"nullable":true},"problems":{"type":"array","description":"Problems documented in this report. (expand with query parameter)","items":{"type":"object","required":["id","category","stepOptions","notes"],"properties":{"id":{"type":"integer","description":"Global ID of the Root Cause Analysis problem.","example":7311},"category":{"type":"object","nullable":true,"required":["id","label"],"properties":{"id":{"type":"integer","description":"Global ID of the Root Cause Analysis category.","example":902},"label":{"type":"string","description":"Label of the category.","example":"Mechanical Failure"}}},"stepOptions":{"type":"array","description":"Step options selected for this problem.","items":{"type":"object","required":["id","label","stepType"],"properties":{"id":{"type":"integer","description":"Global ID of the Root Cause Analysis step option.","example":5018},"label":{"type":"string","description":"Label of the step option.","example":"Worn bearings"},"stepType":{"type":"string","enum":["ACTION","CAUSE","FAILURE","PROBLEM_TYPE"],"description":"Step type of the Root Cause Analysis step option"}}}},"notes":{"type":"object","nullable":true,"required":["text"],"properties":{"text":{"type":"string","description":"Plain-text representation of the notes.","example":"Loose coupling caused the conveyor to skip."}},"description":"Optional free-text notes for the problem."}}},"nullable":false}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Root Cause Analysis Reports.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Root Cause Analysis Reports.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Root Cause Analysis Reports"]}},"/rootcauseanalysisreports/{id}":{"get":{"summary":"Get root cause analysis report","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the rootCauseAnalysisReport","example":"1"},{"in":"query","name":"expand","schema":{"title":"Expand specific fields in the request","description":"To expand multiple fields: `expand=main_asset&expand=main_asset_status`","type":"array","items":{"type":"string","enum":["main_asset","main_asset_status","problems","work_orders"]}}}],"responses":{"200":{"description":"Successfully retrieved rootCauseAnalysisReport's information","content":{"application/json":{"schema":{"type":"object","required":["rootCauseAnalysisReport"],"properties":{"rootCauseAnalysisReport":{"type":"object","required":["id","status","mainAssetId","mainAssetStatusId","createdAt","updatedAt","completedAt","incidentStartedAt","incidentEndedAt","incidentDuration","repairTime","notes","creatorId","updaterId","archivedAt","relatedAssetIds","workOrderIds"],"properties":{"id":{"type":"integer","description":"Global ID of the Root Cause Analysis report.","example":4242},"organizationId":{"type":"integer","example":1,"description":"ID of the organization that owns this resource"},"status":{"type":"string","enum":["DONE","DRAFT"],"description":"Status of the Root Cause Analysis report"},"mainAssetId":{"type":"integer","description":"ID of the asset the Root Cause Analysis report is primarily about.","example":963},"mainAssetStatusId":{"type":"integer","nullable":true,"description":"ID of the asset status that was active on the main asset when the report was created. Null when no status was captured or the status has since been deleted.","example":8123},"createdAt":{"type":"string","format":"date-time","description":"Creation date of the report.","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","nullable":true,"description":"Last update date of the report. Null for reports that have not been edited.","example":"2022-01-01T00:00:00.000Z"},"completedAt":{"type":"string","format":"date-time","nullable":true,"description":"Date the report was marked as completed (status transitioned to DONE).","example":"2022-01-01T00:00:00.000Z"},"incidentStartedAt":{"type":"string","format":"date-time","nullable":true,"description":"Date and time the incident the report covers started.","example":"2022-01-01T00:00:00.000Z"},"incidentEndedAt":{"type":"string","format":"date-time","nullable":true,"description":"Date and time the incident the report covers ended.","example":"2022-01-01T00:00:00.000Z"},"incidentDuration":{"type":"integer","nullable":true,"description":"Duration of the incident in seconds. Null when either incident date is missing.","example":86400},"repairTime":{"type":"integer","nullable":true,"description":"Repair time in seconds.","example":7200},"notes":{"type":"object","nullable":true,"required":["text"],"properties":{"text":{"type":"string","description":"Plain-text representation of the notes.","example":"Loose coupling caused the conveyor to skip."}},"description":"Optional free-text notes for the report."},"creatorId":{"type":"integer","description":"ID of the user that created the report.","example":23494},"updaterId":{"type":"integer","nullable":true,"description":"ID of the user that last updated the report. Null for reports that have not been edited.","example":23494},"archivedAt":{"type":"string","format":"date-time","nullable":true,"description":"Date the report was archived. Null when the report is active.","example":"2022-01-01T00:00:00.000Z"},"relatedAssetIds":{"type":"array","description":"IDs of additional assets linked to this report. Excludes the main asset (see `mainAssetId`).","items":{"type":"integer"}},"workOrderIds":{"type":"array","description":"IDs of work orders linked to this report.","items":{"type":"integer"}},"mainAsset":{"type":"object","required":["id","name","description","parentId","criticalityId","locationId","serialNumber","createdAt","updatedAt","creatorId"],"description":"Asset linked to the element (expand with query parameter)","properties":{"id":{"type":"integer","example":963,"description":"Global ID of the asset"},"name":{"type":"string","example":"Forklift"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"criticalityId":{"type":"integer","nullable":true,"example":150,"description":"ID of the criticality of the asset"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"serialNumber":{"type":"string","nullable":true,"description":"Serial number of the asset","example":"000123ABC"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset was last updated. This doesn't include comments","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the asset creator"}},"nullable":true},"mainAssetStatus":{"type":"object","description":"Asset status that was active on the main asset when the report was created. (expand with query parameter)","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset status."},"customStatus":{"type":"object","required":["label"],"properties":{"id":{"type":"number","example":"Global ID of the custom asset status."},"label":{"type":"string","example":"Decommissioned"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was created.","example":"2022-01-01T12:34:56.123Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was last updated.","example":"2022-01-01T12:34:56.123Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the asset custom status was deleted.","format":"date-time","example":"2022-01-01T12:34:56.123Z"},"downtimeType":{"type":"string","nullable":true,"example":null,"enum":["PLANNED","UNPLANNED"],"deprecated":true,"description":"Downtime type on asset custom statuses will always return null. Use downtime type on asset status instead."}},"description":"Custom status assigned to asset.","nullable":true},"customStatusId":{"type":"number","description":"Id of the custom status assigned to asset.","nullable":true,"example":53},"status":{"type":"string","example":"OFFLINE","description":"Asset status value.","enum":["IGNORE","OFFLINE","ONLINE"]},"downtimeType":{"type":"string","nullable":true,"example":"PLANNED","enum":["PLANNED","UNPLANNED"]},"startedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective start date."},"endedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective end date.","nullable":true},"description":{"type":"string","example":"Overheated - needs servicing.","nullable":true},"createdAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was created."},"updatedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was last updated."},"deletedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was deleted.","nullable":true}},"nullable":true},"problems":{"type":"array","description":"Problems documented in this report. (expand with query parameter)","items":{"type":"object","required":["id","category","stepOptions","notes"],"properties":{"id":{"type":"integer","description":"Global ID of the Root Cause Analysis problem.","example":7311},"category":{"type":"object","nullable":true,"required":["id","label"],"properties":{"id":{"type":"integer","description":"Global ID of the Root Cause Analysis category.","example":902},"label":{"type":"string","description":"Label of the category.","example":"Mechanical Failure"}}},"stepOptions":{"type":"array","description":"Step options selected for this problem.","items":{"type":"object","required":["id","label","stepType"],"properties":{"id":{"type":"integer","description":"Global ID of the Root Cause Analysis step option.","example":5018},"label":{"type":"string","description":"Label of the step option.","example":"Worn bearings"},"stepType":{"type":"string","enum":["ACTION","CAUSE","FAILURE","PROBLEM_TYPE"],"description":"Step type of the Root Cause Analysis step option"}}}},"notes":{"type":"object","nullable":true,"required":["text"],"properties":{"text":{"type":"string","description":"Plain-text representation of the notes.","example":"Loose coupling caused the conveyor to skip."}},"description":"Optional free-text notes for the problem."}}},"nullable":false},"workOrders":{"type":"array","description":"Full work order objects linked to this report. Only available on the single-report endpoint. (expand with query parameter)","items":{"type":"object","additionalProperties":true},"nullable":false}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified rootCauseAnalysisReport or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Root Cause Analysis Reports"]}},"/workrequestportals":{"post":{"summary":"Create new work request portal","requestBody":{"description":"Portal to create","required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string","example":"Shipping Portal","description":"Title of the portal"},"welcomeText":{"type":"string","nullable":true,"example":"Use this portal for all request related to our shipping activities","description":"Description text describing the portal"},"descriptionPlaceholder":{"type":"string","nullable":true,"example":"Describe your request","description":"Placeholder text for the description field"},"contactInformation":{"type":"string","nullable":true,"example":"Jimmy@example.com","description":"Contact of the person creating the portal (email or phone number)"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the portal is located"},"assetId":{"type":"integer","nullable":true,"example":852,"description":"ID of the asset related to the portal"},"emailOnly":{"type":"boolean","example":true,"nullable":true,"description":"Allow request creation with email only to contact the requester"},"sendEmailNotification":{"type":"boolean","example":true,"nullable":true,"description":"Send email notifications to the portal requesters with status updates on their requests"}}}}}},"responses":{"201":{"description":"Successfully created portal","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the portal"}}}}}},"400":{"description":"OrganizationId was not provided","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Missing x-organization-id header."}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"description":"You are forbidden to perform the requested action, to access this resource or the feature is disabled by your administrator","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"Forbidden"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}}},"tags":["Work Request Portals"],"parameters":[{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}]},"get":{"summary":"List work request portals","description":"Endpoint used to list work request portal resources","parameters":[{"name":"cursor","in":"query","schema":{"description":"Last pagination reference","type":"string"}},{"name":"limit","in":"query","schema":{"description":"max number of Work Request Portals returned","type":"integer","minimum":1,"maximum":200,"default":100}},{"schema":{"type":"integer"},"description":"Required if using a multi organizations token","name":"x-organization-id","in":"header","required":false,"example":"1"}],"responses":{"200":{"description":"Successfully fetched Work Request Portals list","content":{"application/json":{"schema":{"type":"object","required":["workRequestPortals","nextCursor","nextPageUrl"],"properties":{"workRequestPortals":{"type":"array","items":{"type":"object","required":["id","title","portalUrl","welcomeText","descriptionPlaceholder","contactInformation","assetId","locationId","emailOnly","sendEmailNotification"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the portal"},"title":{"type":"string","example":"Shipping Portal","description":"Title of the portal"},"portalUrl":{"type":"string","example":"https://app.getmaintainx.com/request-portal/ae9d33c8-ef78-44c4-925d-352878db0993","description":"Url to access the portal"},"welcomeText":{"type":"string","nullable":true,"example":"Use this portal for all request related to our shipping activities","description":"Description text describing the portal"},"descriptionPlaceholder":{"type":"string","nullable":true,"example":"Describe your request","description":"Placeholder text for the description field"},"contactInformation":{"type":"string","nullable":true,"example":"Jimmy@example.com","description":"Contact of the person creating the portal (email or phone number)"},"assetId":{"type":"integer","nullable":true,"example":852,"description":"ID of the asset related to the portal"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the portal is located"},"emailOnly":{"type":"boolean","example":true,"nullable":true,"description":"Allow request creation with email only to contact the requester"},"sendEmailNotification":{"type":"boolean","example":true,"nullable":true,"description":"Send email notifications to the portal requesters with status updates on their requests"}}}},"nextCursor":{"description":"The cursor to retrieve the next page of Work Request Portals.","type":"string","nullable":true},"nextPageUrl":{"description":"Path with query parameters that can be used to retrieve the next page of Work Request Portals.","type":"string","nullable":true}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}},"tags":["Work Request Portals"]}},"/workrequestportals/{id}":{"get":{"summary":"Get work request portal","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the workRequestPortal","example":"1"}],"responses":{"200":{"description":"Successfully retrieved workRequestPortal's information","content":{"application/json":{"schema":{"type":"object","required":["workRequestPortal"],"properties":{"workRequestPortal":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the portal"},"title":{"type":"string","example":"Shipping Portal","description":"Title of the portal"},"welcomeText":{"type":"string","nullable":true,"example":"Use this portal for all request related to our shipping activities","description":"Description text describing the portal"},"descriptionPlaceholder":{"type":"string","nullable":true,"example":"Describe your request","description":"Placeholder text for the description field"},"contactInformation":{"type":"string","nullable":true,"example":"Jimmy@example.com","description":"Contact of the person creating the portal (email or phone number)"},"portalUrl":{"type":"string","example":"https://app.getmaintainx.com/request-portal/ae9d33c8-ef78-44c4-925d-352878db0993","description":"Url to access the portal"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the portal is located"},"assetId":{"type":"integer","nullable":true,"example":852,"description":"ID of the asset related to the portal"},"emailOnly":{"type":"boolean","example":true,"nullable":true,"description":"Allow request creation with email only to contact the requester"},"sendEmailNotification":{"type":"boolean","example":true,"nullable":true,"description":"Send email notifications to the portal requesters with status updates on their requests"}}}}}}}},"400":{"description":"Error with query","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"description":"Description of error","type":"string"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified workRequestPortal or the user cannot access it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Not Found."}}}}}}},"tags":["Work Request Portals"]},"patch":{"summary":"Update work request portal","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the work request portal","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"requestBody":{"description":"Work request portal to update","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","example":"Shipping Portal","description":"Title of the portal"},"welcomeText":{"type":"string","nullable":true,"example":"Use this portal for all request related to our shipping activities","description":"Description text describing the portal"},"descriptionPlaceholder":{"type":"string","nullable":true,"example":"Describe your request","description":"Placeholder text for the description field"},"contactInformation":{"type":"string","nullable":true,"example":"Jimmy@example.com","description":"Contact of the person creating the portal (email or phone number)"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the portal is located"},"assetId":{"type":"integer","nullable":true,"example":852,"description":"ID of the asset related to the portal"},"emailOnly":{"type":"boolean","example":true,"nullable":true,"description":"Allow request creation with email only to contact the requester"},"sendEmailNotification":{"type":"boolean","example":true,"nullable":true,"description":"Send email notifications to the portal requesters with status updates on their requests"}}}}}},"responses":{"200":{"description":"Successfully edited work request portal","content":{"application/json":{"schema":{"type":"object","required":["workRequestPortal"],"properties":{"workRequestPortal":{"type":"object","required":["id","title"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the portal"},"title":{"type":"string","example":"Shipping Portal","description":"Title of the portal"},"welcomeText":{"type":"string","nullable":true,"example":"Use this portal for all request related to our shipping activities","description":"Description text describing the portal"},"descriptionPlaceholder":{"type":"string","nullable":true,"example":"Describe your request","description":"Placeholder text for the description field"},"contactInformation":{"type":"string","nullable":true,"example":"Jimmy@example.com","description":"Contact of the person creating the portal (email or phone number)"},"portalUrl":{"type":"string","example":"https://app.getmaintainx.com/request-portal/ae9d33c8-ef78-44c4-925d-352878db0993","description":"Url to access the portal"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the portal is located"},"assetId":{"type":"integer","nullable":true,"example":852,"description":"ID of the asset related to the portal"},"emailOnly":{"type":"boolean","example":true,"nullable":true,"description":"Allow request creation with email only to contact the requester"},"sendEmailNotification":{"type":"boolean","example":true,"nullable":true,"description":"Send email notifications to the portal requesters with status updates on their requests"}}}}}}}},"400":{"description":"Failed to edit the work request portal","content":{"application/json":{"schema":{"type":"object","required":["errors"],"example":{"errors":[{"error":"parentId is not valid"}]},"properties":{"errors":{"type":"array","items":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fieldPath":{"nullable":true,"type":"string"},"fieldValue":{"nullable":true,"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified work request portal.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"work request portal Not Found"}}}}}}},"tags":["Work Request Portals"]},"delete":{"summary":"Delete work request portal","parameters":[{"schema":{"type":"integer"},"name":"id","in":"path","required":true,"description":"ID of the workRequestPortal","example":"1"},{"schema":{"type":"boolean"},"description":"Set `skipWebhook=true`, `skipWebhook=1` or `skipWebhook=yes` to skip all webhooks upon successful operation on the endpoint. [Learn more about webhooks](#tag/Subscriptions-and-Webhooks)","name":"skipWebhook","in":"query","required":false}],"responses":{"204":{"description":"Successfully deleted the workRequestPortal"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"description":"Could not find the specified workRequestPortal.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"workRequestPortal Not Found"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Internal server error."}}}}}}},"tags":["Work Request Portals"]}}},"components":{"securitySchemes":{"Bearer":{"description":"\n  <p>Authenticate by adding the following HTTP header to your requests:</p>\n<pre>Authorization: bearer {{token}}</pre>\n<p>The <code>token</code> can be generated in your MaintainX account. Go to <a href=\"https://app.getmaintainx.com/settings/integrations/apiKeys\">\"Settings &gt; Integrations &gt; API Keys\"</a> to generate a key for your user.</p>\n","type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"UnauthorizedError":{"description":"Invalid token"}}},"security":[{"Bearer":[]}],"x-webhooks":{"API_TOKEN_CREATED":{"post":{"summary":"API Token Created","security":[],"description":"Fires when a REST API token is generated.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["API_TOKEN_CREATED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"API_TOKEN_CREATED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"API_TOKEN_CREATED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"API_TOKEN_REVOKED":{"post":{"summary":"API Token Revoked","security":[],"description":"Fires when a REST API token is revoked.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["API_TOKEN_REVOKED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"API_TOKEN_REVOKED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"API_TOKEN_REVOKED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"ASSET_STATUS_CHANGE":{"post":{"summary":"Asset Status Change","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","assetId","orgId","oldStatus","newStatus","occurredAt"],"properties":{"eventType":{"type":"string","enum":["ASSET_STATUS_CHANGE"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"ASSET_STATUS_CHANGE"},"assetId":{"type":"number","description":"Global ID of the asset","example":42},"orgId":{"type":"number","description":"Global ID of the organization","example":21},"oldStatus":{"description":"Previous status of the asset","type":"object","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset status."},"customStatus":{"type":"object","required":["label"],"properties":{"id":{"type":"number","example":"Global ID of the custom asset status."},"label":{"type":"string","example":"Decommissioned"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was created.","example":"2022-01-01T12:34:56.123Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was last updated.","example":"2022-01-01T12:34:56.123Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the asset custom status was deleted.","format":"date-time","example":"2022-01-01T12:34:56.123Z"},"downtimeType":{"type":"string","nullable":true,"example":null,"enum":["PLANNED","UNPLANNED"],"deprecated":true,"description":"Downtime type on asset custom statuses will always return null. Use downtime type on asset status instead."}},"description":"Custom status assigned to asset.","nullable":true},"customStatusId":{"type":"number","description":"Id of the custom status assigned to asset.","nullable":true,"example":53},"status":{"type":"string","example":"OFFLINE","description":"Asset status value.","enum":["IGNORE","OFFLINE","ONLINE"]},"downtimeType":{"type":"string","nullable":true,"example":"PLANNED","enum":["PLANNED","UNPLANNED"]},"startedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective start date."},"endedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective end date.","nullable":true},"description":{"type":"string","example":"Overheated - needs servicing.","nullable":true},"createdAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was created."},"updatedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was last updated."},"deletedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was deleted.","nullable":true}},"example":{"status":"ONLINE","startedAt":"2022-01-01T12:34:56.123Z","endedAt":"2022-01-01T12:34:56.123Z","description":"Back online after scheduled maintenance","createdAt":"2022-01-01T12:34:56.123Z","updatedAt":"2022-01-01T12:34:56.123Z","deletedAt":"2022-01-01T12:34:56.123Z"}},"newStatus":{"description":"New status of the asset","type":"object","properties":{"id":{"type":"number","example":42,"description":"Global ID of the asset status."},"customStatus":{"type":"object","required":["label"],"properties":{"id":{"type":"number","example":"Global ID of the custom asset status."},"label":{"type":"string","example":"Decommissioned"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was created.","example":"2022-01-01T12:34:56.123Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the asset custom status was last updated.","example":"2022-01-01T12:34:56.123Z"},"deletedAt":{"type":"string","nullable":true,"description":"Date at which the asset custom status was deleted.","format":"date-time","example":"2022-01-01T12:34:56.123Z"},"downtimeType":{"type":"string","nullable":true,"example":null,"enum":["PLANNED","UNPLANNED"],"deprecated":true,"description":"Downtime type on asset custom statuses will always return null. Use downtime type on asset status instead."}},"description":"Custom status assigned to asset.","nullable":true},"customStatusId":{"type":"number","description":"Id of the custom status assigned to asset.","nullable":true,"example":53},"status":{"type":"string","example":"OFFLINE","description":"Asset status value.","enum":["IGNORE","OFFLINE","ONLINE"]},"downtimeType":{"type":"string","nullable":true,"example":"PLANNED","enum":["PLANNED","UNPLANNED"]},"startedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective start date."},"endedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","description":"Asset status effective end date.","nullable":true},"description":{"type":"string","example":"Overheated - needs servicing.","nullable":true},"createdAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was created."},"updatedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was last updated."},"deletedAt":{"type":"string","format":"date-time","example":"2022-01-01T12:34:56.123Z","readOnly":true,"description":"Date & time at which the asset status was deleted.","nullable":true}},"example":{"status":"OFFLINE","customStatus":{"id":13,"label":"Technical issues","downtimeType":"UNPLANNED","createdAt":"2022-01-01T12:34:56.123Z","updatedAt":"2022-01-01T12:34:56.123Z"},"startedAt":"2022-01-01T12:34:56.123Z","description":"Overheated - needs servicing.","createdAt":"2022-01-01T12:34:56.123Z","updatedAt":"2022-01-01T12:34:56.123Z"}},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the asset status was changed","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"ASSET_STATUS_CHANGE","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"CONNECTOR_TOKEN_REVOKED":{"post":{"summary":"Connector Token Revoked","security":[],"description":"Fires when a connector integration token is revoked.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["CONNECTOR_TOKEN_REVOKED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"CONNECTOR_TOKEN_REVOKED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"CONNECTOR_TOKEN_REVOKED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"CUSTOMER_CHANGE":{"post":{"summary":"Customer Change","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","customerId","orgId","occurredAt","editCustomer"],"properties":{"eventType":{"type":"string","enum":["CUSTOMER_CHANGE"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"CUSTOMER_CHANGE"},"customerId":{"type":"number","description":"Global ID of the customer","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"},"editCustomer":{"type":"object","description":"Properties of the Customer","required":["id","name"],"properties":{"id":{"type":"number","description":"Global ID of the customer","example":123456},"name":{"type":"string","description":"Name of the customer","example":"Acme Manufacturing"}}}}}}}},"operationId":"CUSTOMER_CHANGE","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"DATA_EXPORT_INITIATED":{"post":{"summary":"Data Export Initiated","security":[],"description":"Fires when a data export is initiated.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","exportType","occurredAt"],"properties":{"eventType":{"type":"string","enum":["DATA_EXPORT_INITIATED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"DATA_EXPORT_INITIATED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"exportType":{"type":"string","description":"Type of data exported"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"DATA_EXPORT_INITIATED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"INVITE_LINK_ARCHIVED":{"post":{"summary":"Invite Link Archived","security":[],"description":"Fires when an invite link is archived.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","inviteLinkId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["INVITE_LINK_ARCHIVED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"INVITE_LINK_ARCHIVED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"inviteLinkId":{"type":"number","description":"ID of the invite link","example":50},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"INVITE_LINK_ARCHIVED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"INVITE_LINK_CREATED":{"post":{"summary":"Invite Link Created","security":[],"description":"Fires when an invite link is created.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","inviteLinkId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["INVITE_LINK_CREATED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"INVITE_LINK_CREATED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"inviteLinkId":{"type":"number","description":"ID of the invite link","example":50},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"INVITE_LINK_CREATED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"INVITE_LINK_UPDATED":{"post":{"summary":"Invite Link Updated","security":[],"description":"Fires when an invite link is updated.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","inviteLinkId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["INVITE_LINK_UPDATED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"INVITE_LINK_UPDATED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"inviteLinkId":{"type":"number","description":"ID of the invite link","example":50},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"INVITE_LINK_UPDATED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"METER_TRIGGER_STATE_CHANGE":{"post":{"summary":"Meter Trigger Status Change","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","meterTriggerId","meterId","orgId","oldState","newState","occurredAt"],"properties":{"eventType":{"type":"string","enum":["METER_TRIGGER_STATE_CHANGE"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"METER_TRIGGER_STATE_CHANGE"},"meterTriggerId":{"type":"number","description":"Global ID of the meter trigger","example":123},"meterId":{"type":"number","description":"Global ID of the meter","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"oldState":{"title":"State","type":"string","enum":["INACTIVE","INSUFFICIENT_DATA","PENDING","STABLE","TRIGGERED"],"description":"Previous state of the trigger","example":"PENDING"},"newState":{"title":"State","type":"string","enum":["INACTIVE","INSUFFICIENT_DATA","PENDING","STABLE","TRIGGERED"],"description":"New state of the trigger","example":"TRIGGERED"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occured","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"METER_TRIGGER_STATE_CHANGE","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"NEW_ASSET":{"post":{"summary":"New Asset","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","assetId","orgId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["NEW_ASSET"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"NEW_ASSET"},"assetId":{"type":"number","description":"Global ID of the Asset","example":123456},"assetExternalId":{"type":"string","nullable":true,"description":"External ID of the Asset","example":"ext-asset-001"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"},"newAsset":{"type":"object","description":"Properties of the created Asset","properties":{"name":{"type":"string","example":"Forklift"},"description":{"type":"string","nullable":true,"example":"Forklift that is used to to move heavy equipments around the warehouse"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the asset is located"},"barcode":{"type":"string","nullable":true,"example":"BWFPBNRHAW54CG","description":"String encoded barcode"},"parentId":{"type":"integer","nullable":true,"example":852,"description":"ID of the parent asset"},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"teamIds":{"type":"array","items":{"type":"integer"},"description":"List of teams responsible for the asset","example":[123,456]},"assetTypes":{"type":"array","items":{"type":"string"},"example":["manual","tool"],"description":"List of asset types"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"My Custom Field\")","additionalProperties":{"type":"string"},"example":{"My Custom Field":"000000000"}}}}}}}}},"operationId":"NEW_ASSET","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"NEW_CATEGORY_ON_WORK_ORDER":{"post":{"summary":"New Category on Work Order","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","workOrderId","orgId","newCategories","occurredAt"],"properties":{"eventType":{"type":"string","enum":["NEW_CATEGORY_ON_WORK_ORDER"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"NEW_CATEGORY_ON_WORK_ORDER"},"workOrderId":{"type":"number","description":"Global ID of the work order","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"customerId":{"type":"number","nullable":true,"description":"Global ID of the customer linked to the work order. Null when none.","example":456},"newCategories":{"type":"array","description":"Newly added categories on the work order","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"number","description":"Global ID of the category","example":123},"name":{"type":"string","description":"Label of the category","example":"Safety"},"description":{"type":"string","example":"Used for everything related to Safety","description":"Description field for additional information."}}}},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"NEW_CATEGORY_ON_WORK_ORDER","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"NEW_COMMENT_ON_WORK_ORDER":{"post":{"summary":"New Comment on Work Order","security":[],"description":"Triggered when a new comment is created on a work order","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","workOrderId","type","comment","occurredAt"],"properties":{"eventType":{"type":"string","enum":["NEW_COMMENT_ON_WORK_ORDER"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"NEW_COMMENT_ON_WORK_ORDER"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"workOrderId":{"type":"number","description":"Global ID of the work order","example":123456},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"},"type":{"type":"string","description":"Type of the comment (TEXT, IMG, FILE, AUDIO)"},"comment":{"type":"string","description":"Newly created comment on the work order"},"url":{"type":"string","description":"URL of the file attached to the work order comment. Valid for 60 minutes."}}}}}},"operationId":"NEW_COMMENT_ON_WORK_ORDER","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"NEW_CUSTOMER":{"post":{"summary":"New Customer","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","customerId","orgId","occurredAt","newCustomer"],"properties":{"eventType":{"type":"string","enum":["NEW_CUSTOMER"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"NEW_CUSTOMER"},"customerId":{"type":"number","description":"Global ID of the Customer","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"},"newCustomer":{"type":"object","description":"Properties of the Customer","required":["id","name"],"properties":{"id":{"type":"number","description":"Global ID of the customer","example":123456},"name":{"type":"string","description":"Name of the customer","example":"Acme Manufacturing"}}}}}}}},"operationId":"NEW_CUSTOMER","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"NEW_LOCATION":{"post":{"summary":"New Location","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","locationId","orgId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["NEW_LOCATION"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"NEW_LOCATION"},"locationId":{"type":"number","description":"Global ID of the Location","example":123456},"locationExternalId":{"type":"string","nullable":true,"description":"External ID of the Location","example":"ext-location-001"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"NEW_LOCATION","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"NEW_PART":{"post":{"summary":"New Part","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","partId","orgId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["NEW_PART"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"NEW_PART"},"partId":{"type":"number","description":"Global ID of the Part","example":123456},"partExternalId":{"type":"string","nullable":true,"description":"External ID of the Part","example":"ext-part-001"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"},"newPart":{"type":"object","description":"Properties of the created Part","properties":{"name":{"type":"string","example":"Locknut - 1/8"},"area":{"type":"string","example":"tool room","nullable":true,"description":"Area of the part."},"assetIds":{"type":"array","items":{"type":"integer"},"example":[12,4561],"description":"List of asset IDs"},"availableQuantity":{"type":"integer","description":"Total quantity currently in stock.","example":10,"deprecated":true},"inStockQuantity":{"type":"integer","description":"Total quantity currently in stock.","example":10},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"description":{"type":"string","nullable":true,"example":""},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"000000000"}},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the part is located."},"minimumQuantity":{"type":"integer","description":"Total minimum quantity before you should restock.","example":5},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Total maximum quantity to keep in stock. Null when no part location has a max set."},"partTypes":{"type":"array","items":{"type":"string"},"description":"List of part types"},"teamIds":{"type":"array","items":{"type":"integer"},"example":[1,4],"description":"List of team IDs in charge of the part"},"unitCost":{"type":"integer","description":"Cost in cents. For example, for $1.20, put 120.","example":120,"nullable":true},"vendors":{"type":"array","description":"List of vendors of the part","items":{"type":"object","properties":{"vendorId":{"type":"integer","example":"1","description":"Id of the vendor"},"partNumber":{"type":"string","example":"XC230","description":"Part number given to the part by this vendor"}}}},"locations":{"type":"array","items":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"integer","example":852,"description":"ID of the location where the part is located"},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5,"nullable":true},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Maximum quantity you want to stock. Must be greater than or equal to minimumQuantity."},"area":{"type":"string","example":"tool room","nullable":true}}},"description":"Detailed list of locations where the part is stored, including properties such as available quantity, minimum quantity, reserved quantity, and area within each location."}}}}}}}},"operationId":"NEW_PART","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"NEW_PURCHASE_ORDER":{"post":{"summary":"New Purchase Order","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","purchaseOrderId","orgId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["NEW_PURCHASE_ORDER"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"NEW_PURCHASE_ORDER"},"purchaseOrderId":{"type":"number","description":"Global ID of the Purchase Order","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"},"userId":{"type":"number","description":"Integer ID of the user whose action triggered this webhook. Present whenever a real user triggered the event. Absent for system-initiated events such as automations, scheduled runs, or other actions performed by the system — treat the absence of `userId` as a system-initiated signal.","example":789},"newPurchaseOrder":{"type":"object","description":"Properties of the created Purchase Order","properties":{"approverId":{"type":"number","example":135,"description":"ID of the user who approved the Purchase Order","nullable":true},"approvalDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date the Purchase Order was approved","nullable":true},"note":{"type":"string","nullable":true,"description":"Notes left for Purchase Orders","example":"Please deliver during business hours"},"status":{"type":"string","example":"APPROVED","description":"Status of the Purchase Order. Supported values are APPROVED, CANCELED, COMPLETED, DECLINED, PARTIALLY_FULFILLED, PENDING, REQUESTED","nullable":true},"vendorId":{"type":"number","example":432,"description":"ID of vendor that this Purchase Order is associated with","nullable":true},"vendorContactIds":{"type":"array","description":"List of vendor contact IDs in the Purchase Order","example":[12,34,56],"items":{"type":"number","example":12}},"billingAddress":{"type":"object","description":"Billing address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"shippingAddress":{"type":"object","description":"Shipping address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"dueDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Due date of Purchase Order","nullable":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the Purchase Order","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"autoGeneratedNumber":{"type":"number","example":987,"nullable":true,"description":"Autogenerated Purchase Order number"},"overrideNumber":{"type":"string","example":"A123","nullable":true,"description":"Custom number/identifier for Purchase Order"},"creatorId":{"type":"number","example":432,"description":"ID of the user that created this Purchase Order"},"reviewNote":{"type":"string","nullable":true,"description":"Notes to be left for changes to be made when sending a Purchase Order for revision","example":"Please adjust quantities and resubmit"},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"title":{"type":"string","nullable":true,"description":"Title of the Purchase Order.","example":"Office Supplies Order"},"items":{"type":"array","description":"List of items in the Purchase Order","items":{"type":"object","required":["id","quantityOrdered"],"properties":{"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the Purchase Order item was created","example":"2022-01-01T00:00:00.000Z"},"price":{"type":"number","example":25000,"nullable":true,"description":"Total price of items in cents"},"priceDecimal":{"type":"string","example":"250.000000","nullable":true,"description":"Total price of items as a decimal value"},"partNumber":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"updaterId":{"type":"integer","nullable":true,"example":851,"description":"ID of the last user who updated the Purchase Order item"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the Purchase Order item creator"},"partId":{"type":"number","example":43,"description":"ID of the part this item is related to","nullable":true},"id":{"type":"number","example":23,"description":"ID of the item"},"quantityOrdered":{"type":"number","example":4,"description":"Represent the amount of units for this item that were ordered in the purchase order."},"quantityReceived":{"type":"number","example":3,"nullable":true,"description":"Represents the total amount of this specific item that has been received to date."},"unitCost":{"type":"number","example":125000,"nullable":true,"description":"Price of a single item in cents"},"unitCostDecimal":{"type":"string","example":"1250.000000","nullable":true,"description":"Price of a single item as a decimal value"},"lineExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}},"partExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"321"}},"organizationId":{"type":"number","description":"Global ID of the organization","example":321},"purchaseOrderId":{"type":"integer","nullable":true,"example":891,"description":"Global ID of the Purchase Order linked with that Purchase Order item"}}}},"costs":{"type":"array","description":"List of costs in the Purchase Order","items":{"type":"object","required":["id","name","type","amount"],"properties":{"id":{"type":"number","example":123,"description":"ID of the cost"},"organizationId":{"type":"number","description":"Global ID of the organization","example":321},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the Purchase Order item creator"},"purchaseOrderId":{"type":"integer","nullable":true,"example":891,"description":"Global ID of the Purchase Order linked with that Purchase Order cost"},"name":{"type":"string","example":"Sales Tax","description":"Description of the cost"},"type":{"type":"string","enum":["AMOUNT_NON_TAXABLE","AMOUNT_TAXABLE","PERCENT_TAXABLE"],"example":"AMOUNT_TAXABLE","description":"Type of cost in either cents or percent. Accepted types in cents are AMOUNT_TAXABLE and AMOUNT_NON_TAXABLE. For percentage use PERCENT_TAXABLE"},"amount":{"type":"number","example":125000},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the Purchase Order cost was created","example":"2022-01-01T00:00:00.000Z"}}}}}}}}}}},"operationId":"NEW_PURCHASE_ORDER","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"NEW_SLASH_COMMAND":{"post":{"summary":"New Slash Command","security":[],"description":"Triggered when a new slash command is created","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","user","parent","command","content","messageId","orgId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["NEW_SLASH_COMMAND"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"NEW_SLASH_COMMAND"},"user":{"type":"object","required":["id"],"properties":{"id":{"type":"number","description":"Global Id of the user","example":12345}}},"parent":{"type":"object","required":["id","type","name"],"properties":{"id":{"type":"number","description":"Global Id of the parent message","example":12345},"type":{"type":"string","description":"Type of the parent message","enum":["CONVERSATION","WORK_ORDER"]},"name":{"type":"string","description":"Name of the Work Order or Conversation","example":"Some PM"}}},"messageId":{"type":"number","description":"Global ID of the message","example":12345},"orgId":{"type":"number","description":"Global Id of the organization","example":12345},"command":{"type":"string","description":"Command of the Slash Command","example":"jira"},"content":{"type":"string","description":"Content of the Slash Command","example":"WORK-000 escalate"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"NEW_SLASH_COMMAND","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"NEW_VENDOR":{"post":{"summary":"New Vendor","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","vendorId","orgId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["NEW_VENDOR"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"NEW_VENDOR"},"vendorId":{"type":"number","description":"Global ID of the Vendor","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"NEW_VENDOR","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"NEW_WORK_ORDER":{"post":{"summary":"New Work Order","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","workOrderId","orgId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["NEW_WORK_ORDER"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"NEW_WORK_ORDER"},"workOrderId":{"type":"number","description":"Global ID of the Work Order","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"customerId":{"type":"number","nullable":true,"description":"Global ID of the customer linked to the work order. Null when none.","example":456},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"},"userId":{"type":"number","description":"Integer ID of the user whose action triggered this webhook. Present whenever a real user triggered the event. Absent for system-initiated events such as automations, scheduled runs, or other actions performed by the system — treat the absence of `userId` as a system-initiated signal.","example":789},"newWorkOrder":{"type":"object","description":"Properties of the updated work order","properties":{"assetId":{"nullable":true,"type":"integer","example":42},"assigneeIds":{"type":"array","description":"List of user ids assigned to the work order","items":{"type":"integer","example":31}},"categories":{"type":"array","description":"Newly added categories on the work order","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"number","description":"Global ID of the category","example":123},"name":{"type":"string","description":"Label of the category","example":"Safety"},"description":{"type":"string","example":"Used for everything related to Safety","description":"Description field for additional information."}}}},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order is due","example":"2022-01-01T00:00:00.000Z"},"estimatedTime":{"type":"integer","nullable":true,"description":"The estimated time taken in seconds to complete the work order","example":3600},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Third Party Id\")","additionalProperties":{"type":"string"},"example":{"Third Party Id":"aa674f49-dac6-4f15-9fdd-061d2b5caf30"}},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order","example":611},"parts":{"type":"array","description":"Parts attached to the Work Order","items":{"type":"object","required":["id","quantityUsed","copyOnRecurring"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the part"},"quantityUsed":{"type":"integer","description":"Quantity used in the work order.","example":2},"unitCost":{"nullable":true,"type":"integer","description":"Cost in cents. For example, for $1.20, put 120","example":120},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location of the part.","example":852},"copyOnRecurring":{"type":"string","description":"Indicates if the parts will be copied to the next work order in the chain (if applicable).","default":"Default","enum":["NoCopy","Copy","Default"]}}}},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"startDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set","example":"2022-01-01T00:00:00.000Z"},"teamIds":{"type":"array","description":"List of team ids assigned to the work order","items":{"type":"integer","example":12}},"title":{"type":"string"},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}}}}}}}}},"operationId":"NEW_WORK_ORDER","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"NEW_WORK_REQUEST":{"post":{"summary":"New Request","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","workRequestId","orgId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["NEW_WORK_REQUEST"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"NEW_WORK_REQUEST"},"workRequestId":{"type":"number","description":"Global ID of the Request","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"NEW_WORK_REQUEST","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"PART_CHANGE":{"post":{"summary":"Part Change","security":[],"description":"The only properties triggering the webhook when changed, are the following: AREA, ASSETS, AVAILABLE_QUANTITY, BARCODE, DESCRIPTION, EXTRA_FIELDS, LOCATION, LOCATIONS, MAXIMUM_QUANTITY, MINIMUM_QUANTITY, NAME, PART_TYPES, TEAMS, UNIT_COST, VENDORS","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","partId","orgId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["PART_CHANGE"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"PART_CHANGE"},"partId":{"type":"number","description":"Global ID of the part","example":123456},"partExternalId":{"type":"string","nullable":true,"description":"External ID of the part","example":"ext-part-001"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"},"newPart":{"type":"object","description":"Properties of the updated part","properties":{"id":{"type":"integer","example":123456,"description":"Global ID of the part"},"name":{"type":"string","example":"Locknut - 1/8"},"description":{"type":"string","nullable":true,"example":""},"area":{"type":"string","example":"tool room","nullable":true,"description":"Area of the part. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"unitCost":{"type":"integer","description":"Cost in cents. For example, for $1.20, put 120.","example":120,"nullable":true},"availableQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations. Deprecated: Use `inStockQuantity` instead.","example":10,"deprecated":true},"inStockQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":10},"minimumQuantity":{"type":"integer","description":"Total minimum quantity before you should restock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":5},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the part is located. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"locations":{"type":"array","items":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"integer","example":852,"description":"ID of the location where the part is located"},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5,"nullable":true},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Maximum quantity you want to stock. Must be greater than or equal to minimumQuantity."},"area":{"type":"string","example":"tool room","nullable":true}}},"description":"Detailed list of locations where the part is stored, including properties such as available quantity, minimum quantity, reserved quantity, and area within each location."},"partTypes":{"type":"array","items":{"type":"string"},"description":"List of part types"},"assetIds":{"type":"array","items":{"type":"integer"},"example":[12,4561],"description":"List of asset IDs"},"teamIds":{"type":"array","items":{"type":"integer"},"example":[1,4],"description":"List of team IDs in charge of the part"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"000000000"}},"vendors":{"type":"array","description":"List of vendors of the part","items":{"type":"object","properties":{"vendorId":{"type":"integer","example":"1","description":"Id of the vendor"},"partNumber":{"type":"string","example":"XC230","description":"Part number given to the part by this vendor"}}}},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Total maximum quantity to keep in stock. Null when no part location has a max set."}}}}}}}},"operationId":"PART_CHANGE","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"PART_DELETE":{"post":{"summary":"Part Delete","security":[],"description":"Triggered when a part gets deleted.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","partId","orgId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["PART_DELETE"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"PART_DELETE"},"partId":{"type":"number","description":"Global ID of the part","example":123456},"partExternalId":{"type":"string","nullable":true,"description":"External ID of the part","example":"ext-part-001"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"},"deletedPart":{"type":"object","description":"Properties of the deleted part","properties":{"id":{"type":"integer","example":123456,"description":"Global ID of the part"},"name":{"type":"string","example":"Locknut - 1/8"},"description":{"type":"string","nullable":true,"example":""},"area":{"type":"string","example":"tool room","nullable":true,"description":"Area of the part. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"unitCost":{"type":"integer","description":"Cost in cents. For example, for $1.20, put 120.","example":120,"nullable":true},"availableQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations. Deprecated: Use `inStockQuantity` instead.","example":10,"deprecated":true},"inStockQuantity":{"type":"integer","description":"Total quantity currently in stock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":10},"minimumQuantity":{"type":"integer","description":"Total minimum quantity before you should restock. If your plan includes multi-location parts, this is the quantity across all part locations.","example":5},"barcode":{"type":"string","nullable":true,"example":"bWFpbnRhaW54Cg==","description":"String encoded barcode"},"locationId":{"type":"integer","nullable":true,"example":852,"description":"ID of the location where the part is located. Deprecated: for Parts with multiple locations, use the new field in `locations`","deprecated":true},"locations":{"type":"array","items":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"integer","example":852,"description":"ID of the location where the part is located"},"availableQuantity":{"type":"integer","description":"Quantity currently in stock","example":10},"minimumQuantity":{"type":"integer","description":"Minimum quantity before you should restock","example":5,"nullable":true},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Maximum quantity you want to stock. Must be greater than or equal to minimumQuantity."},"area":{"type":"string","example":"tool room","nullable":true}}},"description":"Detailed list of locations where the part is stored, including properties such as available quantity, minimum quantity, reserved quantity, and area within each location."},"partTypes":{"type":"array","items":{"type":"string"},"description":"List of part types"},"assetIds":{"type":"array","items":{"type":"integer"},"example":[12,4561],"description":"List of asset IDs"},"teamIds":{"type":"array","items":{"type":"integer"},"example":[1,4],"description":"List of team IDs in charge of the part"},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"000000000"}},"vendors":{"type":"array","description":"List of vendors of the part","items":{"type":"object","properties":{"vendorId":{"type":"integer","example":"1","description":"Id of the vendor"},"partNumber":{"type":"string","example":"XC230","description":"Part number given to the part by this vendor"}}}},"maximumQuantity":{"type":"integer","nullable":true,"example":100,"description":"Total maximum quantity to keep in stock. Null when no part location has a max set."}}}}}}}},"operationId":"PART_DELETE","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"PART_QUANTITY_CHANGE":{"post":{"summary":"Part Quantity Changed","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","partId","orgId","quantityDiff","locations","occurredAt"],"properties":{"eventType":{"type":"string","enum":["PART_QUANTITY_CHANGE"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"PART_QUANTITY_CHANGE"},"partId":{"type":"number","description":"Global ID of the part","example":123456},"partExternalId":{"type":"string","nullable":true,"description":"External ID of the part","example":"ext-part-001"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"quantityDiff":{"type":"number","description":"Number of units added to the part across all locations, negative values represents units removed from the part","example":3},"oldQuantity":{"type":"number","description":"Total number of units on the part across all locations before the transaction (if available)","example":54},"newQuantity":{"type":"number","description":"Total number of units on the part across all locations after the transaction (if available)","example":57},"userId":{"type":"number","description":"Global ID of the user that made a change","example":1337},"triggeredFrom":{"type":"string","description":"Origin of the part quantity change","enum":["PURCHASE_ORDER","WORK_ORDER","MANUAL_RESTOCK","PART_TRANSFER","CYCLE_COUNT"],"example":"PURCHASE_ORDER"},"locations":{"type":"array","description":"List of locations where the part quantity was changed","items":{"type":"object","required":["locationId","quantityDiff"],"properties":{"locationId":{"type":"number","description":"Global ID of the location","example":842},"quantityDiff":{"type":"number","description":"Number of units added to the part in this location, negative values represents units removed from the part","example":3},"oldQuantity":{"type":"number","description":"Total number of units on the part at this location before the transaction (if available)","example":3},"newQuantity":{"type":"number","description":"Total number of units on the part at this location after the transaction (if available)","example":3}}}},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the part quantity was changed","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"PART_QUANTITY_CHANGE","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"PART_TRANSFER":{"post":{"summary":"Part Transfer","security":[],"description":"This webhook is triggered when a part is transferred from one organization to another. Subscriptions can be created for the following scenarios:\n  - When a transfer request is approved\n  - When the transfer is fulfilled\n  - When an approved transfer is canceled\n  - When a part is transferred instantly\n  If you use the \"Part Quantity Change\" webhook, there is a possibility of double accounting.\n  ","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","triggeredFrom","userId","quantity","sourceData","destinationData","triggeredAt"],"properties":{"eventType":{"type":"string","enum":["PART_TRANSFER"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"PART_TRANSFER"},"triggeredFrom":{"type":"string","description":"Origin of the part transfer","enum":["REQUEST_APPROVAL","FULFILLMENT_APPROVAL","FULFILLMENT_CANCELLATION","INSTANT_TRANSFER"],"example":"REQUEST_APPROVAL"},"transferRequestId":{"type":"number","description":"Global ID of the part transfer request","example":123456},"userId":{"type":"number","description":"Global ID of the user that approved the trigger","example":1337},"totalQuantity":{"type":"number","description":"Number of transferred units (across all locations)","example":3},"sourceData":{"type":"object","description":"Properties related to the source organization","required":["partId","orgId"],"properties":{"partId":{"type":"number","description":"Global ID of the part from the source organization","example":123456},"partExternalId":{"type":"string","nullable":true,"description":"External ID of the part from the source organization","example":"ext-part-001"},"partUnitCost":{"type":"number","description":"Unit cost of the part","example":100},"orgId":{"type":"number","description":"Global ID of the organization that is transferring the part","example":321},"locationId":{"type":"number","description":"Global ID of the location that is transferring the part","example":842}}},"destinationData":{"type":"object","description":"Properties related to the destination organization","required":["partId","orgId"],"properties":{"partId":{"type":"number","description":"Global ID of the part from the destination organization","example":123456},"partExternalId":{"type":"string","nullable":true,"description":"External ID of the part from the destination organization","example":"ext-part-001"},"orgId":{"type":"number","description":"Global ID of the organization that is receiving the part","example":321},"locations":{"type":"array","description":"List of locations where the part was transferred","items":{"type":"object","properties":{"locationId":{"type":"number","description":"Global ID of the location that is receiving the part","example":842},"locationQuantity":{"type":"number","description":"Number of units transferred to this location","example":3}}}}}},"triggeredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger was approved","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"PART_TRANSFER","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"PURCHASE_ORDER_CHANGE":{"post":{"summary":"Purchase Order Change","security":[],"description":"The only properties triggering the webhook when changed, are the following:ATTACHMENTS, BILLING_ADDRESS, COSTS, DUE_DATE, EXTRA_FIELDS, ITEMS, NOTE, OVERRIDE_NUMBER, SHIPPING_ADDRESS, STATUS, TITLE, VENDOR, VENDOR_CONTACTS","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","purchaseOrderId","orgId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["PURCHASE_ORDER_CHANGE"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"PURCHASE_ORDER_CHANGE"},"purchaseOrderId":{"type":"number","description":"Global ID of the purchase order","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"},"userId":{"type":"number","description":"Integer ID of the user whose action triggered this webhook. Present whenever a real user triggered the event. Absent for system-initiated events such as automations, scheduled runs, or other actions performed by the system — treat the absence of `userId` as a system-initiated signal.","example":789},"newPurchaseOrder":{"type":"object","description":"Properties of the updated purchase order","properties":{"approvalDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date the Purchase Order was approved","nullable":true},"approverId":{"type":"number","example":135,"description":"ID of the user who approved the Purchase Order","nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the Purchase Order","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"autoGeneratedNumber":{"type":"number","example":987,"nullable":true,"description":"Autogenerated Purchase Order number"},"billingAddress":{"type":"object","description":"Billing address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"creatorId":{"type":"number","example":432,"description":"ID of the user that created this Purchase Order"},"dueDate":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Due date of Purchase Order","nullable":true},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}},"note":{"type":"string","nullable":true,"description":"Notes left for Purchase Orders","example":"Please deliver during business hours"},"overrideNumber":{"type":"string","example":"A123","nullable":true,"description":"Custom number/identifier for Purchase Order"},"reviewNote":{"type":"string","nullable":true,"description":"Notes to be left for changes to be made when sending a Purchase Order for revision","example":"Please adjust quantities and resubmit"},"shippingAddress":{"type":"object","description":"Shipping address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}},"nullable":true},"status":{"type":"string","example":"APPROVED","description":"Status of the Purchase Order. Supported values are APPROVED, CANCELED, COMPLETED, DECLINED, PARTIALLY_FULFILLED, PENDING, REQUESTED","nullable":true},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2022-01-01T00:00:00.000Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"updatedAt":{"type":"string","example":"2022-01-01T00:00:00.000Z","description":"Date the Purchase Order was last updated","nullable":true},"vendorContactIds":{"type":"array","description":"List of vendor contact IDs in the Purchase Order","example":[12,34,56],"items":{"type":"number","example":12}},"vendorId":{"type":"number","example":432,"description":"ID of vendor that this Purchase Order is associated with","nullable":true},"title":{"type":"string","nullable":true,"description":"Title of the Purchase Order.","example":"Office Supplies Order"},"items":{"type":"array","description":"List of items in the Purchase Order","items":{"type":"object","required":["id","quantityOrdered"],"properties":{"id":{"type":"number","example":23,"description":"ID of the item"},"quantityOrdered":{"type":"number","example":4,"description":"Represent the amount of units for this item that were ordered in the purchase order."},"name":{"type":"string","nullable":true},"lineExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}},"partExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"321"}},"partId":{"type":"number","example":43,"description":"ID of the part this item is related to","nullable":true},"partNumber":{"type":"string","nullable":true},"price":{"type":"number","example":25000,"nullable":true,"description":"Total price of items in cents"},"priceDecimal":{"type":"string","example":"250.000000","nullable":true,"description":"Total price of items as a decimal value"},"quantityFulfilled":{"type":"number","description":"Represents the current amount of this item that was fulfilled when the webhook was triggered.","example":3,"nullable":true},"quantityReceived":{"type":"number","example":3,"nullable":true,"description":"Represents the total amount of this specific item that has been received to date."},"fulfillments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","example":23,"description":"ID of the item fulfillment"},"locationId":{"type":"number","example":852,"nullable":true,"description":"ID of the location where the item was fulfilled"},"quantityReceived":{"type":"string","example":"3.000000","description":"Quantity of the item fulfilled to this location"},"isLegacy":{"type":"boolean","description":"Indicates the location is a legacy location. This is used to determine if this fulfillment was done before enablement of the multi-location parts feature.","example":true}}},"description":"Fulfillment information for the item's fulfillment locations."},"unitCost":{"type":"number","example":125000,"nullable":true,"description":"Price of a single item in cents"},"unitCostDecimal":{"type":"string","example":"1250.000000","nullable":true,"description":"Price of a single item as a decimal value"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the Purchase Order item was last updated.","example":"2022-01-01T00:00:00.000Z"},"updaterId":{"type":"integer","nullable":true,"example":851,"description":"ID of the last user who updated the Purchase Order item"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date at which the Purchase Order item was deleted","example":"2022-01-01T00:00:00.000Z"}}}},"costs":{"type":"array","description":"List of costs in the Purchase Order","items":{"type":"object","required":["id","name","type","amount"],"properties":{"id":{"type":"number","example":123,"description":"ID of the cost"},"name":{"type":"string","example":"Sales Tax","description":"Description of the cost"},"type":{"type":"string","enum":["AMOUNT_NON_TAXABLE","AMOUNT_TAXABLE","PERCENT_TAXABLE"],"example":"AMOUNT_TAXABLE","description":"Type of cost in either cents or percent. Accepted types in cents are AMOUNT_TAXABLE and AMOUNT_NON_TAXABLE. For percentage use PERCENT_TAXABLE"},"amount":{"type":"number","example":125000},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the Purchase Order cost was created","example":"2022-01-01T00:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Date & time at which the Purchase Order cost was last updated.","example":"2022-01-01T00:00:00.000Z"},"deletedAt":{"nullable":true,"type":"string","format":"date-time","description":"Date at which the Purchase Order cost was deleted","example":"2022-01-01T00:00:00.000Z"},"creatorId":{"type":"integer","nullable":true,"example":851,"description":"ID of the Purchase Order item creator"},"updaterId":{"type":"integer","nullable":true,"example":851,"description":"ID of the last user who updated the Purchase Order cost"}}}}}}}}}}},"operationId":"PURCHASE_ORDER_CHANGE","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"PURCHASE_ORDER_STATUS_CHANGE":{"post":{"summary":"Purchase Order Status Change","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","purchaseOrderId","orgId","oldStatus","newStatus","occurredAt"],"properties":{"eventType":{"type":"string","enum":["PURCHASE_ORDER_STATUS_CHANGE"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"PURCHASE_ORDER_STATUS_CHANGE"},"purchaseOrderId":{"type":"number","description":"Global ID of the purchase order","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"vendorId":{"type":"number","description":"ID of the vendor","example":321},"oldStatus":{"title":"Status","type":"string","enum":["APPROVED","CANCELED","COMPLETED","DECLINED","PARTIALLY_FULFILLED","PENDING","REQUESTED"],"description":"Previous status of the purchase order"},"newStatus":{"title":"Status","type":"string","enum":["APPROVED","CANCELED","COMPLETED","DECLINED","PARTIALLY_FULFILLED","PENDING","REQUESTED"],"description":"New status of the purchase order"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"},"userId":{"type":"number","description":"Integer ID of the user whose action triggered this webhook. Present whenever a real user triggered the event. Absent for system-initiated events such as automations, scheduled runs, or other actions performed by the system — treat the absence of `userId` as a system-initiated signal.","example":789},"purchaseOrder":{"type":"object","required":["id","items"],"properties":{"id":{"type":"number","example":135,"description":"Global ID of the Purchase Order"},"note":{"type":"string","nullable":true,"description":"Notes left for Purchase Orders"},"reviewNote":{"type":"string","nullable":true,"description":"Notes to be left for changes to be made when sending a Purchase Order for revision"},"status":{"type":"string","example":"APPROVED","enum":["APPROVED","CANCELED","COMPLETED","DECLINED","PARTIALLY_FULFILLED","PENDING","REQUESTED"],"description":"Status of the Purchase Order. Supported values are APPROVED, CANCELED, COMPLETED, DECLINED, PARTIALLY_FULFILLED, PENDING, REQUESTED"},"dueDate":{"type":"string","example":"2020-07-22T14:01:00Z","description":"Due date of Purchase Order","nullable":true},"vendorId":{"type":"number","example":432,"description":"ID of vendor that this Purchase Order is associated with"},"overrideNumber":{"type":"string","example":"A123","nullable":true,"description":"Custom number/identifier for Purchase Order"},"items":{"type":"array","description":"List of items in the Purchase Order","items":{"type":"object","required":["quantityOrdered"],"properties":{"id":{"type":"number","example":23,"description":"ID of the item"},"partId":{"type":"number","example":43,"description":"ID of the part this item is related to","nullable":true},"description":{"type":"string","description":"The description related to the part.","example":"A yellow screwdriver"},"name":{"type":"string","nullable":true},"partNumber":{"type":"string","nullable":true},"price":{"type":"number","example":25000,"description":"Total price of items in cents","nullable":true},"priceDecimal":{"type":"string","example":"250.000000","description":"Total price of items as a decimal value","nullable":true},"quantityOrdered":{"type":"number","example":4},"quantityReceived":{"type":"number","example":3,"nullable":true},"unitCost":{"type":"number","example":125000,"description":"Price of a single item in cents"},"unitCostDecimal":{"type":"string","example":"1250.000000","description":"Price of a single item as a decimal value","nullable":true},"extraFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom Fields on the entity. Deprecated: Use `lineExtraFields` and `partExtraFields` instead as it was previously incorrectly populated with `partExtraFields`.","deprecated":true,"nullable":true},"lineExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Ordered Date\")","additionalProperties":{"type":"string"},"example":{"Ordered Date":"2023-01-01"}},"partExtraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Part Number\")","additionalProperties":{"type":"string"},"example":{"Part Number":"312"}}}}},"costs":{"type":"array","description":"List of costs in the Purchase Order","items":{"type":"object","required":["name","type","amount"],"properties":{"id":{"type":"number","example":123,"description":"ID of the cost"},"name":{"type":"string","example":"Sales Tax","description":"Description of the cost"},"type":{"type":"string","example":"AMOUNT_TAXABLE","enum":["AMOUNT_NON_TAXABLE","AMOUNT_TAXABLE","PERCENT_NON_TAXABLE","PERCENT_TAXABLE"],"description":"Type of cost in either cents or percent. Accepted types in cents are AMOUNT_TAXABLE and AMOUNT_NON_TAXABLE. For percentage use PERCENT_TAXABLE"},"amount":{"type":"number","example":125000}}}},"thumbnail":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2020-05-19T21:08:37Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}},"nullable":true},"attachments":{"type":"array","title":"attachment","description":"List of attachments linked to the Purchase Order","items":{"type":"object","title":"attachment","required":["id","mimeType","fileName","url","createdAt"],"properties":{"id":{"type":"number","description":"Global ID of the attachment","example":12345},"mimeType":{"type":"string","description":"MIME type of the file","example":"image/png"},"fileName":{"type":"string","description":"Attachment's file name","example":"image.png"},"url":{"type":"string","description":"Url of the file. Valid for 60 minutes.","example":"http://example.com/image.png"},"createdAt":{"type":"string","format":"date-time","description":"Date & time at which the attachment was uploaded","example":"2020-05-19T21:08:37Z"},"width":{"type":"number","description":"Width if the file is an image","nullable":true,"example":220},"height":{"type":"number","description":"Height if the file is an image","nullable":true,"example":100}}}},"vendorContactIds":{"type":"array","description":"List of vendor contact IDs in the Purchase Order","items":{"type":"number","example":12}},"shippingAddress":{"type":"object","description":"Shipping address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"id":{"type":"number","example":12,"description":"ID of the address"},"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}}},"billingAddress":{"type":"object","description":"Billing address in the Purchase Order","required":["city","country","postalCode","state","street"],"properties":{"id":{"type":"number","example":12,"description":"ID of the address"},"city":{"type":"string","example":"Montreal"},"country":{"type":"string","example":"Canada"},"postalCode":{"type":"string","example":"H4B 5G0"},"state":{"type":"string","example":"Quebec"},"street":{"type":"string","example":"1909 Avenue des Canadiens-de-Montréal"},"label":{"type":"string","description":"A string to specify how the address will be displayed - Defaults to Street, City, Province/State, Postal Code, Country","example":"1909 Avenue des Canadiens-de-Montréal, Montreal, H4B 5G0, QC, CA ","nullable":true}}},"shippingContactInfo":{"type":"string","example":"555-555-5555","description":"Contact information"},"shippingContactName":{"type":"string","example":"Bruce Billis","description":"Name"}}}}}}}},"operationId":"PURCHASE_ORDER_STATUS_CHANGE","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"ROLE_ARCHIVED":{"post":{"summary":"Role Archived","security":[],"description":"Fires when a custom role is archived.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","roleId","roleName","occurredAt"],"properties":{"eventType":{"type":"string","enum":["ROLE_ARCHIVED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"ROLE_ARCHIVED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"roleId":{"type":"number","description":"ID of the archived role","example":10},"roleName":{"type":"string","description":"Name of the role"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"ROLE_ARCHIVED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"ROLE_CREATED":{"post":{"summary":"Role Created","security":[],"description":"Fires when a custom role is created.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","roleId","roleName","occurredAt"],"properties":{"eventType":{"type":"string","enum":["ROLE_CREATED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"ROLE_CREATED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"roleId":{"type":"number","description":"ID of the created role","example":10},"roleName":{"type":"string","description":"Name of the created role"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"ROLE_CREATED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"ROLE_UPDATED":{"post":{"summary":"Role Updated","security":[],"description":"Fires when a custom role is updated.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","roleId","roleName","occurredAt"],"properties":{"eventType":{"type":"string","enum":["ROLE_UPDATED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"ROLE_UPDATED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"roleId":{"type":"number","description":"ID of the updated role","example":10},"roleName":{"type":"string","description":"Name of the role"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"ROLE_UPDATED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"SSO_CONFIG_CHANGED":{"post":{"summary":"SSO Configuration Changed","security":[],"description":"Fires when an SSO or identity provider configuration is changed.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","configType","occurredAt"],"properties":{"eventType":{"type":"string","enum":["SSO_CONFIG_CHANGED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"SSO_CONFIG_CHANGED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"configType":{"type":"string","enum":["IDP","PREFERRED_IDP","PREFERRED_OIDC","ENFORCE_SSO","ALWAYS_INVITE_SAML","ALWAYS_INVITE_OIDC","IDLE_TIMEOUT"],"description":"The type of SSO configuration that changed"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"SSO_CONFIG_CHANGED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"USER_ACTIVATED":{"post":{"summary":"User Activated","security":[],"description":"Fires when a deactivated user account is reactivated.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","targetUserId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["USER_ACTIVATED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"USER_ACTIVATED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"targetUserId":{"type":"number","description":"User ID of the affected user","example":200},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"USER_ACTIVATED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"USER_INVITED":{"post":{"summary":"User Invited","security":[],"description":"Fires when a user is invited to the organization.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","targetUserId","role","creationMethod","occurredAt"],"properties":{"eventType":{"type":"string","enum":["USER_INVITED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"USER_INVITED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"targetUserId":{"type":"number","description":"User ID of the affected user","example":200},"role":{"type":"string","description":"Role assigned to the invited user"},"creationMethod":{"type":"string","description":"Method used to create the user account"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"USER_INVITED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"USER_LOGIN_FAILURE":{"post":{"summary":"User Login Failure","security":[],"description":"Fires when a login attempt fails.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","method","reason","occurredAt"],"properties":{"eventType":{"type":"string","enum":["USER_LOGIN_FAILURE"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"USER_LOGIN_FAILURE"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"email":{"type":"string","description":"Email address used in the login attempt. May be absent for PHONE logins or SSO/cookie failure paths where the identity cannot be determined.","example":"user@example.com"},"phoneNumber":{"type":"string","description":"Phone number used in the login attempt in E.164 format. Present for PHONE logins.","example":"+14155550100"},"method":{"type":"string","enum":["EMAIL","PHONE","SAML","OIDC","WORKSTATION"],"description":"Authentication method attempted"},"reason":{"type":"string","description":"Reason the login attempt failed"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"},"sourceIp":{"type":"string","description":"IP address of the client","example":"203.0.113.42"},"countryName":{"type":"string","description":"Country derived from the client IP via CloudFront","example":"United States"},"regionName":{"type":"string","description":"Region/state derived from the client IP via CloudFront","example":"California"},"cityName":{"type":"string","description":"City derived from the client IP via CloudFront","example":"San Francisco"}}}}}},"operationId":"USER_LOGIN_FAILURE","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"USER_LOGIN_SUCCESS":{"post":{"summary":"User Login Success","security":[],"description":"Fires when a user successfully logs in.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","userId","method","occurredAt"],"properties":{"eventType":{"type":"string","enum":["USER_LOGIN_SUCCESS"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"USER_LOGIN_SUCCESS"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"userId":{"type":"number","description":"User ID of the user who logged in","example":200},"email":{"type":"string","description":"Email address of the user. Present for EMAIL, SAML, and OIDC logins.","example":"user@example.com"},"phoneNumber":{"type":"string","description":"Phone number of the user in E.164 format. Present for PHONE logins.","example":"+14155550100"},"method":{"type":"string","enum":["EMAIL","PHONE","SAML","OIDC","WORKSTATION"],"description":"Authentication method used"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"},"sourceIp":{"type":"string","description":"IP address of the client","example":"203.0.113.42"},"countryName":{"type":"string","description":"Country derived from the client IP via CloudFront","example":"United States"},"regionName":{"type":"string","description":"Region/state derived from the client IP via CloudFront","example":"California"},"cityName":{"type":"string","description":"City derived from the client IP via CloudFront","example":"San Francisco"}}}}}},"operationId":"USER_LOGIN_SUCCESS","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"USER_LOGOUT":{"post":{"summary":"User Logout","security":[],"description":"Fires when a user logs out.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","userId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["USER_LOGOUT"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"USER_LOGOUT"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"userId":{"type":"number","description":"User ID of the user who logged out","example":200},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"},"sourceIp":{"type":"string","description":"IP address of the client","example":"203.0.113.42"},"countryName":{"type":"string","description":"Country derived from the client IP via CloudFront","example":"United States"},"regionName":{"type":"string","description":"Region/state derived from the client IP via CloudFront","example":"California"},"cityName":{"type":"string","description":"City derived from the client IP via CloudFront","example":"San Francisco"}}}}}},"operationId":"USER_LOGOUT","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"USER_PERMISSIONS_CHANGED":{"post":{"summary":"User Permissions Changed","security":[],"description":"Fires when custom permissions are changed for a user.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","targetUserId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["USER_PERMISSIONS_CHANGED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"USER_PERMISSIONS_CHANGED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"targetUserId":{"type":"number","description":"User ID of the affected user","example":200},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"USER_PERMISSIONS_CHANGED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"USER_REMOVED":{"post":{"summary":"User Removed","security":[],"description":"Fires when a user is removed from the organization.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","targetUserId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["USER_REMOVED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"USER_REMOVED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"targetUserId":{"type":"number","description":"User ID of the affected user","example":200},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"USER_REMOVED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"USER_ROLE_CHANGED":{"post":{"summary":"User Role Changed","security":[],"description":"Fires when the role of a user is changed.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","targetUserId","oldRole","newRole","occurredAt"],"properties":{"eventType":{"type":"string","enum":["USER_ROLE_CHANGED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"USER_ROLE_CHANGED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"targetUserId":{"type":"number","description":"User ID of the affected user","example":200},"oldRole":{"type":"string","description":"Previous role of the user"},"newRole":{"type":"string","description":"New role of the user"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"USER_ROLE_CHANGED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"USER_SESSION_REVOKED":{"post":{"summary":"User Session Revoked","security":[],"description":"Fires when an active session is revoked for a user.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","targetUserId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["USER_SESSION_REVOKED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"USER_SESSION_REVOKED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"targetUserId":{"type":"number","description":"User ID of the affected user","example":200},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"USER_SESSION_REVOKED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"WEBHOOK_ARCHIVED":{"post":{"summary":"Webhook Archived","security":[],"description":"Fires when a webhook subscription is archived.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","webhookId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["WEBHOOK_ARCHIVED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"WEBHOOK_ARCHIVED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"webhookId":{"type":"number","description":"ID of the archived webhook","example":999},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"WEBHOOK_ARCHIVED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"WEBHOOK_CREATED":{"post":{"summary":"Webhook Created","security":[],"description":"Fires when a new webhook subscription is created.","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","orgId","actorId","webhookId","webhookType","url","occurredAt"],"properties":{"eventType":{"type":"string","enum":["WEBHOOK_CREATED"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"WEBHOOK_CREATED"},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"actorId":{"type":"number","description":"User ID of the actor who triggered the event","example":100},"webhookId":{"type":"number","description":"ID of the created webhook","example":999},"webhookType":{"type":"string","description":"Type of the created webhook"},"url":{"type":"string","description":"Endpoint URL of the created webhook"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the event occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"WEBHOOK_CREATED","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"WORK_ORDER_CHANGE":{"post":{"summary":"Work Order Change","security":[],"description":"The only properties triggering the webhook when changed, are the following: ASSET, ASSIGNEES, CATEGORIES, COSTS, CUSTOMER, DESCRIPTION, DUE_DATE, ESTIMATED_TIME, EXTRA_FIELDS, LOCATION, PARTS, PRIORITY, START_DATE, TEAMS, TITLE, VENDORS","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","workOrderId","orgId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["WORK_ORDER_CHANGE"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"WORK_ORDER_CHANGE"},"workOrderId":{"type":"number","description":"Global ID of the work order","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"customerId":{"type":"number","nullable":true,"description":"Global ID of the customer linked to the work order. Null when none.","example":456},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"},"userId":{"type":"number","description":"Integer ID of the user whose action triggered this webhook. Present whenever a real user triggered the event. Absent for system-initiated events such as automations, scheduled runs, or other actions performed by the system — treat the absence of `userId` as a system-initiated signal.","example":789},"newWorkOrder":{"type":"object","description":"Properties of the updated work order","properties":{"assetId":{"nullable":true,"type":"integer","example":42},"assigneeIds":{"type":"array","description":"List of user ids assigned to the work order","items":{"type":"integer","example":31}},"categories":{"type":"array","description":"Newly added categories on the work order","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"number","description":"Global ID of the category","example":123},"name":{"type":"string","description":"Label of the category","example":"Safety"},"description":{"type":"string","example":"Used for everything related to Safety","description":"Description field for additional information."}}}},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order is due","example":"2022-01-01T00:00:00.000Z"},"estimatedTime":{"type":"integer","nullable":true,"description":"The estimated time taken in seconds to complete the work order","example":3600},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Third Party Id\")","additionalProperties":{"type":"string"},"example":{"Third Party Id":"aa674f49-dac6-4f15-9fdd-061d2b5caf30"}},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order","example":611},"parts":{"type":"array","description":"Parts attached to the Work Order","items":{"type":"object","required":["id","quantityUsed","copyOnRecurring"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the part"},"quantityUsed":{"type":"integer","description":"Quantity used in the work order.","example":2},"unitCost":{"nullable":true,"type":"integer","description":"Cost in cents. For example, for $1.20, put 120","example":120},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location of the part.","example":852},"copyOnRecurring":{"type":"string","description":"Indicates if the parts will be copied to the next work order in the chain (if applicable).","default":"Default","enum":["NoCopy","Copy","Default"]}}}},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"startDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set","example":"2022-01-01T00:00:00.000Z"},"teamIds":{"type":"array","description":"List of team ids assigned to the work order","items":{"type":"integer","example":12}},"title":{"type":"string"},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}},"costs":{"type":"object","required":["total","rows"],"properties":{"total":{"description":"Total cost in cents of the Work order","type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Type of the entry","enum":["EXPENSE","PART","TIME"]},"costPerUnit":{"type":"number","nullable":true,"description":"Cost per part in cents or cents per hour"},"description":{"type":"string","nullable":true,"description":"Description of the expense or part description "},"quantity":{"type":"number","description":"Number of parts or number of hours"},"rowTotal":{"type":"number","description":"Total cost in cents"},"durationTotal":{"type":"number","description":"Total duration in seconds"},"userId":{"type":"integer","nullable":true,"description":"ID of the user who logged the time entry"},"partId":{"type":"integer","nullable":true,"description":"ID of the part used in this cost entry"}}}}}},"customerId":{"type":"number","nullable":true,"description":"Global ID of the customer linked to the work order. Null when none.","example":456}}},"addedAssigneeIds":{"type":"array","description":"User IDs that were added as assignees in this change (only present when assignees changed)","items":{"type":"integer"}},"removedAssigneeIds":{"type":"array","description":"User IDs that were removed as assignees in this change (only present when assignees changed)","items":{"type":"integer"}},"addedTeamIds":{"type":"array","description":"Team IDs that were added in this change (only present when teams changed)","items":{"type":"integer"}},"removedTeamIds":{"type":"array","description":"Team IDs that were removed in this change (only present when teams changed)","items":{"type":"integer"}}}}}}},"operationId":"WORK_ORDER_CHANGE","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"WORK_ORDER_DELETE":{"post":{"summary":"Work Order Delete","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","workOrderId","orgId","occurredAt"],"properties":{"eventType":{"type":"string","enum":["WORK_ORDER_DELETE"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"WORK_ORDER_DELETE"},"workOrderId":{"type":"number","description":"Global ID of the work order","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the work was deleted","example":"2022-01-01T00:00:00.000Z"},"userId":{"type":"number","description":"Integer ID of the user whose action triggered this webhook. Present whenever a real user triggered the event. Absent for system-initiated events such as automations, scheduled runs, or other actions performed by the system — treat the absence of `userId` as a system-initiated signal.","example":789},"WorkOrder":{"type":"object","description":"Properties of the updated work order","properties":{"assetId":{"nullable":true,"type":"integer","example":42},"assigneeIds":{"type":"array","description":"List of user ids assigned to the work order","items":{"type":"integer","example":31}},"categories":{"type":"array","description":"Newly added categories on the work order","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"number","description":"Global ID of the category","example":123},"name":{"type":"string","description":"Label of the category","example":"Safety"},"description":{"type":"string","example":"Used for everything related to Safety","description":"Description field for additional information."}}}},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order is due","example":"2022-01-01T00:00:00.000Z"},"estimatedTime":{"type":"integer","nullable":true,"description":"The estimated time taken in seconds to complete the work order","example":3600},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Third Party Id\")","additionalProperties":{"type":"string"},"example":{"Third Party Id":"aa674f49-dac6-4f15-9fdd-061d2b5caf30"}},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order","example":611},"parts":{"type":"array","description":"Parts attached to the Work Order","items":{"type":"object","required":["id","quantityUsed","copyOnRecurring"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the part"},"quantityUsed":{"type":"integer","description":"Quantity used in the work order.","example":2},"unitCost":{"nullable":true,"type":"integer","description":"Cost in cents. For example, for $1.20, put 120","example":120},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location of the part.","example":852},"copyOnRecurring":{"type":"string","description":"Indicates if the parts will be copied to the next work order in the chain (if applicable).","default":"Default","enum":["NoCopy","Copy","Default"]}}}},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"startDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set","example":"2022-01-01T00:00:00.000Z"},"teamIds":{"type":"array","description":"List of team ids assigned to the work order","items":{"type":"integer","example":12}},"title":{"type":"string"},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}}}}}}}}},"operationId":"WORK_ORDER_DELETE","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"WORK_ORDER_OVERDUE":{"post":{"summary":"Work Order Overdue","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","workOrderId","orgId","dueDate","occurredAt"],"properties":{"eventType":{"type":"string","enum":["WORK_ORDER_OVERDUE"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"WORK_ORDER_OVERDUE"},"workOrderId":{"type":"number","description":"Global ID of the work order","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"dueDate":{"type":"string","format":"date-time","description":"Date & time at which the work order was due","example":"2022-01-01T00:00:00.000Z"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the work order became overdue","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"WORK_ORDER_OVERDUE","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"WORK_ORDER_PART_STATUS_CHANGE":{"post":{"summary":"Work Order Part Status Change","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","workOrderId","orgId","occurredAt","oldPartStatus","newPartStatus"],"properties":{"eventType":{"type":"string","enum":["WORK_ORDER_PART_STATUS_CHANGE"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"WORK_ORDER_PART_STATUS_CHANGE"},"workOrderId":{"type":"number","description":"Global ID of the work order","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"oldPartStatus":{"title":"Part Status","type":"string","enum":["NO_PARTS","ASSIGNED","RESERVED","KITTED","STAGED","ISSUED"],"description":"Previous part status of the work order","example":"ASSIGNED"},"newPartStatus":{"title":"Part Status","type":"string","enum":["NO_PARTS","ASSIGNED","RESERVED","KITTED","STAGED","ISSUED"],"description":"New part status of the work order","example":"ISSUED"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"},"newWorkOrder":{"type":"object","description":"Properties of the updated work order","properties":{"assetId":{"nullable":true,"type":"integer","example":42},"assigneeIds":{"type":"array","description":"List of user ids assigned to the work order","items":{"type":"integer","example":31}},"categories":{"type":"array","description":"Newly added categories on the work order","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"number","description":"Global ID of the category","example":123},"name":{"type":"string","description":"Label of the category","example":"Safety"},"description":{"type":"string","example":"Used for everything related to Safety","description":"Description field for additional information."}}}},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order is due","example":"2022-01-01T00:00:00.000Z"},"estimatedTime":{"type":"integer","nullable":true,"description":"The estimated time taken in seconds to complete the work order","example":3600},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Third Party Id\")","additionalProperties":{"type":"string"},"example":{"Third Party Id":"aa674f49-dac6-4f15-9fdd-061d2b5caf30"}},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order","example":611},"parts":{"type":"array","description":"Parts attached to the Work Order","items":{"type":"object","required":["id","quantityUsed","copyOnRecurring"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the part"},"quantityUsed":{"type":"integer","description":"Quantity used in the work order.","example":2},"unitCost":{"nullable":true,"type":"integer","description":"Cost in cents. For example, for $1.20, put 120","example":120},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location of the part.","example":852},"copyOnRecurring":{"type":"string","description":"Indicates if the parts will be copied to the next work order in the chain (if applicable).","default":"Default","enum":["NoCopy","Copy","Default"]}}}},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"startDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set","example":"2022-01-01T00:00:00.000Z"},"teamIds":{"type":"array","description":"List of team ids assigned to the work order","items":{"type":"integer","example":12}},"title":{"type":"string"},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}}}}}}}}},"operationId":"WORK_ORDER_PART_STATUS_CHANGE","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"WORK_ORDER_STATUS_CHANGE":{"post":{"summary":"Work Order Status Change","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","workOrderId","orgId","occurredAt","oldStatus","newStatus"],"properties":{"eventType":{"type":"string","enum":["WORK_ORDER_STATUS_CHANGE"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"WORK_ORDER_STATUS_CHANGE"},"workOrderId":{"type":"number","description":"Global ID of the work order","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"customerId":{"type":"number","nullable":true,"description":"Global ID of the customer linked to the work order. Null when none.","example":456},"oldStatus":{"title":"Status","type":"string","enum":["OPEN","IN_PROGRESS","ON_HOLD","DONE"],"description":"Previous status of the work order"},"oldSubStatus":{"title":"Status","type":"string","enum":["CANCELED","SKIPPED"],"description":"Previous sub status of the work order"},"newStatus":{"title":"Status","type":"string","enum":["OPEN","IN_PROGRESS","ON_HOLD","DONE"],"description":"New status of the work order"},"newSubStatus":{"title":"Status","type":"string","enum":["CANCELED","SKIPPED"],"description":"New sub status of the work order"},"progress":{"type":"object","required":["doneCount","inProgressCount","onHoldCount"],"properties":{"inProgressCount":{"type":"number","description":"Number of times the work order status was set to progress","example":2},"onHoldCount":{"type":"number","description":"Number of times the work order was put on hold","example":1},"doneCount":{"type":"number","description":"Number of times the work order status was set to Done","example":0}}},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"},"userId":{"type":"number","description":"Integer ID of the user whose action triggered this webhook. Present whenever a real user triggered the event. Absent for system-initiated events such as automations, scheduled runs, or other actions performed by the system — treat the absence of `userId` as a system-initiated signal.","example":789},"newWorkOrder":{"type":"object","description":"Properties of the updated work order","properties":{"assetId":{"nullable":true,"type":"integer","example":42},"assigneeIds":{"type":"array","description":"List of user ids assigned to the work order","items":{"type":"integer","example":31}},"categories":{"type":"array","description":"Newly added categories on the work order","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"number","description":"Global ID of the category","example":123},"name":{"type":"string","description":"Label of the category","example":"Safety"},"description":{"type":"string","example":"Used for everything related to Safety","description":"Description field for additional information."}}}},"description":{"nullable":true,"type":"string","example":"A work order sample description"},"dueDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order is due","example":"2022-01-01T00:00:00.000Z"},"estimatedTime":{"type":"integer","nullable":true,"description":"The estimated time taken in seconds to complete the work order","example":3600},"extraFields":{"type":"object","description":"Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: \"Third Party Id\")","additionalProperties":{"type":"string"},"example":{"Third Party Id":"aa674f49-dac6-4f15-9fdd-061d2b5caf30"}},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location assigned to the work order","example":611},"parts":{"type":"array","description":"Parts attached to the Work Order","items":{"type":"object","required":["id","quantityUsed","copyOnRecurring"],"properties":{"id":{"type":"integer","example":963,"description":"Global ID of the part"},"quantityUsed":{"type":"integer","description":"Quantity used in the work order.","example":2},"unitCost":{"nullable":true,"type":"integer","description":"Cost in cents. For example, for $1.20, put 120","example":120},"locationId":{"nullable":true,"type":"integer","description":"Global ID of the location of the part.","example":852},"copyOnRecurring":{"type":"string","description":"Indicates if the parts will be copied to the next work order in the chain (if applicable).","default":"Default","enum":["NoCopy","Copy","Default"]}}}},"priority":{"type":"string","example":"MEDIUM","enum":["NONE","LOW","MEDIUM","HIGH"]},"startDate":{"type":"string","format":"date-time","nullable":true,"description":"Date & time at which the work order will show up in the inbox</br>Only valid when <b>dueDate</b> is set","example":"2022-01-01T00:00:00.000Z"},"teamIds":{"type":"array","description":"List of team ids assigned to the work order","items":{"type":"integer","example":12}},"title":{"type":"string"},"vendorIds":{"type":"array","description":"Vendor IDs","items":{"type":"number","example":1}}}}}}}}},"operationId":"WORK_ORDER_STATUS_CHANGE","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}},"WORK_REQUEST_STATUS_CHANGE":{"post":{"summary":"Work Request Status Change","security":[],"description":"","tags":["Subscriptions & Webhooks"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["eventType","requestId","orgId","occurredAt","oldStatus","newStatus"],"properties":{"eventType":{"type":"string","enum":["WORK_REQUEST_STATUS_CHANGE"],"description":"Discriminates which event produced this payload. Matches the webhook subscription's type.","example":"WORK_REQUEST_STATUS_CHANGE"},"requestId":{"type":"number","description":"Global ID of the work request","example":123456},"orgId":{"type":"number","description":"Global ID of the organization","example":321},"oldStatus":{"title":"Status","type":"string","enum":["APPROVED","DONE","REJECTED","PENDING"],"description":"Previous status of the work request"},"newStatus":{"title":"Status","type":"string","enum":["APPROVED","DONE","REJECTED"],"description":"New status of the work request"},"occurredAt":{"type":"string","format":"date-time","description":"Date & time at which the trigger occurred","example":"2022-01-01T00:00:00.000Z"}}}}}},"operationId":"WORK_REQUEST_STATUS_CHANGE","responses":{"200":{"description":"Return a 200 status to indicate that the data was received successfully"}}}}}}