Leads

Retrieve a list of Leads

Changed on

Retrieves a paginated list of Leads, optionally filtered by date range. When no date filter is provided, results default to the last 30 days by scheduled date (date). Pass dateProperty, dateOperator, and date together to override this default.

get/v2/leads

Request

Query parameters

pageSizenumber
Example:10

Number of records to return per page.

pagenumber
Example:1

The page index.

field'created' | 'updated' | 'statusUpdated' | 'utcUpdated'

The field to sort results by. Must be combined with order.

order'ASC' | 'DESC'

The sort direction. Must be combined with field.

isOpenboolean
Example:true

When true, returns only open (not lost) leads. When false, returns only lost leads. When omitted, no filter is applied.

dateProperty'date' | 'endDate' | 'utcUpdated' | 'updated' | 'created'

The lead date field to apply the date filter to. Must be combined with dateOperator and date. When these date filter params are omitted, results default to the last 30 days by scheduled date (date).

dateOperator'prev' | 'next' | 'between'

Comparison operator for the date filter. Must be combined with dateProperty and date.

datestring

Date value(s) for the filter. Format depends on dateOperator: prev / next accept a single date (YYYY-MM-DD); between accepts two dates separated by _ (YYYY-MM-DD_YYYY-MM-DD).

Headers

Authorizationstring required
Example:Bearer <token>

Bearer Token

Response

A paginated list of Leads.

pageSizenumber

The maximum number of items returned per page.

pagenumber

The current page number.

totalResultsnumber

The total number of results.

hasMoreboolean

Whether there are more results.

Example response

{
  "pageSize": 10,
  "page": 1,
  "totalResults": 50,
  "hasMore": true,
  "data": [
    {
      "id": "LD-LwqGJnRwvZPaNe5E",
      "uuid": "GD87TS",
      "serialId": 12345,
      "status": "Submitted",
      "date": "2022-01-01 10:00:00",
      "endDate": "2022-01-01 10:00:00",
      "isAllDay": true,
      "isScheduled": true,
      "jobType": {
        "id": "JT-8718036049ec4c4d",
        "name": "Repair"
      },
      "adGroup": {
        "id": "AG-71b8d7310acbf8cc",
        "name": "Ad Group 1"
      },
      "description": "This is a description of the lead.",
      "leadLost": true,
      "clientInfo": {
        "clientId": "CL-OvmDp2yvv1yqMwRl",
        "serialId": 1023,
        "firstName": "John Doe",
        "lastName": "Doe",
        "companyName": "Sample Company name",
        "email": "client@workiz.com",
        "primaryExt": "619",
        "primaryPhone": "6195555555",
        "secondaryExt": "613",
        "secondaryPhone": "6195555555",
        "addressDetails": {
          "country": "US",
          "state": "Ohio",
          "city": "San Francisco",
          "zipCode": "94102",
          "address": "462 Powell St",
          "unit": "3422",
          "latitude": -76.2768398,
          "longitude": 36.9669587,
          "locationKey": "462 Powell St, San Francisco, Ohio 94102"
        },
        "serviceArea": {
          "id": "SA-71b8d7310acbf8cc",
          "name": "San Francisco"
        }
      },
      "team": [
        {
          "id": "USR-38c1ee5c4efa38a4",
          "name": "John Doe"
        }
      ],
      "tags": [
        {
          "id": "TAG-8cddc18e7b0458fa",
          "name": "Estimate"
        }
      ],
      "customFields": [
        {
          "id": "CF-eYLPK7198xVp6Z8q",
          "fieldName": "Custom Field 1",
          "value": "John Doe"
        }
      ],
      "notes": [
        {
          "id": "JNT-8cddc18e7b0458fa",
          "techName": "John Doe",
          "note": "This is a note",
          "timestamp": "2022-01-01 10:00:00"
        }
      ],
      "statusUpdated": "2022-01-01 12:00:00",
      "utcUpdatedAt": "2022-01-01 12:00:00",
      "updatedAt": "2022-01-01 12:00:00",
      "createdAt": "2022-01-01 10:00:00"
    }
  ]
}

Changes

    • breaking

      the response property /////// became nullable for the status

    • info

      added the new enum value updated to the query request parameter dateProperty

    • info

      added the media type application/json for the response with the status

    • info

      added the media type application/json for the response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status