Update Work Order
curl --request PATCH \
--url https://api.serial.io/work-order/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "KS1 Drone - CalFire Order",
"description": "Urgent order for upcoming summer fire season",
"component_id": "41afafe5-2a48-424a-baef-34c2ad44ef7b",
"part_number_id": "7dec118a-512b-42ec-bf53-7cec3d14d5c7",
"phase": "string",
"quantity": 10,
"assignee_user_id": "e942d24d-8cee-4fa2-bf68-164509e32e2f",
"deadline": "2019-08-24T14:15:22Z",
"updated_by_user_id": "1b287364-14ff-4b72-8953-b40399093a6f"
}
'import requests
url = "https://api.serial.io/work-order/{id}"
payload = {
"name": "KS1 Drone - CalFire Order",
"description": "Urgent order for upcoming summer fire season",
"component_id": "41afafe5-2a48-424a-baef-34c2ad44ef7b",
"part_number_id": "7dec118a-512b-42ec-bf53-7cec3d14d5c7",
"phase": "string",
"quantity": 10,
"assignee_user_id": "e942d24d-8cee-4fa2-bf68-164509e32e2f",
"deadline": "2019-08-24T14:15:22Z",
"updated_by_user_id": "1b287364-14ff-4b72-8953-b40399093a6f"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'KS1 Drone - CalFire Order',
description: 'Urgent order for upcoming summer fire season',
component_id: '41afafe5-2a48-424a-baef-34c2ad44ef7b',
part_number_id: '7dec118a-512b-42ec-bf53-7cec3d14d5c7',
phase: 'string',
quantity: 10,
assignee_user_id: 'e942d24d-8cee-4fa2-bf68-164509e32e2f',
deadline: '2019-08-24T14:15:22Z',
updated_by_user_id: '1b287364-14ff-4b72-8953-b40399093a6f'
})
};
fetch('https://api.serial.io/work-order/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.serial.io/work-order/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'KS1 Drone - CalFire Order',
'description' => 'Urgent order for upcoming summer fire season',
'component_id' => '41afafe5-2a48-424a-baef-34c2ad44ef7b',
'part_number_id' => '7dec118a-512b-42ec-bf53-7cec3d14d5c7',
'phase' => 'string',
'quantity' => 10,
'assignee_user_id' => 'e942d24d-8cee-4fa2-bf68-164509e32e2f',
'deadline' => '2019-08-24T14:15:22Z',
'updated_by_user_id' => '1b287364-14ff-4b72-8953-b40399093a6f'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.serial.io/work-order/{id}"
payload := strings.NewReader("{\n \"name\": \"KS1 Drone - CalFire Order\",\n \"description\": \"Urgent order for upcoming summer fire season\",\n \"component_id\": \"41afafe5-2a48-424a-baef-34c2ad44ef7b\",\n \"part_number_id\": \"7dec118a-512b-42ec-bf53-7cec3d14d5c7\",\n \"phase\": \"string\",\n \"quantity\": 10,\n \"assignee_user_id\": \"e942d24d-8cee-4fa2-bf68-164509e32e2f\",\n \"deadline\": \"2019-08-24T14:15:22Z\",\n \"updated_by_user_id\": \"1b287364-14ff-4b72-8953-b40399093a6f\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.serial.io/work-order/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"KS1 Drone - CalFire Order\",\n \"description\": \"Urgent order for upcoming summer fire season\",\n \"component_id\": \"41afafe5-2a48-424a-baef-34c2ad44ef7b\",\n \"part_number_id\": \"7dec118a-512b-42ec-bf53-7cec3d14d5c7\",\n \"phase\": \"string\",\n \"quantity\": 10,\n \"assignee_user_id\": \"e942d24d-8cee-4fa2-bf68-164509e32e2f\",\n \"deadline\": \"2019-08-24T14:15:22Z\",\n \"updated_by_user_id\": \"1b287364-14ff-4b72-8953-b40399093a6f\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.serial.io/work-order/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"KS1 Drone - CalFire Order\",\n \"description\": \"Urgent order for upcoming summer fire season\",\n \"component_id\": \"41afafe5-2a48-424a-baef-34c2ad44ef7b\",\n \"part_number_id\": \"7dec118a-512b-42ec-bf53-7cec3d14d5c7\",\n \"phase\": \"string\",\n \"quantity\": 10,\n \"assignee_user_id\": \"e942d24d-8cee-4fa2-bf68-164509e32e2f\",\n \"deadline\": \"2019-08-24T14:15:22Z\",\n \"updated_by_user_id\": \"1b287364-14ff-4b72-8953-b40399093a6f\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"wo_number": 1,
"name": "<string>",
"description": "<string>",
"component_id": "<string>",
"part_number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "DRAFT",
"phase": "<string>",
"quantity": 123,
"approvals": {
"[approver_user_id]": {
"approver_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requested_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requested_at": "2023-11-07T05:31:56Z",
"status": "APPROVED",
"last_updated_at": "2023-11-07T05:31:56Z"
}
},
"assignee_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deadline": "2023-11-07T05:31:56Z",
"activity_log": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "<string>",
"added_at": "2023-11-07T05:31:56Z",
"added_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "CREATED",
"data": "<string>"
}
],
"last_edited_at": "2023-11-07T05:31:56Z",
"attachments": [
{
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"file_name": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"added_at": "2023-11-07T05:31:56Z",
"added_by_user_id": "<string>",
"is_deleted": true
}
]
}Work Orders
Update Work Order
Update a work order’s details and configuration. Work order must be in the DRAFT state
PATCH
/
work-order
/
{id}
Update Work Order
curl --request PATCH \
--url https://api.serial.io/work-order/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "KS1 Drone - CalFire Order",
"description": "Urgent order for upcoming summer fire season",
"component_id": "41afafe5-2a48-424a-baef-34c2ad44ef7b",
"part_number_id": "7dec118a-512b-42ec-bf53-7cec3d14d5c7",
"phase": "string",
"quantity": 10,
"assignee_user_id": "e942d24d-8cee-4fa2-bf68-164509e32e2f",
"deadline": "2019-08-24T14:15:22Z",
"updated_by_user_id": "1b287364-14ff-4b72-8953-b40399093a6f"
}
'import requests
url = "https://api.serial.io/work-order/{id}"
payload = {
"name": "KS1 Drone - CalFire Order",
"description": "Urgent order for upcoming summer fire season",
"component_id": "41afafe5-2a48-424a-baef-34c2ad44ef7b",
"part_number_id": "7dec118a-512b-42ec-bf53-7cec3d14d5c7",
"phase": "string",
"quantity": 10,
"assignee_user_id": "e942d24d-8cee-4fa2-bf68-164509e32e2f",
"deadline": "2019-08-24T14:15:22Z",
"updated_by_user_id": "1b287364-14ff-4b72-8953-b40399093a6f"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'KS1 Drone - CalFire Order',
description: 'Urgent order for upcoming summer fire season',
component_id: '41afafe5-2a48-424a-baef-34c2ad44ef7b',
part_number_id: '7dec118a-512b-42ec-bf53-7cec3d14d5c7',
phase: 'string',
quantity: 10,
assignee_user_id: 'e942d24d-8cee-4fa2-bf68-164509e32e2f',
deadline: '2019-08-24T14:15:22Z',
updated_by_user_id: '1b287364-14ff-4b72-8953-b40399093a6f'
})
};
fetch('https://api.serial.io/work-order/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.serial.io/work-order/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'KS1 Drone - CalFire Order',
'description' => 'Urgent order for upcoming summer fire season',
'component_id' => '41afafe5-2a48-424a-baef-34c2ad44ef7b',
'part_number_id' => '7dec118a-512b-42ec-bf53-7cec3d14d5c7',
'phase' => 'string',
'quantity' => 10,
'assignee_user_id' => 'e942d24d-8cee-4fa2-bf68-164509e32e2f',
'deadline' => '2019-08-24T14:15:22Z',
'updated_by_user_id' => '1b287364-14ff-4b72-8953-b40399093a6f'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.serial.io/work-order/{id}"
payload := strings.NewReader("{\n \"name\": \"KS1 Drone - CalFire Order\",\n \"description\": \"Urgent order for upcoming summer fire season\",\n \"component_id\": \"41afafe5-2a48-424a-baef-34c2ad44ef7b\",\n \"part_number_id\": \"7dec118a-512b-42ec-bf53-7cec3d14d5c7\",\n \"phase\": \"string\",\n \"quantity\": 10,\n \"assignee_user_id\": \"e942d24d-8cee-4fa2-bf68-164509e32e2f\",\n \"deadline\": \"2019-08-24T14:15:22Z\",\n \"updated_by_user_id\": \"1b287364-14ff-4b72-8953-b40399093a6f\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.serial.io/work-order/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"KS1 Drone - CalFire Order\",\n \"description\": \"Urgent order for upcoming summer fire season\",\n \"component_id\": \"41afafe5-2a48-424a-baef-34c2ad44ef7b\",\n \"part_number_id\": \"7dec118a-512b-42ec-bf53-7cec3d14d5c7\",\n \"phase\": \"string\",\n \"quantity\": 10,\n \"assignee_user_id\": \"e942d24d-8cee-4fa2-bf68-164509e32e2f\",\n \"deadline\": \"2019-08-24T14:15:22Z\",\n \"updated_by_user_id\": \"1b287364-14ff-4b72-8953-b40399093a6f\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.serial.io/work-order/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"KS1 Drone - CalFire Order\",\n \"description\": \"Urgent order for upcoming summer fire season\",\n \"component_id\": \"41afafe5-2a48-424a-baef-34c2ad44ef7b\",\n \"part_number_id\": \"7dec118a-512b-42ec-bf53-7cec3d14d5c7\",\n \"phase\": \"string\",\n \"quantity\": 10,\n \"assignee_user_id\": \"e942d24d-8cee-4fa2-bf68-164509e32e2f\",\n \"deadline\": \"2019-08-24T14:15:22Z\",\n \"updated_by_user_id\": \"1b287364-14ff-4b72-8953-b40399093a6f\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"wo_number": 1,
"name": "<string>",
"description": "<string>",
"component_id": "<string>",
"part_number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "DRAFT",
"phase": "<string>",
"quantity": 123,
"approvals": {
"[approver_user_id]": {
"approver_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requested_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requested_at": "2023-11-07T05:31:56Z",
"status": "APPROVED",
"last_updated_at": "2023-11-07T05:31:56Z"
}
},
"assignee_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deadline": "2023-11-07T05:31:56Z",
"activity_log": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "<string>",
"added_at": "2023-11-07T05:31:56Z",
"added_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "CREATED",
"data": "<string>"
}
],
"last_edited_at": "2023-11-07T05:31:56Z",
"attachments": [
{
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"file_name": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"added_at": "2023-11-07T05:31:56Z",
"added_by_user_id": "<string>",
"is_deleted": true
}
]
}Authorizations
Path Parameters
Body
application/json
Request body for creating or updating a work order
Response
200 - application/json
OK
Work Order Data

