Work management
Update a work order
Update an existing work order
PATCH
/
work-orders
/
{id}
Update a work order
curl --request PATCH \
--url https://api.oncanary.com/v1/work-orders/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"requested_by": "<string>",
"assigned_to_user_id": "<string>",
"assigned_to_team_id": "<string>",
"asset_id": "<string>",
"location_id": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"scheduled_start": "2023-11-07T05:31:56Z",
"estimated_hours": 4999.995,
"completion_summary": "<string>",
"extraFields": {}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
requested_by: '<string>',
assigned_to_user_id: '<string>',
assigned_to_team_id: '<string>',
asset_id: '<string>',
location_id: '<string>',
due_date: '2023-11-07T05:31:56Z',
scheduled_start: '2023-11-07T05:31:56Z',
estimated_hours: 4999.995,
completion_summary: '<string>',
extraFields: {}
})
};
fetch('https://api.oncanary.com/v1/work-orders/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.oncanary.com/v1/work-orders/{id}"
payload = {
"title": "<string>",
"description": "<string>",
"requested_by": "<string>",
"assigned_to_user_id": "<string>",
"assigned_to_team_id": "<string>",
"asset_id": "<string>",
"location_id": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"scheduled_start": "2023-11-07T05:31:56Z",
"estimated_hours": 4999.995,
"completion_summary": "<string>",
"extraFields": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "<string>",
"title": "<string>",
"description": "<string>",
"type": "preventive",
"status": "open",
"priority": "low",
"requested_by": "<string>",
"creator_id": "<string>",
"assigned_to_user_id": "<string>",
"assigned_to_team_id": "<string>",
"asset_id": "<string>",
"location_id": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"scheduled_start": "2023-11-07T05:31:56Z",
"estimated_hours": 4999.995,
"recurrence_info": {
"type": "DAILY",
"interval": 1,
"days": [
"SUNDAY"
],
"day": 16
},
"previous_id": "<string>",
"next_id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"completer_id": "<string>",
"completion_summary": "<string>",
"inventory_reconciliation_required": true,
"image_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"extraFields": {}
},
"meta": {
"request_id": "<string>",
"api_version": "<string>"
}
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}Authorizations
Organization API key with an sk_live_ or sk_test_ prefix
Path Parameters
Resource ID
Body
application/json
Maximum string length:
255Maximum string length:
5000Available options:
preventive, reactive, other, cycle_count Available options:
open, on_hold, in_progress, done, canceled, skipped Available options:
low, medium, high, critical Maximum string length:
255Required range:
0 <= x <= 9999.99Maximum string length:
5000Label-keyed custom-field values. Omitted labels remain unchanged on update.
Show child attributes
Show child attributes
⌘I
Update a work order
curl --request PATCH \
--url https://api.oncanary.com/v1/work-orders/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"requested_by": "<string>",
"assigned_to_user_id": "<string>",
"assigned_to_team_id": "<string>",
"asset_id": "<string>",
"location_id": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"scheduled_start": "2023-11-07T05:31:56Z",
"estimated_hours": 4999.995,
"completion_summary": "<string>",
"extraFields": {}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
requested_by: '<string>',
assigned_to_user_id: '<string>',
assigned_to_team_id: '<string>',
asset_id: '<string>',
location_id: '<string>',
due_date: '2023-11-07T05:31:56Z',
scheduled_start: '2023-11-07T05:31:56Z',
estimated_hours: 4999.995,
completion_summary: '<string>',
extraFields: {}
})
};
fetch('https://api.oncanary.com/v1/work-orders/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.oncanary.com/v1/work-orders/{id}"
payload = {
"title": "<string>",
"description": "<string>",
"requested_by": "<string>",
"assigned_to_user_id": "<string>",
"assigned_to_team_id": "<string>",
"asset_id": "<string>",
"location_id": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"scheduled_start": "2023-11-07T05:31:56Z",
"estimated_hours": 4999.995,
"completion_summary": "<string>",
"extraFields": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "<string>",
"title": "<string>",
"description": "<string>",
"type": "preventive",
"status": "open",
"priority": "low",
"requested_by": "<string>",
"creator_id": "<string>",
"assigned_to_user_id": "<string>",
"assigned_to_team_id": "<string>",
"asset_id": "<string>",
"location_id": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"scheduled_start": "2023-11-07T05:31:56Z",
"estimated_hours": 4999.995,
"recurrence_info": {
"type": "DAILY",
"interval": 1,
"days": [
"SUNDAY"
],
"day": 16
},
"previous_id": "<string>",
"next_id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"completer_id": "<string>",
"completion_summary": "<string>",
"inventory_reconciliation_required": true,
"image_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"extraFields": {}
},
"meta": {
"request_id": "<string>",
"api_version": "<string>"
}
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}{
"type": "https://api.oncanary.com/errors/validation_error",
"title": "Validation Error",
"status": 400,
"detail": "Request validation failed",
"request_id": "req_01JAY8FVDM6CH4R3X9Q2T7K5NP",
"code": "validation_error"
}