# Accela

> Work with Accela Civic Platform: search, open and update permits, licenses and cases, move workflow tasks on, attach documents, check fees, and schedule and result inspections.

App · 30 actions. Web page: https://docs.lodol.com/docs/integrations/accela

## Actions

### Add address to record

Add an address to a record.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.
- Street number (`street_number`, number): The house number, such as 123. At least 0.
- Street name (`street_name`, text, required): The street, such as Main Street.
- Unit (`unit`, text): The unit or suite number.
- City (`city`, text): The city.
- State (`state`, text): The state's two-letter code, such as CA.
- ZIP code (`postal_code`, text): The ZIP or postal code.
- Primary address (`is_primary`, true/false): Make this the record's primary address.

**Outputs**

- `address_id` (text): The new address's id
- `record_id` (text): The record it was added to

**Example output**

```json
{
  "address_id": "1002",
  "record_id": "ISLANDTON-14CAP-00000-000BR"
}
```

### Add comment to record

Add a comment to a record.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.
- Comment (`text`, text, required): The comment.
- Show to inspectors (`show_on_inspections`, true/false): Show the comment on the record's inspections too.

**Outputs**

- `comment_id` (text): The new comment's id
- `record_id` (text): The record it was added to

**Example output**

```json
{
  "comment_id": "6624",
  "record_id": "ISLANDTON-14CAP-00000-000BR"
}
```

### Add contact to record

Add a person or business to a record as a contact, such as its applicant.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.
- Contact type (`contact_type`, text, required): The contact's role, such as Applicant.
- First name (`first_name`, text): The contact's first name.
- Last name (`last_name`, text): The contact's last name.
- Organization (`organization`, text): The contact's business, for a business.
- Email (`email`, text): The contact's email address.
- Phone (`phone`, text): The contact's phone number.
- Primary contact (`is_primary`, true/false): Make this the record's primary contact.

**Outputs**

- `contact_id` (text): The new contact's id
- `record_id` (text): The record it was added to

**Example output**

```json
{
  "contact_id": "7782",
  "record_id": "ISLANDTON-14CAP-00000-000BR"
}
```

### Attach document to record

Attach a file to a record, such as plans from an email, or save text from an earlier step as a text file on the record.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.
- File (`file`, text): The file to attach, such as a PDF from an email. Leave empty to save 'Text' as a file instead.
- Text (`text`, text): Text to save as a text file and attach, such as notes from an earlier step. Use this or 'File'.
- File name (`file_name`, text): The file's name, such as site-notes.txt. Needed with 'Text'.
- Description (`description`, text): What the document is.
- Category (`category`, text): The document category, from the ones this record takes.

**Outputs**

- `document_id` (text): The new document's id
- `file_name` (text): The file's name
- `record_id` (text): The record it was attached to

**Example output**

```json
{
  "document_id": "2556217",
  "file_name": "site-notes.txt",
  "record_id": "ISLANDTON-14CAP-00000-000BR"
}
```

### Cancel inspection

Cancel a scheduled inspection.

**Inputs**

- Inspection ID (`inspection_id`, text, required): The inspection's id, a number from 'Search inspections', 'Schedule inspection' or a trigger.

**Outputs**

- `cancelled` (true/false): True once cancelled
- `inspection_id` (text): The inspection cancelled

**Example output**

```json
{
  "cancelled": true,
  "inspection_id": "6389954"
}
```

### Create record

Open a new record, such as a permit application or a complaint, of a record type, optionally with an address, a parcel and a contact. Accela runs the agency's own rules for a new application.

**Inputs**

- Record type (`record_type`, text, required): The kind of record to open, such as a residential building permit.
- Name (`name`, text): The record's name.
- Description (`description`, text): What the record is for.
- Street number (`street_number`, number): The house number, such as 123. At least 0.
- Street name (`street_name`, text): The street, such as Main Street.
- City (`city`, text): The city.
- State (`state`, text): The state's two-letter code, such as CA.
- ZIP code (`postal_code`, text): The ZIP or postal code.
- Parcel number (`parcel_number`, text): The parcel (APN) the work is on.
- Contact type (`contact_type`, text): The contact's role, such as Applicant. Needed with a contact.
- Contact first name (`contact_first_name`, text): The contact's first name.
- Contact last name (`contact_last_name`, text): The contact's last name.
- Contact organization (`contact_organization`, text): The contact's business, for a contact who is a business.
- Contact email (`contact_email`, text): The contact's email address.
- Contact phone (`contact_phone`, text): The contact's phone number.

**Outputs**

- `record` (object): The new record

**Example output**

```json
{
  "record": {
    "assignedToDepartment": "ISLANDTON/BUILDING/NA/NA/NA/NA/NA",
    "assignedUser": "JSMITH",
    "balance": 150.0,
    "customId": "BLD-2024-00012",
    "description": "Residence alteration",
    "id": "ISLANDTON-14CAP-00000-000BR",
    "module": "Building",
    "name": "Kitchen remodel",
    "openedDate": "2024-08-04 00:00:00",
    "priority": {
      "text": "Normal",
      "value": "Normal"
    },
    "serviceProviderCode": "ISLANDTON",
    "shortNotes": "Rear addition",
    "status": {
      "text": "Submitted",
      "value": "Submitted"
    },
    "statusDate": "2024-08-04 08:04:43",
    "totalFee": 250.0,
    "totalPay": 100.0,
    "trackingId": 287524530,
    "type": {
      "id": "Building-Residential-Alteration-NA",
      "module": "Building",
      "text": "Residential Alteration",
      "value": "Building/Residential/Alteration/NA"
    },
    "updateDate": "2024-08-05 10:12:00"
  }
}
```

### Delete record

Delete a record. This can't be undone.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.

**Outputs**

- `deleted` (true/false): True once deleted
- `record_id` (text): The record deleted

**Example output**

```json
{
  "deleted": true,
  "record_id": "ISLANDTON-14CAP-00000-000BR"
}
```

### Download document

Download a document from Accela, so later steps can read, send or store it.

**Inputs**

- Document ID (`document_id`, text, required): The document's id, a number from 'List record documents'.

**Outputs**

- `content_type` (text): The file's type, such as application/pdf
- `document_id` (text): The document's id in Accela
- `document_ref` (text): The downloaded file, for steps that take a file
- `file_name` (text): The file's name
- `size_bytes` (number): The file's size

**Example output**

```json
{
  "content_type": "application/pdf",
  "document_id": "2556216",
  "document_ref": "doc_0123456789abcdef0123456789abcdef",
  "file_name": "site-plan.pdf",
  "size_bytes": 482133
}
```

### Get inspection

Get one inspection with its type, status, schedule, inspector and result.

**Inputs**

- Inspection ID (`inspection_id`, text, required): The inspection's id, a number from 'Search inspections', 'Schedule inspection' or a trigger.

**Outputs**

- `inspection` (object): The inspection

**Example output**

```json
{
  "inspection": {
    "completedDate": "",
    "grade": "",
    "id": 6389954,
    "inspectorFullName": "Mobile Inspector",
    "inspectorId": "MINSPECTOR",
    "recordId": {
      "customId": "BLD-2024-00012",
      "id": "ISLANDTON-14CAP-00000-000BR",
      "serviceProviderCode": "ISLANDTON",
      "trackingId": 287524530
    },
    "requestComment": "Side gate unlocked.",
    "requestDate": "2024-11-25 00:00:00",
    "resultComment": "",
    "resultType": "",
    "scheduleDate": "2024-12-01 00:00:00",
    "scheduleStartAMPM": "AM",
    "scheduleStartTime": "09:00",
    "status": {
      "text": "Scheduled",
      "value": "Scheduled"
    },
    "type": {
      "id": 173,
      "text": "Framing",
      "value": "Framing"
    }
  }
}
```

### Get open inspection dates

List the days open for an inspection on a record, up to 31 from the day you pick, by the agency's inspection calendar.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.
- Inspection type (`inspection_type`, text): Only dates open for this kind of inspection.
- From (`start_date`, date, required): The first day to look at.
- How many days (`limit`, number): How many open dates to return, 1 to 31. Defaults to 31. From 1 to 31.

**Outputs**

- `count` (number): How many came back
- `dates` (list): The open days, as date and time

**Example output**

```json
{
  "count": 2,
  "dates": [
    "2024-10-10T07:00:00Z",
    "2024-10-13T07:00:00Z"
  ]
}
```

### Get record

Get one record with its type, status, dates, assignment and fee totals, and optionally its addresses, parcels, owners, contacts and custom fields.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.
- Include (`include`, list): What else to return with the record. One or more of: `addresses`, `parcels`, `owners`, `contacts`, `professionals` (Licensed professionals), `customForms` (Custom forms), `customTables` (Custom tables), `assets`.

**Outputs**

- `record` (object): The record

**Example output**

```json
{
  "record": {
    "assignedToDepartment": "ISLANDTON/BUILDING/NA/NA/NA/NA/NA",
    "assignedUser": "JSMITH",
    "balance": 150.0,
    "customId": "BLD-2024-00012",
    "description": "Residence alteration",
    "id": "ISLANDTON-14CAP-00000-000BR",
    "module": "Building",
    "name": "Kitchen remodel",
    "openedDate": "2024-08-04 00:00:00",
    "priority": {
      "text": "Normal",
      "value": "Normal"
    },
    "serviceProviderCode": "ISLANDTON",
    "shortNotes": "Rear addition",
    "status": {
      "text": "Submitted",
      "value": "Submitted"
    },
    "statusDate": "2024-08-04 08:04:43",
    "totalFee": 250.0,
    "totalPay": 100.0,
    "trackingId": 287524530,
    "type": {
      "id": "Building-Residential-Alteration-NA",
      "module": "Building",
      "text": "Residential Alteration",
      "value": "Building/Residential/Alteration/NA"
    },
    "updateDate": "2024-08-05 10:12:00"
  }
}
```

### List inspection types for record

List the kinds of inspection a record can have scheduled.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.

**Outputs**

- `count` (number): How many came back
- `inspection_types` (list): The inspection types

**Example output**

```json
{
  "count": 1,
  "inspection_types": [
    {
      "group": "BLD_COMM",
      "id": 97,
      "isRequired": "N",
      "resultGroup": "BLD_STANDARD",
      "text": "Set Backs",
      "value": "Set Backs"
    }
  ]
}
```

### List record addresses

List the addresses on a record.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.

**Outputs**

- `addresses` (list): The record's addresses
- `count` (number): How many came back

**Example output**

```json
{
  "addresses": [
    {
      "city": "Islandton",
      "id": 1001,
      "isPrimary": "Y",
      "postalCode": "94588",
      "state": {
        "text": "CA",
        "value": "CA"
      },
      "streetName": "Main Street",
      "streetStart": 123,
      "unitStart": "4B"
    }
  ],
  "count": 1
}
```

### List record comments

List the comments on a record.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.

**Outputs**

- `comments` (list): The record's comments
- `count` (number): How many came back

**Example output**

```json
{
  "comments": [
    {
      "createdBy": "JSMITH",
      "createdDate": "2024-08-05 09:30:00",
      "displayOnInspection": "N",
      "id": 6623,
      "text": "Plans received at the counter."
    }
  ],
  "count": 1
}
```

### List record contacts

List the contacts on a record, such as its applicant and contractor.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.

**Outputs**

- `contacts` (list): The record's contacts
- `count` (number): How many came back

**Example output**

```json
{
  "contacts": [
    {
      "email": "jsmith@example.com",
      "firstName": "Joe",
      "fullName": "Joe Smith",
      "id": "7781",
      "isPrimary": "Y",
      "lastName": "Smith",
      "organizationName": "Acme Builders",
      "phone1": "925-555-0123",
      "type": {
        "text": "Applicant",
        "value": "Applicant"
      }
    }
  ],
  "count": 1
}
```

### List record documents

List the documents attached to a record.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.

**Outputs**

- `count` (number): How many came back
- `documents` (list): The record's documents

**Example output**

```json
{
  "count": 1,
  "documents": [
    {
      "category": {
        "text": "Plans",
        "value": "Plans"
      },
      "description": "Site plan",
      "fileName": "site-plan.pdf",
      "group": {
        "text": "BLD_DOCS",
        "value": "BLD_DOCS"
      },
      "id": 2556216,
      "size": 482133,
      "status": {
        "text": "Uploaded",
        "value": "Uploaded"
      },
      "uploadedBy": "JSMITH",
      "uploadedDate": "2024-08-05 11:00:00"
    }
  ]
}
```

### List record fees

List a record's fees, all or only the paid or unpaid ones, with the total and what is still due.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.
- Which fees (`status`, text): Only paid or only unpaid fees. Leave empty for all. One of: `unpaid` (Unpaid fees), `paid` (Paid fees).

**Outputs**

- `balance_due` (number): What is still due
- `count` (number): How many came back
- `fees` (list): The fees
- `total_amount` (number): The fees' total

**Example output**

```json
{
  "balance_due": 150.0,
  "count": 1,
  "fees": [
    {
      "amount": 250.0,
      "applyDate": "2024-08-05 00:00:00",
      "balanceDue": 150.0,
      "code": {
        "text": "BLD_010",
        "value": "BLD_010"
      },
      "description": "Building permit fee",
      "id": 9001,
      "invoiceId": 4410,
      "status": "INVOICED"
    }
  ],
  "total_amount": 250.0
}
```

### List record invoices

List a record's invoices with their amounts and balances.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.

**Outputs**

- `count` (number): How many came back
- `invoices` (list): The invoices
- `total_balance` (number): What is still due across them

**Example output**

```json
{
  "count": 1,
  "invoices": [
    {
      "amount": 250.0,
      "balance": 150.0,
      "dueDate": "2024-09-05 00:00:00",
      "id": 4410,
      "invStatus": "INVOICED",
      "invoiceDate": "2024-08-05 00:00:00",
      "invoiceNumber": "INV-2024-00410"
    }
  ],
  "total_balance": 150.0
}
```

### List record owners

List the property owners on a record, with their mailing addresses.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.

**Outputs**

- `count` (number): How many came back
- `owners` (list): The record's owners

**Example output**

```json
{
  "count": 1,
  "owners": [
    {
      "email": "jdoe@example.com",
      "fullName": "Jane Doe",
      "id": 3301,
      "isPrimary": "Y",
      "mailAddress": {
        "addressLine1": "500 Oak Ave",
        "city": "Islandton",
        "postalCode": "94588"
      },
      "phone": "925-555-0188"
    }
  ]
}
```

### List record parcels

List the parcels a record is on, with their legal description and assessed values.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.

**Outputs**

- `count` (number): How many came back
- `parcels` (list): The record's parcels

**Example output**

```json
{
  "count": 1,
  "parcels": [
    {
      "block": "4",
      "id": "005020018",
      "improvedValue": 410000.0,
      "isPrimary": "Y",
      "landValue": 250000.0,
      "legalDescription": "LOT 12 BLOCK 4",
      "lot": "12",
      "parcelNumber": "005020018",
      "subdivision": {
        "text": "Oak Hills",
        "value": "Oak Hills"
      }
    }
  ]
}
```

### List record statuses

List the statuses a record type can be in.

**Inputs**

- Record type (`record_type`, text, required): The record type.

**Outputs**

- `count` (number): How many came back
- `statuses` (list): The statuses

**Example output**

```json
{
  "count": 1,
  "statuses": [
    {
      "text": "Issued",
      "value": "Issued"
    }
  ]
}
```

### List record types

List the agency's record types, optionally of one module, with the four-level names other steps take.

**Inputs**

- Module (`module`, text): Only this module, such as Building.
- How many (`limit`, number): How many to return, 1 to 1000. Defaults to 25. From 1 to 1000.
- Offset (`offset`, number): How many to skip, to read the next page. Use 'next_offset' from the last page. At least 0.

**Outputs**

- `count` (number): How many came back
- `has_more` (true/false): Whether more match; ask again with 'Offset' set to next_offset
- `next_offset` (number): The offset of the next page, or empty on the last page
- `record_types` (list): The record types

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "next_offset": null,
  "record_types": [
    {
      "alias": "Residential Alteration",
      "category": "NA",
      "group": "Building",
      "id": "Building-Residential-Alteration-NA",
      "module": "Building",
      "subType": "Alteration",
      "text": "Residential Alteration",
      "type": "Residential",
      "value": "Building/Residential/Alteration/NA"
    }
  ]
}
```

### List workflow tasks

List a record's workflow tasks, such as intake and plan review, with their status and who they're assigned to.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.
- Only active tasks (`active_only`, true/false): Only the tasks waiting to be acted on now.

**Outputs**

- `count` (number): How many came back
- `tasks` (list): The record's workflow tasks

**Example output**

```json
{
  "count": 1,
  "tasks": [
    {
      "assignedToDepartment": {
        "text": "ISLANDTON/BUILDING/NA/NA/NA/NA/NA",
        "value": "ISLANDTON/BUILDING/NA/NA/NA/NA/NA"
      },
      "assignedUser": {
        "text": "JSMITH",
        "value": "JSMITH"
      },
      "comment": "All sheets approved.",
      "description": "Plans Review",
      "dueDate": "2024-08-20 00:00:00",
      "id": "1-345",
      "isActive": "Y",
      "isCompleted": "N",
      "processCode": "BLD_RESIDENTIAL",
      "status": {
        "text": "Approved",
        "value": "Approved"
      },
      "statusDate": "2024-08-06 00:00:00"
    }
  ]
}
```

### Reschedule inspection

Move a scheduled inspection to another day, time or inspector.

**Inputs**

- Inspection ID (`inspection_id`, text, required): The inspection's id, a number from 'Search inspections', 'Schedule inspection' or a trigger.
- New date (`schedule_date`, date, required): The new day of the inspection.
- Start time (`start_time`, time): The time the inspection starts, in the agency's time.
- Inspector (`inspector`, text): The inspector to assign.
- Comment (`comment`, text): Why it moved, or a note for the inspector.

**Outputs**

- `inspection` (object): The inspection as it is now

**Example output**

```json
{
  "inspection": {
    "completedDate": "",
    "grade": "",
    "id": 6389954,
    "inspectorFullName": "Mobile Inspector",
    "inspectorId": "MINSPECTOR",
    "recordId": {
      "customId": "BLD-2024-00012",
      "id": "ISLANDTON-14CAP-00000-000BR",
      "serviceProviderCode": "ISLANDTON",
      "trackingId": 287524530
    },
    "requestComment": "Side gate unlocked.",
    "requestDate": "2024-11-25 00:00:00",
    "resultComment": "",
    "resultType": "",
    "scheduleDate": "2024-12-01 00:00:00",
    "scheduleStartAMPM": "AM",
    "scheduleStartTime": "09:00",
    "status": {
      "text": "Scheduled",
      "value": "Scheduled"
    },
    "type": {
      "id": 173,
      "text": "Framing",
      "value": "Framing"
    }
  }
}
```

### Result inspection

Record an inspection's result, such as Passed or Failed, with a comment. Accela then moves the record on as the agency has set up.

**Inputs**

- Inspection ID (`inspection_id`, text, required): The inspection's id, a number from 'Search inspections', 'Schedule inspection' or a trigger.
- Result (`result`, text, required): The result, such as Passed or Failed.
- Comment (`comment`, text): The result comment.
- Inspected on (`completed_date`, date): The day it was inspected. Defaults to today.
- Grade (`grade`, text): The grade, where the inspection type uses them.
- Score (`total_score`, number): The total score, where the inspection type uses scores. At least 0.

**Outputs**

- `inspection` (object): The inspection as it is now

**Example output**

```json
{
  "inspection": {
    "completedDate": "",
    "grade": "",
    "id": 6389954,
    "inspectorFullName": "Mobile Inspector",
    "inspectorId": "MINSPECTOR",
    "recordId": {
      "customId": "BLD-2024-00012",
      "id": "ISLANDTON-14CAP-00000-000BR",
      "serviceProviderCode": "ISLANDTON",
      "trackingId": 287524530
    },
    "requestComment": "Side gate unlocked.",
    "requestDate": "2024-11-25 00:00:00",
    "resultComment": "",
    "resultType": "",
    "scheduleDate": "2024-12-01 00:00:00",
    "scheduleStartAMPM": "AM",
    "scheduleStartTime": "09:00",
    "status": {
      "text": "Scheduled",
      "value": "Scheduled"
    },
    "type": {
      "id": 173,
      "text": "Framing",
      "value": "Framing"
    }
  }
}
```

### Schedule inspection

Schedule an inspection on a record for a day, optionally at a time and with an inspector.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.
- Inspection type (`inspection_type`, text, required): The kind of inspection, from those the record can have.
- Date (`schedule_date`, date, required): The day of the inspection.
- Start time (`start_time`, time): The time the inspection starts, in the agency's time.
- Inspector (`inspector`, text): The inspector to assign.
- Comment (`comment`, text): A note for the inspector, such as access details.

**Outputs**

- `inspection` (object): The inspection scheduled

**Example output**

```json
{
  "inspection": {
    "completedDate": "",
    "grade": "",
    "id": 6389954,
    "inspectorFullName": "Mobile Inspector",
    "inspectorId": "MINSPECTOR",
    "recordId": {
      "customId": "BLD-2024-00012",
      "id": "ISLANDTON-14CAP-00000-000BR",
      "serviceProviderCode": "ISLANDTON",
      "trackingId": 287524530
    },
    "requestComment": "Side gate unlocked.",
    "requestDate": "2024-11-25 00:00:00",
    "resultComment": "",
    "resultType": "",
    "scheduleDate": "2024-12-01 00:00:00",
    "scheduleStartAMPM": "AM",
    "scheduleStartTime": "09:00",
    "status": {
      "text": "Scheduled",
      "value": "Scheduled"
    },
    "type": {
      "id": 173,
      "text": "Framing",
      "value": "Framing"
    }
  }
}
```

### Search inspections

Find inspections by record, inspector, or the days they were scheduled for or resulted. Returns one page; use 'Offset' for more.

**Inputs**

- Record ID (`record_id`, text): Only inspections on this record, by its id.
- Inspector (`inspector`, text): Only this inspector's inspections.
- Scheduled on or after (`scheduled_from`, date): Only inspections scheduled on or after this day.
- Scheduled on or before (`scheduled_to`, date): Only inspections scheduled on or before this day.
- Resulted on or after (`completed_from`, date): Only inspections resulted on or after this day.
- Resulted on or before (`completed_to`, date): Only inspections resulted on or before this day.
- How many (`limit`, number): How many to return, 1 to 1000. Defaults to 25. From 1 to 1000.
- Offset (`offset`, number): How many to skip, to read the next page. Use 'next_offset' from the last page. At least 0.

**Outputs**

- `count` (number): How many came back
- `has_more` (true/false): Whether more match; ask again with 'Offset' set to next_offset
- `inspections` (list): The inspections found
- `next_offset` (number): The offset of the next page, or empty on the last page

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "inspections": [
    {
      "completedDate": "",
      "grade": "",
      "id": 6389954,
      "inspectorFullName": "Mobile Inspector",
      "inspectorId": "MINSPECTOR",
      "recordId": {
        "customId": "BLD-2024-00012",
        "id": "ISLANDTON-14CAP-00000-000BR",
        "serviceProviderCode": "ISLANDTON",
        "trackingId": 287524530
      },
      "requestComment": "Side gate unlocked.",
      "requestDate": "2024-11-25 00:00:00",
      "resultComment": "",
      "resultType": "",
      "scheduleDate": "2024-12-01 00:00:00",
      "scheduleStartAMPM": "AM",
      "scheduleStartTime": "09:00",
      "status": {
        "text": "Scheduled",
        "value": "Scheduled"
      },
      "type": {
        "id": 173,
        "text": "Framing",
        "value": "Framing"
      }
    }
  ],
  "next_offset": null
}
```

### Search records

Find permits, licenses, cases and other records by record number, type, status, name, or the days they were opened or changed. Returns one page; use 'Offset' for more.

**Inputs**

- Record number (`record_number`, text): The record number people see, such as BLD-2024-00012.
- Record type (`record_type`, text): Only records of this type.
- Module (`module`, text): Only this module, such as Building.
- Status (`status`, text): Only records in this status. Pick a record type first to choose from its statuses.
- Name (`name`, text): Only records with this name.
- Opened on or after (`opened_from`, date): Only records opened on or after this day.
- Opened on or before (`opened_to`, date): Only records opened on or before this day.
- Changed on or after (`updated_from`, date): Only records changed on or after this day.
- Changed on or before (`updated_to`, date): Only records changed on or before this day.
- How many (`limit`, number): How many to return, 1 to 1000. Defaults to 25. From 1 to 1000.
- Offset (`offset`, number): How many to skip, to read the next page. Use 'next_offset' from the last page. At least 0.

**Outputs**

- `count` (number): How many came back
- `has_more` (true/false): Whether more match; ask again with 'Offset' set to next_offset
- `next_offset` (number): The offset of the next page, or empty on the last page
- `records` (list): The records found

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "next_offset": null,
  "records": [
    {
      "assignedToDepartment": "ISLANDTON/BUILDING/NA/NA/NA/NA/NA",
      "assignedUser": "JSMITH",
      "balance": 150.0,
      "customId": "BLD-2024-00012",
      "description": "Residence alteration",
      "id": "ISLANDTON-14CAP-00000-000BR",
      "module": "Building",
      "name": "Kitchen remodel",
      "openedDate": "2024-08-04 00:00:00",
      "priority": {
        "text": "Normal",
        "value": "Normal"
      },
      "serviceProviderCode": "ISLANDTON",
      "shortNotes": "Rear addition",
      "status": {
        "text": "Submitted",
        "value": "Submitted"
      },
      "statusDate": "2024-08-04 08:04:43",
      "totalFee": 250.0,
      "totalPay": 100.0,
      "trackingId": 287524530,
      "type": {
        "id": "Building-Residential-Alteration-NA",
        "module": "Building",
        "text": "Residential Alteration",
        "value": "Building/Residential/Alteration/NA"
      },
      "updateDate": "2024-08-05 10:12:00"
    }
  ]
}
```

### Update record

Change a record's name, description, notes, status, department or priority. Only the fields you fill in change.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.
- Name (`name`, text): A new name.
- Description (`description`, text): A new description.
- Short notes (`short_notes`, text): New short notes.
- Status (`status`, text): A new status, from the record type's statuses.
- Assigned department (`assigned_department`, text): The department to assign the record to.
- Priority (`priority`, text): A new priority.

**Outputs**

- `record` (object): The record as it is now

**Example output**

```json
{
  "record": {
    "assignedToDepartment": "ISLANDTON/BUILDING/NA/NA/NA/NA/NA",
    "assignedUser": "JSMITH",
    "balance": 150.0,
    "customId": "BLD-2024-00012",
    "description": "Residence alteration",
    "id": "ISLANDTON-14CAP-00000-000BR",
    "module": "Building",
    "name": "Kitchen remodel",
    "openedDate": "2024-08-04 00:00:00",
    "priority": {
      "text": "Normal",
      "value": "Normal"
    },
    "serviceProviderCode": "ISLANDTON",
    "shortNotes": "Rear addition",
    "status": {
      "text": "Submitted",
      "value": "Submitted"
    },
    "statusDate": "2024-08-04 08:04:43",
    "totalFee": 250.0,
    "totalPay": 100.0,
    "trackingId": 287524530,
    "type": {
      "id": "Building-Residential-Alteration-NA",
      "module": "Building",
      "text": "Residential Alteration",
      "value": "Building/Residential/Alteration/NA"
    },
    "updateDate": "2024-08-05 10:12:00"
  }
}
```

### Update workflow task

Set a workflow task's status (such as Approved), add a comment, or record who did it and the hours spent. A new status moves the record on as the agency's workflow says.

**Inputs**

- Record ID (`record_id`, text, required): The record's id (such as ISLANDTON-14CAP-00000-000BR), from 'Search records' or a trigger. The record number people see goes in 'Search records'.
- Workflow task (`task_id`, text, required): The task to update.
- Status (`status`, text): The task's new status, such as Approved. Setting it moves the record's workflow on as the agency has set it up.
- Comment (`comment`, text): A comment on the task.
- Status date (`status_date`, date): The day the status applies from. Defaults to today.
- Due date (`due_date`, date): A new due date for the task.
- Hours spent (`hours_spent`, number): Hours spent on the task. At least 0.
- Done by department (`action_by_department`, text): The department that did the work.
- Done by (`action_by_user`, text): The staff member who did the work. Pick the department first.

**Outputs**

- `task` (object): The task as it is now

**Example output**

```json
{
  "task": {
    "assignedToDepartment": {
      "text": "ISLANDTON/BUILDING/NA/NA/NA/NA/NA",
      "value": "ISLANDTON/BUILDING/NA/NA/NA/NA/NA"
    },
    "assignedUser": {
      "text": "JSMITH",
      "value": "JSMITH"
    },
    "comment": "All sheets approved.",
    "description": "Plans Review",
    "dueDate": "2024-08-20 00:00:00",
    "id": "1-345",
    "isActive": "Y",
    "isCompleted": "N",
    "processCode": "BLD_RESIDENTIAL",
    "status": {
      "text": "Approved",
      "value": "Approved"
    },
    "statusDate": "2024-08-06 00:00:00"
  }
}
```
