# RealGreen Service Assistant

> Work with RealGreen Service Assistant: add leads, find and update customers, flag accounts, read programs and services, and log calls.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/realgreen

## Actions

### Add call log

Log a contact with a customer or prospect: a call, an email or a visit, with its reason and a note.

**Inputs**

- Employee (`employee_id`, text, required): The employee logging it.
- Call reason (`call_reason_id`, text, required): Why the contact happened, as set up in Service Assistant.
- Note (`note`, text, required): What happened.
- Customer number (`customer_number`, text): The customer it is about.
- Status (`status`, text): The call log's status, as named in Service Assistant.
- Name (`name`, text): The caller's name, if not a customer.
- Phone number (`phone_number`, text): The caller's phone number.

**Outputs**

- `call_log_id` (text): The new call log's ID

**Example output**

```json
{
  "call_log_id": "77301"
}
```

### Add flag to customer

Put a flag on a customer's account, such as Dog on property.

**Inputs**

- Customer number (`customer_number`, text, required): The customer's number, from 'Search customers' or an earlier step.
- Flag (`flag_id`, text, required): The flag. Pick one, or give its ID.

**Outputs**

- `added` (true/false): True once added
- `customer_number` (text): The customer
- `flag_id` (text): The flag

**Example output**

```json
{
  "added": true,
  "customer_number": "10452",
  "flag_id": "3"
}
```

### Add lead

Add a lead the way RealGreen's web lead form does: a new prospect, or an update to the customer it matches, with a call log.

**Inputs**

- First name (`first_name`, text, required): The lead's first name.
- Last name (`last_name`, text, required): The lead's last name.
- ZIP code (`zip_code`, text, required): The property's ZIP code.
- Call reason (`call_reason_id`, text, required): Why the contact happened, as set up in Service Assistant.
- Street address (`street`, text): The property's street number and name.
- Email (`email`, text): The lead's email address.
- Cell phone (`cell_phone`, text): The lead's cell phone number.
- Home phone (`home_phone`, text): The lead's home phone number.
- Source (`source_code_id`, text): How they heard of you.
- Employee (`employee_id`, text): The employee.
- Notes (`notes`, text): Notes saved on the lead's call log.
- Branch (`branch_id`, text): The branch the lead belongs to.

**Outputs**

- `customer_number` (text): The lead's customer number
- `matching_customer_numbers` (list): Existing customers the lead matched, if any
- `message` (text): What RealGreen said

**Example output**

```json
{
  "customer_number": "10452",
  "matching_customer_numbers": [],
  "message": "Lead added"
}
```

### Find customers by phone

Find the customers with a phone number on their account, such as a caller's.

**Inputs**

- Phone number (`phone_number`, text, required): The phone number to look up.

**Outputs**

- `count` (number): How many were returned
- `customers` (list): The customers with that number

**Example output**

```json
{
  "count": 1,
  "customers": [
    {
      "address": {
        "addressLine1": "100 Main St",
        "city": "Toledo",
        "state": "OH",
        "zip": "43604"
      },
      "branchNumber": 1,
      "companyName": "",
      "displayName": "Jane Doe",
      "email": "jane@example.com",
      "firstName": "Jane",
      "id": 10452,
      "lastName": "Doe",
      "memo": "",
      "netBalance": 0,
      "phones": [
        {
          "isPreferred": true,
          "number": "4195550100",
          "phoneType": "Cell"
        }
      ],
      "since": "2026-04-02T00:00:00",
      "statusCharacter": "A",
      "techNote": "Gate on left side"
    }
  ]
}
```

### Get customer

Get one customer with their address, phones, balance and notes.

**Inputs**

- Customer number (`customer_number`, text, required): The customer's number, from 'Search customers' or an earlier step.

**Outputs**

- `customer` (object): The customer

**Example output**

```json
{
  "customer": {
    "address": {
      "addressLine1": "100 Main St",
      "city": "Toledo",
      "state": "OH",
      "zip": "43604"
    },
    "branchNumber": 1,
    "companyName": "",
    "displayName": "Jane Doe",
    "email": "jane@example.com",
    "firstName": "Jane",
    "id": 10452,
    "lastName": "Doe",
    "memo": "",
    "netBalance": 0,
    "phones": [
      {
        "isPreferred": true,
        "number": "4195550100",
        "phoneType": "Cell"
      }
    ],
    "since": "2026-04-02T00:00:00",
    "statusCharacter": "A",
    "techNote": "Gate on left side"
  }
}
```

### Get customer flags

List the flags on a customer's account.

**Inputs**

- Customer number (`customer_number`, text, required): The customer's number, from 'Search customers' or an earlier step.

**Outputs**

- `count` (number): How many were returned
- `flags` (list): The customer's flags

**Example output**

```json
{
  "count": 1,
  "flags": [
    {
      "customerNumber": 10452,
      "descriptions": "Dog on property",
      "flag": 3,
      "id": 901
    }
  ]
}
```

### Get program

Get one program with its price, status and schedule.

**Inputs**

- Program ID (`program_id`, text, required): The program's ID, from 'Search programs'.

**Outputs**

- `program` (object): The program

**Example output**

```json
{
  "program": {
    "created": "2026-11-30T15:04:05",
    "customerNumber": 10452,
    "dateSold": "2026-11-30T00:00:00",
    "id": 88101,
    "isComplete": false,
    "price": 289.0,
    "programCode": "LAWN6",
    "programDescription": "6-step lawn program",
    "status": "Active",
    "updated": "2026-11-30T15:04:05"
  }
}
```

### Get service

Get one service with its status, price, schedule and completion.

**Inputs**

- Service ID (`service_id`, text, required): The service's ID, from 'Search services'.

**Outputs**

- `service` (object): The service

**Example output**

```json
{
  "service": {
    "customerNumber": 10452,
    "dateCompleted": "2026-11-30T00:00:00",
    "id": 551200,
    "isPaid": false,
    "postedDate": "2026-11-30T00:00:00",
    "programID": 88101,
    "scheduledTime": "2026-11-30T09:00:00",
    "serviceCode": "R1",
    "serviceLongName": "Round 1 fertilizer",
    "serviceStatus": "S",
    "totalAmount": 48.17
  }
}
```

### List branches

List the business's branches (RealGreen calls them companies) with their numbers and phones.

**Inputs**: None.

**Outputs**

- `branches` (list): The branches
- `count` (number): How many were returned

**Example output**

```json
{
  "branches": [
    {
      "branchNumber": 1,
      "companyName": "Toledo",
      "id": 1,
      "isDefaultCompany": true,
      "phone1": "4195550000",
      "state": "OH"
    }
  ],
  "count": 1
}
```

### List call reasons

List the call reasons call logs and leads are filed under.

**Inputs**: None.

**Outputs**

- `call_reasons` (list): The call reasons
- `count` (number): How many were returned

**Example output**

```json
{
  "call_reasons": [
    {
      "actionReason": "New lead",
      "actionReasonID": 12,
      "status": "A"
    }
  ],
  "count": 1
}
```

### List employees

List active employees with their IDs, positions and departments.

**Inputs**: None.

**Outputs**

- `count` (number): How many were returned
- `employees` (list): The employees

**Example output**

```json
{
  "count": 1,
  "employees": [
    {
      "active": true,
      "department": "Lawn",
      "email": "jo@example.com",
      "id": "JSMITH",
      "name": "Jo Smith",
      "position": "Tech"
    }
  ]
}
```

### List flags

List the flags that can be put on customer accounts.

**Inputs**: None.

**Outputs**

- `count` (number): How many were returned
- `flags` (list): The flags

**Example output**

```json
{
  "count": 1,
  "flags": [
    {
      "available": true,
      "flagDescription": "Dog on property",
      "id": 3,
      "symbol": "D"
    }
  ]
}
```

### List service codes

List the service codes in use (the kinds of service you sell).

**Inputs**: None.

**Outputs**

- `count` (number): How many were returned
- `service_codes` (list): The service codes

**Example output**

```json
{
  "count": 1,
  "service_codes": [
    {
      "basePrice": 45.0,
      "id": "R1",
      "longName": "Round 1 fertilizer",
      "name": "R1",
      "programType": "L"
    }
  ]
}
```

### List source codes

List the source codes (how customers heard of you).

**Inputs**: None.

**Outputs**

- `count` (number): How many were returned
- `source_codes` (list): The source codes

**Example output**

```json
{
  "count": 1,
  "source_codes": [
    {
      "available": true,
      "id": 4,
      "sourceDescription": "Website"
    }
  ]
}
```

### Remove flag from customer

Take a flag off a customer's account.

**Inputs**

- Customer number (`customer_number`, text, required): The customer's number, from 'Search customers' or an earlier step.
- Flag (`flag_id`, text, required): The flag. Pick one, or give its ID.

**Outputs**

- `customer_number` (text): The customer
- `flag_id` (text): The flag
- `removed` (true/false): True once removed

**Example output**

```json
{
  "customer_number": "10452",
  "flag_id": "3",
  "removed": true
}
```

### Search call logs

Find call logs for a customer, added after a time, assigned to an employee or with a status.

**Inputs**

- Customer number (`customer_number`, text): Only this customer's call logs.
- Added after (`created_after`, date and time): Only call logs added after this time.
- Assigned to (`assigned_to`, text): Only call logs assigned to this employee.
- Status (`status`, text): Only call logs with this status.
- Page size (`records`, number): How many to return, 1 to 1,000. Defaults to 100. From 1 to 1000.
- Skip (`offset`, number): How many to skip, such as the next offset an earlier page gave. At least 0.

**Outputs**

- `call_logs` (list): The call logs
- `count` (number): How many were returned
- `next_offset` (number): The Skip value for the next page, or -1 if this was the last

**Example output**

```json
{
  "call_logs": [
    {
      "assignedTo": "JSMITH",
      "customerNumber": 10452,
      "dueDate": "2026-12-01T00:00:00",
      "enterDate": "2026-11-30T15:04:05",
      "enteredBy": "JSMITH",
      "id": 77301,
      "name": "Jane Doe",
      "phone": "4195550100",
      "resolved": false,
      "status": "Open"
    }
  ],
  "count": 1,
  "next_offset": -1
}
```

### Search customers

Find customers by name, company, email, ZIP, or when they were added or changed. Gets one page; to see more, run it again with the next offset.

**Inputs**

- First name (`first_name`, text): The customer's first name.
- Last name (`last_name`, text): The customer's last name.
- Company (`company_name`, text): The company name.
- Email (`email`, text): The customer's email address.
- ZIP code (`zip_code`, text): The customer's ZIP code.
- Added after (`created_after`, date and time): Only customers added after this time.
- Changed after (`updated_after`, date and time): Only customers changed after this time.
- Page size (`records`, number): How many to return, 1 to 1,000. Defaults to 100. From 1 to 1000.
- Skip (`offset`, number): How many to skip, such as the next offset an earlier page gave. At least 0.

**Outputs**

- `count` (number): How many were returned
- `customers` (list): The customers
- `next_offset` (number): The Skip value for the next page, or -1 if this was the last

**Example output**

```json
{
  "count": 1,
  "customers": [
    {
      "address": {
        "addressLine1": "100 Main St",
        "city": "Toledo",
        "state": "OH",
        "zip": "43604"
      },
      "branchNumber": 1,
      "companyName": "",
      "displayName": "Jane Doe",
      "email": "jane@example.com",
      "firstName": "Jane",
      "id": 10452,
      "lastName": "Doe",
      "memo": "",
      "netBalance": 0,
      "phones": [
        {
          "isPreferred": true,
          "number": "4195550100",
          "phoneType": "Cell"
        }
      ],
      "since": "2026-04-02T00:00:00",
      "statusCharacter": "A",
      "techNote": "Gate on left side"
    }
  ],
  "next_offset": -1
}
```

### Search programs

Find programs and special jobs (what a customer has bought), for one customer or sold or added after a time.

**Inputs**

- Customer number (`customer_number`, text): Only this customer's programs.
- Sold after (`sold_after`, date and time): Only programs sold after this time.
- Added after (`created_after`, date and time): Only programs added after this time.
- Page size (`records`, number): How many to return, 1 to 1,000. Defaults to 100. From 1 to 1000.
- Skip (`offset`, number): How many to skip, such as the next offset an earlier page gave. At least 0.

**Outputs**

- `count` (number): How many were returned
- `next_offset` (number): The Skip value for the next page, or -1 if this was the last
- `programs` (list): The programs

**Example output**

```json
{
  "count": 1,
  "next_offset": -1,
  "programs": [
    {
      "created": "2026-11-30T15:04:05",
      "customerNumber": 10452,
      "dateSold": "2026-11-30T00:00:00",
      "id": 88101,
      "isComplete": false,
      "price": 289.0,
      "programCode": "LAWN6",
      "programDescription": "6-step lawn program",
      "status": "Active",
      "updated": "2026-11-30T15:04:05"
    }
  ]
}
```

### Search services

Find services (the visits of a program), for one customer or program, of one service code, or posted (completed) in a time range.

**Inputs**

- Customer number (`customer_number`, text): Only this customer's services.
- Program ID (`program_id`, text): Only this program's services.
- Service code (`service_code`, text): Only services with this code.
- Posted after (`posted_after`, date and time): Only services posted (done) after this time.
- Posted before (`posted_before`, date and time): Only services posted before this time.
- Added after (`created_after`, date and time): Only services added after this time.
- Page size (`records`, number): How many to return, 1 to 1,000. Defaults to 100. From 1 to 1000.
- Skip (`offset`, number): How many to skip, such as the next offset an earlier page gave. At least 0.

**Outputs**

- `count` (number): How many were returned
- `next_offset` (number): The Skip value for the next page, or -1 if this was the last
- `services` (list): The services

**Example output**

```json
{
  "count": 1,
  "next_offset": -1,
  "services": [
    {
      "customerNumber": 10452,
      "dateCompleted": "2026-11-30T00:00:00",
      "id": 551200,
      "isPaid": false,
      "postedDate": "2026-11-30T00:00:00",
      "programID": 88101,
      "scheduledTime": "2026-11-30T09:00:00",
      "serviceCode": "R1",
      "serviceLongName": "Round 1 fertilizer",
      "serviceStatus": "S",
      "totalAmount": 48.17
    }
  ]
}
```

### Update customer

Change a customer's name, company, email, technician note, memo or directions. Only the fields given change.

**Inputs**

- Customer number (`customer_number`, text, required): The customer's number, from 'Search customers' or an earlier step.
- Email (`email`, text): A new email address.
- First name (`first_name`, text): A new first name.
- Last name (`last_name`, text): A new last name.
- Company (`company_name`, text): A new company name.
- Technician note (`technician_note`, text): A note technicians see on the account.
- Memo (`memo`, text): The account memo.
- Directions (`directions`, text): Directions to the property.
- Changed by (`employee_id`, text): The employee the change is recorded against.

**Outputs**

- `customer` (object): The customer

**Example output**

```json
{
  "customer": {
    "address": {
      "addressLine1": "100 Main St",
      "city": "Toledo",
      "state": "OH",
      "zip": "43604"
    },
    "branchNumber": 1,
    "companyName": "",
    "displayName": "Jane Doe",
    "email": "jane@example.com",
    "firstName": "Jane",
    "id": 10452,
    "lastName": "Doe",
    "memo": "",
    "netBalance": 0,
    "phones": [
      {
        "isPreferred": true,
        "number": "4195550100",
        "phoneType": "Cell"
      }
    ],
    "since": "2026-04-02T00:00:00",
    "statusCharacter": "A",
    "techNote": "Gate code 1234"
  }
}
```
