> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itspropel.com/llms.txt.
> For full documentation content, see https://docs.itspropel.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itspropel.com/_mcp/server.

# Update Work Order

PATCH https://work-orders/%7Bwork_order_id%7D
Content-Type: multipart/form-data

Update an existing work order. This endpoint now handles both general field updates AND status changes.

**Required Permission:** `update_work_orders`

All fields are optional. Only send the fields you want to update.

## Status Changes
You can now update the work order status through this endpoint by providing the `status` field along with any other fields you want to update.

### Status-Related Fields
- `status` - Enum: draft, pending_approval, approved, scheduled, dispatched, en_route, arrived, in_progress, on_hold, completed, cancelled, rescheduled, requires_parts, requires_approval, quality_check, invoiced, closed
- `notes` - string, max:1000 (activity log notes for status change)
- `reason` - string, max:500 (reason for status change)
- `occurred_at` - date (for backdating if authorized)

### Conditional Required Fields (when changing status)
- `cancellation_reason` - Required when status = cancelled
- `hold_reason` - Required when status = on_hold
- `new_scheduled_start` - Required when status = rescheduled (datetime)

### Additional Optional Fields for Status Changes
- `completion_summary` - string (when completing)
- `customer_signature_received` - boolean (when completing)
- `quality_check_passed` - boolean (when completing)
- `expected_resume_date` - date (when on_hold)
- `new_scheduled_end` - datetime (when rescheduling)
- `reschedule_reason` - string, max:500 (when rescheduling)

## Status Transitions
Not all status transitions are allowed. The system validates transitions based on the current status.

## General Updatable Fields
- `customer_id` - UUID
- `location_id` - UUID
- `service_id` - UUID (links work order to a service from the service catalog)
- `category` - Enum: scheduled, emergency, warranty, contract, inspection, installation, repair, delivery, consultation, follow_up, recall, upgrade
- `priority` - Enum: low, normal, high, urgent, emergency, critical
- `source` - Enum: customer_request, scheduled_maintenance, emergency_call, contract, inspection, internal, warranty_claim, follow_up, system_generated, mobile_app, web_portal, call_center
- `scheduled_start` - datetime (Y-m-d H:i:s)
- `scheduled_end` - datetime (Y-m-d H:i:s)
- `requested_completion_by` - datetime
- `completion_percentage` - integer, min:0, max:100
- `work_started_at` - datetime
- `work_completed_at` - datetime
- `special_instructions` - string
- `completion_summary` - string
- `primary_contact_id` - UUID
- `customer_presence_required` - boolean
- `customer_notification_sent` - boolean
- `customer_notified_at` - datetime
- `preferred_communication_methods` - array
- `estimated_labor_cost` - numeric
- `estimated_parts_cost` - numeric
- `actual_labor_cost` - numeric, min:0
- `actual_parts_cost` - numeric, min:0
- `customer_signature_required` - boolean
- `customer_signature_received` - boolean
- `customer_signed_at` - datetime
- `quality_check_required` - boolean
- `quality_check_passed` - boolean
- `quality_checked_by` - UUID
- `quality_checked_at` - datetime
- `customer_satisfaction_score` - integer, min:1, max:5
- `customer_feedback` - string
- `requires_follow_up` - boolean
- `follow_up_date` - date
- `follow_up_completed` - boolean
- `warranty_applicable` - boolean
- `warranty_days` - integer
- `warranty_expires_at` - date
- `assigned_supervisor_id` - UUID
- `external_work_order_id` - string
- `customer_po_number` - string
- `contract_number` - string
- `external_references` - array
- `response_time_minutes` - integer
- `resolution_time_minutes` - integer
- `completed_on_time` - boolean
- `completed_within_estimate` - boolean
- `callback_count` - integer
- `requires_manager_approval` - boolean
- `approved_by` - UUID
- `approved_at` - datetime
- `approval_notes` - string
- `risk_level` - Enum: low, medium, high, critical
- `safety_incident_occurred` - boolean
- `safety_requirements` - array
- `permit_required` - boolean
- `permit_number` - string

## Auto-Calculated Fields (do not send these)
- `estimated_total` - Automatically calculated from estimated_labor_cost + estimated_parts_cost
- `actual_total` - Automatically calculated from actual_labor_cost + actual_parts_cost
- `actual_duration_minutes` - Automatically calculated from work_started_at and work_completed_at

Reference: https://docs.itspropel.com/propel-biz/11-work-order/01-work-orders/update-work-order

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: PropelBiz
  version: 1.0.0
paths:
  /work-orders/%7Bwork_order_id%7D:
    patch:
      operationId: update-work-order
      summary: Update Work Order
      description: >-
        Update an existing work order. This endpoint now handles both general
        field updates AND status changes.


        **Required Permission:** `update_work_orders`


        All fields are optional. Only send the fields you want to update.


        ## Status Changes

        You can now update the work order status through this endpoint by
        providing the `status` field along with any other fields you want to
        update.


        ### Status-Related Fields

        - `status` - Enum: draft, pending_approval, approved, scheduled,
        dispatched, en_route, arrived, in_progress, on_hold, completed,
        cancelled, rescheduled, requires_parts, requires_approval,
        quality_check, invoiced, closed

        - `notes` - string, max:1000 (activity log notes for status change)

        - `reason` - string, max:500 (reason for status change)

        - `occurred_at` - date (for backdating if authorized)


        ### Conditional Required Fields (when changing status)

        - `cancellation_reason` - Required when status = cancelled

        - `hold_reason` - Required when status = on_hold

        - `new_scheduled_start` - Required when status = rescheduled (datetime)


        ### Additional Optional Fields for Status Changes

        - `completion_summary` - string (when completing)

        - `customer_signature_received` - boolean (when completing)

        - `quality_check_passed` - boolean (when completing)

        - `expected_resume_date` - date (when on_hold)

        - `new_scheduled_end` - datetime (when rescheduling)

        - `reschedule_reason` - string, max:500 (when rescheduling)


        ## Status Transitions

        Not all status transitions are allowed. The system validates transitions
        based on the current status.


        ## General Updatable Fields

        - `customer_id` - UUID

        - `location_id` - UUID

        - `service_id` - UUID (links work order to a service from the service
        catalog)

        - `category` - Enum: scheduled, emergency, warranty, contract,
        inspection, installation, repair, delivery, consultation, follow_up,
        recall, upgrade

        - `priority` - Enum: low, normal, high, urgent, emergency, critical

        - `source` - Enum: customer_request, scheduled_maintenance,
        emergency_call, contract, inspection, internal, warranty_claim,
        follow_up, system_generated, mobile_app, web_portal, call_center

        - `scheduled_start` - datetime (Y-m-d H:i:s)

        - `scheduled_end` - datetime (Y-m-d H:i:s)

        - `requested_completion_by` - datetime

        - `completion_percentage` - integer, min:0, max:100

        - `work_started_at` - datetime

        - `work_completed_at` - datetime

        - `special_instructions` - string

        - `completion_summary` - string

        - `primary_contact_id` - UUID

        - `customer_presence_required` - boolean

        - `customer_notification_sent` - boolean

        - `customer_notified_at` - datetime

        - `preferred_communication_methods` - array

        - `estimated_labor_cost` - numeric

        - `estimated_parts_cost` - numeric

        - `actual_labor_cost` - numeric, min:0

        - `actual_parts_cost` - numeric, min:0

        - `customer_signature_required` - boolean

        - `customer_signature_received` - boolean

        - `customer_signed_at` - datetime

        - `quality_check_required` - boolean

        - `quality_check_passed` - boolean

        - `quality_checked_by` - UUID

        - `quality_checked_at` - datetime

        - `customer_satisfaction_score` - integer, min:1, max:5

        - `customer_feedback` - string

        - `requires_follow_up` - boolean

        - `follow_up_date` - date

        - `follow_up_completed` - boolean

        - `warranty_applicable` - boolean

        - `warranty_days` - integer

        - `warranty_expires_at` - date

        - `assigned_supervisor_id` - UUID

        - `external_work_order_id` - string

        - `customer_po_number` - string

        - `contract_number` - string

        - `external_references` - array

        - `response_time_minutes` - integer

        - `resolution_time_minutes` - integer

        - `completed_on_time` - boolean

        - `completed_within_estimate` - boolean

        - `callback_count` - integer

        - `requires_manager_approval` - boolean

        - `approved_by` - UUID

        - `approved_at` - datetime

        - `approval_notes` - string

        - `risk_level` - Enum: low, medium, high, critical

        - `safety_incident_occurred` - boolean

        - `safety_requirements` - array

        - `permit_required` - boolean

        - `permit_number` - string


        ## Auto-Calculated Fields (do not send these)

        - `estimated_total` - Automatically calculated from estimated_labor_cost
        + estimated_parts_cost

        - `actual_total` - Automatically calculated from actual_labor_cost +
        actual_parts_cost

        - `actual_duration_minutes` - Automatically calculated from
        work_started_at and work_completed_at
      tags:
        - subpackage_11WorkOrder.subpackage_11WorkOrder/01WorkOrders
      parameters:
        - name: '{{tenant_key_name}}'
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/11 Work Order_01 Work Orders_Update Work
                  Order_Response_200
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                tag_type_ids[]:
                  type: string
                  description: 'Optional: Tag type UUIDs to sync during update'
              required:
                - tag_type_ids[]
servers:
  - url: https:/
components:
  schemas:
    11 Work Order_01 Work Orders_Update Work Order_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: 11 Work Order_01 Work Orders_Update Work Order_Response_200

```

## SDK Code Examples

```python
import requests

url = "https://https/work-orders/%7Bwork_order_id%7D"

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"tag_type_ids[]\"\r\n\r\n3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n-----011000010111000001101001--\r\n"
headers = {
    "{{tenant_key_name}}": "{{tenant_key_value1}}|{{tenant_key_value2}}",
    "Content-Type": "multipart/form-data; boundary=---011000010111000001101001"
}

response = requests.patch(url, data=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://https/work-orders/%7Bwork_order_id%7D';
const form = new FormData();
form.append('tag_type_ids[]', '3fa85f64-5717-4562-b3fc-2c963f66afa6');

const options = {
  method: 'PATCH',
  headers: {'{{tenant_key_name}}': '{{tenant_key_value1}}|{{tenant_key_value2}}'}
};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://https/work-orders/%7Bwork_order_id%7D"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"tag_type_ids[]\"\r\n\r\n3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("{{tenant_key_name}}", "{{tenant_key_value1}}|{{tenant_key_value2}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://https/work-orders/%7Bwork_order_id%7D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["{{tenant_key_name}}"] = '{{tenant_key_value1}}|{{tenant_key_value2}}'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"tag_type_ids[]\"\r\n\r\n3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://https/work-orders/%7Bwork_order_id%7D")
  .header("{{tenant_key_name}}", "{{tenant_key_value1}}|{{tenant_key_value2}}")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"tag_type_ids[]\"\r\n\r\n3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://https/work-orders/%7Bwork_order_id%7D', [
  'multipart' => [
    [
        'name' => 'tag_type_ids[]',
        'contents' => '3fa85f64-5717-4562-b3fc-2c963f66afa6'
    ]
  ]
  'headers' => [
    '{{tenant_key_name}}' => '{{tenant_key_value1}}|{{tenant_key_value2}}',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://https/work-orders/%7Bwork_order_id%7D");
var request = new RestRequest(Method.PATCH);
request.AddHeader("{{tenant_key_name}}", "{{tenant_key_value1}}|{{tenant_key_value2}}");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"tag_type_ids[]\"\r\n\r\n3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["{{tenant_key_name}}": "{{tenant_key_value1}}|{{tenant_key_value2}}"]
let parameters = [
  [
    "name": "tag_type_ids[]",
    "value": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://https/work-orders/%7Bwork_order_id%7D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```