# Cityworks

> Enter and track service requests, make and update work orders and inspections, add comments and photos, and start workflows when requests and work orders come in, change status or close.

App · 26 actions. Web page: https://docs.lodol.com/docs/integrations/cityworks

## Actions

### Add attachment

Attach a file, such as a photo, to a service request, work order or inspection. Give a file, or text to attach as a text file.

**Inputs**

- Record type (`record_type`, text, required): Whether the record is a service request, a work order or an inspection. One of: `service_request` (Service request), `work_order` (Work order), `inspection`.
- Record number (`record_id`, text, required): The service request or inspection number, or the work order ID, usually from a trigger or a search.
- File (`file`, text): The file to attach: upload one or pick one from an earlier step.
- Text (`content`, text): Text to attach as a text file, when no file is given.
- File name (`file_name`, text): The file's name with its extension, such as photo.jpg.
- Comments (`comments`, text): A note about the file.

**Outputs**

- `attachment` (object): An attachment
- `record_id` (text): The record's number
- `record_type` (text): The kind of record
- `size` (number): The file's size in bytes

**Example output**

```json
{
  "attachment": {
    "attached": "2026-10-30T11:05:40",
    "attached_by": "Public Works Clerk",
    "attachment_id": 3391,
    "comments": "Photo from the caller",
    "file_name": "pothole.jpg",
    "title": ""
  },
  "record_id": "104233",
  "record_type": "service_request",
  "size": 48213
}
```

### Add comment

Add a comment to a service request, work order or inspection.

**Inputs**

- Record type (`record_type`, text, required): Whether the record is a service request, a work order or an inspection. One of: `service_request` (Service request), `work_order` (Work order), `inspection`.
- Record number (`record_id`, text, required): The service request or inspection number, or the work order ID, usually from a trigger or a search.
- Comment (`comment`, text, required): What to say.

**Outputs**

- `comment` (object): A comment
- `record_id` (text): The record's number
- `record_type` (text): The kind of record

**Example output**

```json
{
  "comment": {
    "author": "Public Works Clerk",
    "comment": "Crew on site, cones placed.",
    "comment_id": 55120,
    "created": "2026-10-30T11:02:10",
    "last_modified": "2026-10-30T11:02:10"
  },
  "record_id": "26014",
  "record_type": "work_order"
}
```

### Cancel service request

Cancel a service request entered by mistake or already reported.

**Inputs**

- Service request number (`request_id`, text, required): The service request's number, usually from a trigger or a search.
- Reason (`reason`, text): Why it is being cancelled.

**Outputs**

- `service_request` (object): A Cityworks service request

**Example output**

```json
{
  "service_request": {
    "Cancel": true,
    "DateTimeClosed": null,
    "DateTimeInit": "2026-10-30T09:12:44",
    "Description": "Pothole",
    "Details": "About a foot across, in the eastbound lane",
    "DispatchTo": "Streets Crew 2",
    "InitiatedBy": "Public Works Clerk",
    "IsClosed": false,
    "OtherSystemId": "311-88213",
    "Priority": "2",
    "ProbAddress": "120 MAIN ST",
    "ProblemCode": "POTHOLE",
    "ProblemSid": 2156,
    "RequestId": 104233,
    "Status": "OPEN",
    "SubmitTo": "Dana Ruiz",
    "WorkOrderId": ""
  }
}
```

### Cancel work order

Cancel a work order that won't be done.

**Inputs**

- Work order ID (`work_order_id`, text, required): The work order's ID, usually from a trigger or a search.
- Reason (`reason`, text): Why it is being cancelled.

**Outputs**

- `work_order` (object): A Cityworks work order

**Example output**

```json
{
  "work_order": {
    "ActualFinishDate": null,
    "ActualStartDate": null,
    "ApplyToEntity": "STREET",
    "Cancel": true,
    "DateWOClosed": null,
    "Description": "Repair pothole",
    "InitiateDate": "2026-10-30T09:20:03",
    "InitiatedBy": "Public Works Clerk",
    "IsClosed": false,
    "Location": "Eastbound lane near the library",
    "Priority": "2",
    "ProjFinishDate": null,
    "ProjStartDate": "2026-11-02T08:00:00",
    "Status": "OPEN",
    "SubmitTo": "Dana Ruiz",
    "Supervisor": "Pat Moreno",
    "WOAddress": "120 MAIN ST",
    "WOTemplateId": "201",
    "WorkOrderId": "26014",
    "WorkOrderSid": 26014
  }
}
```

### Close inspection

Close an inspection once it is done.

**Inputs**

- Inspection number (`inspection_id`, text, required): The inspection's number, usually from a trigger or a search.

**Outputs**

- `inspection` (object): A Cityworks inspection

**Example output**

```json
{
  "inspection": {
    "DateClosed": null,
    "EntityType": "HYDRANT",
    "EntityUid": "HYD-00412",
    "InitiateDate": "2026-10-30T10:01:00",
    "InitiatedBy": "Public Works Clerk",
    "InspDate": null,
    "InspTemplateId": 12,
    "InspTemplateName": "Hydrant Inspection",
    "InspectedBy": "",
    "InspectionId": 8812,
    "IsClosed": true,
    "Location": "Corner of Main St and 2nd Ave",
    "ObservationSum": "",
    "Priority": "3",
    "RepairsMade": "",
    "RequestId": null,
    "Status": "CLOSED",
    "StreetName": "MAIN ST",
    "WorkOrderId": ""
  }
}
```

### Close service request

Close a service request once the problem is dealt with.

**Inputs**

- Service request number (`request_id`, text, required): The service request's number, usually from a trigger or a search.

**Outputs**

- `service_request` (object): A Cityworks service request

**Example output**

```json
{
  "service_request": {
    "Cancel": false,
    "DateTimeClosed": null,
    "DateTimeInit": "2026-10-30T09:12:44",
    "Description": "Pothole",
    "Details": "About a foot across, in the eastbound lane",
    "DispatchTo": "Streets Crew 2",
    "InitiatedBy": "Public Works Clerk",
    "IsClosed": true,
    "OtherSystemId": "311-88213",
    "Priority": "2",
    "ProbAddress": "120 MAIN ST",
    "ProblemCode": "POTHOLE",
    "ProblemSid": 2156,
    "RequestId": 104233,
    "Status": "CLOSED",
    "SubmitTo": "Dana Ruiz",
    "WorkOrderId": ""
  }
}
```

### Close work order

Close a work order once the work is done.

**Inputs**

- Work order ID (`work_order_id`, text, required): The work order's ID, usually from a trigger or a search.

**Outputs**

- `work_order` (object): A Cityworks work order

**Example output**

```json
{
  "work_order": {
    "ActualFinishDate": null,
    "ActualStartDate": null,
    "ApplyToEntity": "STREET",
    "Cancel": false,
    "DateWOClosed": null,
    "Description": "Repair pothole",
    "InitiateDate": "2026-10-30T09:20:03",
    "InitiatedBy": "Public Works Clerk",
    "IsClosed": true,
    "Location": "Eastbound lane near the library",
    "Priority": "2",
    "ProjFinishDate": null,
    "ProjStartDate": "2026-11-02T08:00:00",
    "Status": "CLOSED",
    "SubmitTo": "Dana Ruiz",
    "Supervisor": "Pat Moreno",
    "WOAddress": "120 MAIN ST",
    "WOTemplateId": "201",
    "WorkOrderId": "26014",
    "WorkOrderSid": 26014
  }
}
```

### Create inspection

Make an inspection from a template, for an asset or an address, optionally for a service request or a work order.

**Inputs**

- Inspection template (`template_id`, text, required): The kind of inspection, as set up in Cityworks.
- Kind of asset (`entity_type`, text): The kind of asset to inspect. Leave empty for the template's first.
- Asset ID (`asset_id`, text): The asset to inspect, by its asset ID, such as HYD-00412.
- Address (`address`, text): Where the inspection is, when it isn't for a request or work order.
- Comments (`comments`, text): A first comment on the inspection.
- Submit to (`submit_to`, text): Who the inspection goes to.
- Inspect by (`projected_start`, date and time): When the inspection should start.
- Service request number (`request_id`, text): Make it for this service request. Leave empty otherwise.
- Work order ID (`work_order_id`, text): Make it for this work order. Leave empty otherwise.

**Outputs**

- `inspection` (object): A Cityworks inspection
- `inspection_id` (number): The new inspection's number

**Example output**

```json
{
  "inspection": {
    "DateClosed": null,
    "EntityType": "HYDRANT",
    "EntityUid": "HYD-00412",
    "InitiateDate": "2026-10-30T10:01:00",
    "InitiatedBy": "Public Works Clerk",
    "InspDate": null,
    "InspTemplateId": 12,
    "InspTemplateName": "Hydrant Inspection",
    "InspectedBy": "",
    "InspectionId": 8812,
    "IsClosed": false,
    "Location": "Corner of Main St and 2nd Ave",
    "ObservationSum": "",
    "Priority": "3",
    "RepairsMade": "",
    "RequestId": null,
    "Status": "OPEN",
    "StreetName": "MAIN ST",
    "WorkOrderId": ""
  },
  "inspection_id": 8812
}
```

### Create service request

Enter a service request, such as a pothole or a broken streetlight reported by a resident, under a problem code.

**Inputs**

- Problem code (`problem_sid`, text, required): What the problem is, as set up in Cityworks.
- Address (`address`, text): Where the problem is, such as 120 Main St.
- Details (`details`, text): Details about the problem.
- Comments (`comments`, text): A first comment on the request.
- Priority (`priority`, text): The request's priority. Pick a problem code first.
- Caller first name (`caller_first_name`, text): The caller's first name.
- Caller last name (`caller_last_name`, text): The caller's last name.
- Caller email (`caller_email`, text): The caller's email address.
- Caller phone (`caller_phone`, text): The caller's phone number.
- Caller address (`caller_address`, text): The caller's own address.
- Caller comments (`caller_comments`, text): What the caller said, in their words.
- Reference number (`other_system_id`, text): The request's number in another system, such as a 311 case number.
- Place on the map (`place_on_map`, true/false): Have Cityworks find the address and place the record on its map. Default: `false`.

**Outputs**

- `request_id` (number): The new service request's number
- `service_request` (object): A Cityworks service request

**Example output**

```json
{
  "request_id": 104233,
  "service_request": {
    "Cancel": false,
    "DateTimeClosed": null,
    "DateTimeInit": "2026-10-30T09:12:44",
    "Description": "Pothole",
    "Details": "About a foot across, in the eastbound lane",
    "DispatchTo": "Streets Crew 2",
    "InitiatedBy": "Public Works Clerk",
    "IsClosed": false,
    "OtherSystemId": "311-88213",
    "Priority": "2",
    "ProbAddress": "120 MAIN ST",
    "ProblemCode": "POTHOLE",
    "ProblemSid": 2156,
    "RequestId": 104233,
    "Status": "OPEN",
    "SubmitTo": "Dana Ruiz",
    "WorkOrderId": ""
  }
}
```

### Create work order

Make a work order from a template, optionally for assets and linked to service requests.

**Inputs**

- Work order template (`template_id`, text, required): The kind of work, as set up in Cityworks. It also sets the kind of asset.
- Address (`address`, text): Where the work is, such as 120 Main St.
- Location (`location`, text): A description of where, such as Eastbound lane.
- Instructions (`instructions`, text): Instructions for the crew.
- Comments (`comments`, text): A first comment on the work order.
- Priority (`priority`, text): The work order's priority.
- Submit to (`submit_to`, text): Who the work order goes to.
- Supervisor (`supervisor`, text): The work order's supervisor.
- Start by (`projected_start`, date and time): When the work should start.
- Asset IDs (`asset_ids`, list): The assets to work on, by their asset IDs as on the map, such as HYD-00412. They must be of the template's kind of asset.
- Service request numbers (`request_ids`, list): Service requests to link the work order to.
- Place on the map (`place_on_map`, true/false): Have Cityworks find the address and place the record on its map. Default: `false`.

**Outputs**

- `work_order` (object): A Cityworks work order
- `work_order_id` (text): The new work order's ID

**Example output**

```json
{
  "work_order": {
    "ActualFinishDate": null,
    "ActualStartDate": null,
    "ApplyToEntity": "STREET",
    "Cancel": false,
    "DateWOClosed": null,
    "Description": "Repair pothole",
    "InitiateDate": "2026-10-30T09:20:03",
    "InitiatedBy": "Public Works Clerk",
    "IsClosed": false,
    "Location": "Eastbound lane near the library",
    "Priority": "2",
    "ProjFinishDate": null,
    "ProjStartDate": "2026-11-02T08:00:00",
    "Status": "OPEN",
    "SubmitTo": "Dana Ruiz",
    "Supervisor": "Pat Moreno",
    "WOAddress": "120 MAIN ST",
    "WOTemplateId": "201",
    "WorkOrderId": "26014",
    "WorkOrderSid": 26014
  },
  "work_order_id": "26014"
}
```

### Create work order from service request

Make a work order for a service request, carrying over its address and linking the two.

**Inputs**

- Service request number (`request_id`, text, required): The service request's number, usually from a trigger or a search.
- Work order template (`template_id`, text, required): The kind of work, as set up in Cityworks. It also sets the kind of asset.
- Instructions (`instructions`, text): Instructions for the crew.
- Comments (`comments`, text): A first comment on the work order.
- Priority (`priority`, text): The work order's priority.
- Submit to (`submit_to`, text): Who the work order goes to.
- Supervisor (`supervisor`, text): The work order's supervisor.
- Start by (`projected_start`, date and time): When the work should start.

**Outputs**

- `request_id` (number): The service request it was made for
- `work_order` (object): A Cityworks work order
- `work_order_id` (text): The new work order's ID

**Example output**

```json
{
  "request_id": 104233,
  "work_order": {
    "ActualFinishDate": null,
    "ActualStartDate": null,
    "ApplyToEntity": "STREET",
    "Cancel": false,
    "DateWOClosed": null,
    "Description": "Repair pothole",
    "InitiateDate": "2026-10-30T09:20:03",
    "InitiatedBy": "Public Works Clerk",
    "IsClosed": false,
    "Location": "Eastbound lane near the library",
    "Priority": "2",
    "ProjFinishDate": null,
    "ProjStartDate": "2026-11-02T08:00:00",
    "Status": "OPEN",
    "SubmitTo": "Dana Ruiz",
    "Supervisor": "Pat Moreno",
    "WOAddress": "120 MAIN ST",
    "WOTemplateId": "201",
    "WorkOrderId": "26014",
    "WorkOrderSid": 26014
  },
  "work_order_id": "26014"
}
```

### Get comments

Get the comments on a service request, work order or inspection, oldest first.

**Inputs**

- Record type (`record_type`, text, required): Whether the record is a service request, a work order or an inspection. One of: `service_request` (Service request), `work_order` (Work order), `inspection`.
- Record number (`record_id`, text, required): The service request or inspection number, or the work order ID, usually from a trigger or a search.

**Outputs**

- `comments` (list): The comments
- `count` (number): How many there are
- `record_id` (text): The record's number
- `record_type` (text): The kind of record

**Example output**

```json
{
  "comments": [
    {
      "author": "Public Works Clerk",
      "comment": "Crew on site, cones placed.",
      "comment_id": 55120,
      "created": "2026-10-30T11:02:10",
      "last_modified": "2026-10-30T11:02:10"
    }
  ],
  "count": 1,
  "record_id": "26014",
  "record_type": "work_order"
}
```

### Get inspection

Get an inspection's template, asset, status, findings and dates.

**Inputs**

- Inspection number (`inspection_id`, text, required): The inspection's number, usually from a trigger or a search.

**Outputs**

- `inspection` (object): A Cityworks inspection

**Example output**

```json
{
  "inspection": {
    "DateClosed": null,
    "EntityType": "HYDRANT",
    "EntityUid": "HYD-00412",
    "InitiateDate": "2026-10-30T10:01:00",
    "InitiatedBy": "Public Works Clerk",
    "InspDate": null,
    "InspTemplateId": 12,
    "InspTemplateName": "Hydrant Inspection",
    "InspectedBy": "",
    "InspectionId": 8812,
    "IsClosed": false,
    "Location": "Corner of Main St and 2nd Ave",
    "ObservationSum": "",
    "Priority": "3",
    "RepairsMade": "",
    "RequestId": null,
    "Status": "OPEN",
    "StreetName": "MAIN ST",
    "WorkOrderId": ""
  }
}
```

### Get service request

Get a service request's problem, status, address, caller and dates.

**Inputs**

- Service request number (`request_id`, text, required): The service request's number, usually from a trigger or a search.

**Outputs**

- `service_request` (object): A Cityworks service request

**Example output**

```json
{
  "service_request": {
    "Cancel": false,
    "DateTimeClosed": null,
    "DateTimeInit": "2026-10-30T09:12:44",
    "Description": "Pothole",
    "Details": "About a foot across, in the eastbound lane",
    "DispatchTo": "Streets Crew 2",
    "InitiatedBy": "Public Works Clerk",
    "IsClosed": false,
    "OtherSystemId": "311-88213",
    "Priority": "2",
    "ProbAddress": "120 MAIN ST",
    "ProblemCode": "POTHOLE",
    "ProblemSid": 2156,
    "RequestId": 104233,
    "Status": "OPEN",
    "SubmitTo": "Dana Ruiz",
    "WorkOrderId": ""
  }
}
```

### Get work order

Get a work order's description, status, address, people and dates.

**Inputs**

- Work order ID (`work_order_id`, text, required): The work order's ID, usually from a trigger or a search.

**Outputs**

- `work_order` (object): A Cityworks work order

**Example output**

```json
{
  "work_order": {
    "ActualFinishDate": null,
    "ActualStartDate": null,
    "ApplyToEntity": "STREET",
    "Cancel": false,
    "DateWOClosed": null,
    "Description": "Repair pothole",
    "InitiateDate": "2026-10-30T09:20:03",
    "InitiatedBy": "Public Works Clerk",
    "IsClosed": false,
    "Location": "Eastbound lane near the library",
    "Priority": "2",
    "ProjFinishDate": null,
    "ProjStartDate": "2026-11-02T08:00:00",
    "Status": "OPEN",
    "SubmitTo": "Dana Ruiz",
    "Supervisor": "Pat Moreno",
    "WOAddress": "120 MAIN ST",
    "WOTemplateId": "201",
    "WorkOrderId": "26014",
    "WorkOrderSid": 26014
  }
}
```

### List attachments

List the files attached to a service request, work order or inspection.

**Inputs**

- Record type (`record_type`, text, required): Whether the record is a service request, a work order or an inspection. One of: `service_request` (Service request), `work_order` (Work order), `inspection`.
- Record number (`record_id`, text, required): The service request or inspection number, or the work order ID, usually from a trigger or a search.

**Outputs**

- `attachments` (list): The attachments
- `count` (number): How many there are
- `record_id` (text): The record's number
- `record_type` (text): The kind of record

**Example output**

```json
{
  "attachments": [
    {
      "attached": "2026-10-30T11:05:40",
      "attached_by": "Public Works Clerk",
      "attachment_id": 3391,
      "comments": "Photo from the caller",
      "file_name": "pothole.jpg",
      "title": ""
    }
  ],
  "count": 1,
  "record_id": "104233",
  "record_type": "service_request"
}
```

### List inspection templates

List the inspection templates inspections can be made from, with their ids.

**Inputs**: None.

**Outputs**

- `count` (number): How many there are
- `templates` (list): The templates

**Example output**

```json
{
  "count": 1,
  "templates": [
    {
      "description": "Yearly hydrant flow and condition check",
      "name": "Hydrant Inspection",
      "priority": "3",
      "template_id": 12
    }
  ]
}
```

### List problem codes

List the problem codes service requests can be entered under, with their ids.

**Inputs**: None.

**Outputs**

- `count` (number): How many there are
- `problem_codes` (list): The problem codes

**Example output**

```json
{
  "count": 1,
  "problem_codes": [
    {
      "description": "Pothole",
      "domain_id": 1,
      "problem_code": "POTHOLE",
      "problem_sid": 2156
    }
  ]
}
```

### List saved searches

List the searches saved in Cityworks for service requests, work orders and inspections.

**Inputs**: None.

**Outputs**

- `count` (number): How many there are
- `saved_searches` (list): The saved searches

**Example output**

```json
{
  "count": 1,
  "saved_searches": [
    {
      "kind": "Service requests",
      "name": "Open potholes this week",
      "search_id": 431
    }
  ]
}
```

### List work order templates

List the work order templates, with the kind of asset each is for.

**Inputs**: None.

**Outputs**

- `count` (number): How many there are
- `templates` (list): The templates

**Example output**

```json
{
  "count": 1,
  "templates": [
    {
      "category": "STREETS",
      "description": "Repair pothole",
      "entity_type": "STREET",
      "priority": "2",
      "template_id": "201"
    }
  ]
}
```

### Run saved search

Run a search saved in Cityworks, such as Open potholes this week, and get its results.

**Inputs**

- Saved search (`search_id`, text, required): The saved search to run.
- Most results (`max_results`, number): How many records to return at most, 1 to 500. Defaults to 100. From 1 to 500.

**Outputs**

- `count` (number): How many there are
- `results` (list): The results
- `search_id` (number): The saved search

**Example output**

```json
{
  "count": 1,
  "results": [
    {
      "Description": "Pothole",
      "RequestId": 104233,
      "Status": "OPEN"
    }
  ],
  "search_id": 431
}
```

### Search inspections

Find inspections by template, status and when they were made.

**Inputs**

- Inspection template (`template_id`, text): Only inspections made from this template.
- Status (`status`, text): Only inspections with this status.
- Open or closed (`state`, text): Only open, closed or cancelled records. Defaults to any. One of: `open`, `closed`, `cancelled`, `any`. Default: `any`.
- Made on or after (`created_after`, date): Only inspections made on or after this day.
- Made on or before (`created_before`, date): Only inspections made on or before this day.
- Most results (`max_results`, number): How many records to return at most, 1 to 500. Defaults to 100. From 1 to 500.

**Outputs**

- `count` (number): How many there are
- `inspections` (list): The matching inspections, newest first

**Example output**

```json
{
  "count": 1,
  "inspections": [
    {
      "DateClosed": null,
      "EntityType": "HYDRANT",
      "EntityUid": "HYD-00412",
      "InitiateDate": "2026-10-30T10:01:00",
      "InitiatedBy": "Public Works Clerk",
      "InspDate": null,
      "InspTemplateId": 12,
      "InspTemplateName": "Hydrant Inspection",
      "InspectedBy": "",
      "InspectionId": 8812,
      "IsClosed": false,
      "Location": "Corner of Main St and 2nd Ave",
      "ObservationSum": "",
      "Priority": "3",
      "RepairsMade": "",
      "RequestId": null,
      "Status": "OPEN",
      "StreetName": "MAIN ST",
      "WorkOrderId": ""
    }
  ]
}
```

### Search service requests

Find service requests by problem code, status and when they were entered.

**Inputs**

- Problem code (`problem_sid`, text): Only requests with this problem code.
- Status (`status`, text): Only requests with this status.
- Open or closed (`state`, text): Only open, closed or cancelled records. Defaults to any. One of: `open`, `closed`, `cancelled`, `any`. Default: `any`.
- Entered on or after (`created_after`, date): Only records entered on or after this day.
- Entered on or before (`created_before`, date): Only records entered on or before this day.
- Reference number (`other_system_id`, text): Only the request with this number from another system.
- Most results (`max_results`, number): How many records to return at most, 1 to 500. Defaults to 100. From 1 to 500.

**Outputs**

- `count` (number): How many there are
- `service_requests` (list): The matching requests, newest first

**Example output**

```json
{
  "count": 1,
  "service_requests": [
    {
      "Cancel": false,
      "DateTimeClosed": null,
      "DateTimeInit": "2026-10-30T09:12:44",
      "Description": "Pothole",
      "Details": "About a foot across, in the eastbound lane",
      "DispatchTo": "Streets Crew 2",
      "InitiatedBy": "Public Works Clerk",
      "IsClosed": false,
      "OtherSystemId": "311-88213",
      "Priority": "2",
      "ProbAddress": "120 MAIN ST",
      "ProblemCode": "POTHOLE",
      "ProblemSid": 2156,
      "RequestId": 104233,
      "Status": "OPEN",
      "SubmitTo": "Dana Ruiz",
      "WorkOrderId": ""
    }
  ]
}
```

### Search work orders

Find work orders by template, status and when they were made.

**Inputs**

- Work order template (`template_id`, text): Only work orders made from this template.
- Status (`status`, text): Only work orders with this status.
- Open or closed (`state`, text): Only open, closed or cancelled records. Defaults to any. One of: `open`, `closed`, `cancelled`, `any`. Default: `any`.
- Made on or after (`created_after`, date): Only work orders made on or after this day.
- Made on or before (`created_before`, date): Only work orders made on or before this day.
- Most results (`max_results`, number): How many records to return at most, 1 to 500. Defaults to 100. From 1 to 500.

**Outputs**

- `count` (number): How many there are
- `work_orders` (list): The matching work orders, newest first

**Example output**

```json
{
  "count": 1,
  "work_orders": [
    {
      "ActualFinishDate": null,
      "ActualStartDate": null,
      "ApplyToEntity": "STREET",
      "Cancel": false,
      "DateWOClosed": null,
      "Description": "Repair pothole",
      "InitiateDate": "2026-10-30T09:20:03",
      "InitiatedBy": "Public Works Clerk",
      "IsClosed": false,
      "Location": "Eastbound lane near the library",
      "Priority": "2",
      "ProjFinishDate": null,
      "ProjStartDate": "2026-11-02T08:00:00",
      "Status": "OPEN",
      "SubmitTo": "Dana Ruiz",
      "Supervisor": "Pat Moreno",
      "WOAddress": "120 MAIN ST",
      "WOTemplateId": "201",
      "WorkOrderId": "26014",
      "WorkOrderSid": 26014
    }
  ]
}
```

### Update service request

Change a service request's status, priority, details, address or resolution.

**Inputs**

- Service request number (`request_id`, text, required): The service request's number, usually from a trigger or a search.
- Status (`status`, text): The new status.
- Priority (`priority`, text): The new priority, such as 2.
- Details (`details`, text): New details about the problem.
- Address (`address`, text): The corrected address of the problem.
- Resolution (`resolution`, text): How the problem was resolved.
- Reference number (`other_system_id`, text): The request's number in another system.

**Outputs**

- `service_request` (object): A Cityworks service request

**Example output**

```json
{
  "service_request": {
    "Cancel": false,
    "DateTimeClosed": null,
    "DateTimeInit": "2026-10-30T09:12:44",
    "Description": "Pothole",
    "Details": "About a foot across, in the eastbound lane",
    "DispatchTo": "Streets Crew 2",
    "InitiatedBy": "Public Works Clerk",
    "IsClosed": false,
    "OtherSystemId": "311-88213",
    "Priority": "2",
    "ProbAddress": "120 MAIN ST",
    "ProblemCode": "POTHOLE",
    "ProblemSid": 2156,
    "RequestId": 104233,
    "Status": "OPEN",
    "SubmitTo": "Dana Ruiz",
    "WorkOrderId": ""
  }
}
```

### Update work order

Change a work order's status, priority, people, instructions or dates.

**Inputs**

- Work order ID (`work_order_id`, text, required): The work order's ID, usually from a trigger or a search.
- Status (`status`, text): The new status.
- Priority (`priority`, text): The work order's priority.
- Instructions (`instructions`, text): Instructions for the crew.
- Description (`description`, text): A new description of the work.
- Address (`address`, text): The corrected address of the work.
- Submit to (`submit_to`, text): Who the work order goes to.
- Supervisor (`supervisor`, text): The work order's supervisor.
- Start by (`projected_start`, date and time): When the work should start.
- Finish by (`projected_finish`, date and time): When the work should finish.
- Started (`actual_start`, date and time): When the work started.
- Finished (`actual_finish`, date and time): When the work finished.
- Resolution (`resolution`, text): How the work was resolved.

**Outputs**

- `work_order` (object): A Cityworks work order

**Example output**

```json
{
  "work_order": {
    "ActualFinishDate": null,
    "ActualStartDate": null,
    "ApplyToEntity": "STREET",
    "Cancel": false,
    "DateWOClosed": null,
    "Description": "Repair pothole",
    "InitiateDate": "2026-10-30T09:20:03",
    "InitiatedBy": "Public Works Clerk",
    "IsClosed": false,
    "Location": "Eastbound lane near the library",
    "Priority": "2",
    "ProjFinishDate": null,
    "ProjStartDate": "2026-11-02T08:00:00",
    "Status": "OPEN",
    "SubmitTo": "Dana Ruiz",
    "Supervisor": "Pat Moreno",
    "WOAddress": "120 MAIN ST",
    "WOTemplateId": "201",
    "WorkOrderId": "26014",
    "WorkOrderSid": 26014
  }
}
```
