Your existing integration on v4 — what is identical, and what is not

Your integration keeps working. The URLs do not change, your API key does not change, and the JSON has the same shape. You do not need to do anything for the cutover.

This page lists the few fields that behave differently, so you can check them against what your integration uses. If none of them is a field you use, there is nothing for you to do.

This page covers the API whose URLs look like api/{locale}/public_access/{company_id}/….

What does not change

What changes, field by field

History before the cutover: the list has it, the detail does not

history/site/index returns your visits from before the cutover as well as the new ones, in one list, newest first, with the ids they always had. You do not need to call anything else.

What is different:

Visits made after the cutover have ids starting at 10,000,000, so an old id and a new one can never be the same number.

Visit detail: the nested breakdown has one service in it

On history/site/show, the tree underneath an operator — operators[].service_performances, and below it the service, the filled-in form, the equipment and the consumables — is still there. What changed is how much is in it.

A visit record is now one service at one site. Where a visit used to list several services, each service is now its own record, with its own id in history/site/index. So service_performances always has exactly one entry: the service that record is for.

Inside it:

Only one operator is listed on a visit, and the service is listed under them.

Fields that are always null now

They are still present in the response — your code will not break on a missing key — but there is nothing behind them.

field where why
ground_condition_id, weather_condition_id, weather_condition, ground_condition visit detail Conditions are recorded as values now, not as entries in a list
requirement, payment_date, billing_id, billing_status, no_editable_by visit list and detail No equivalent
on_site_time, off_site_time, in_geofence_time (and their _decimal forms) employee timesheets Not derived yet
shift_id visit list and detail A visit can now span more than one shift, so there is no single one to name
requirement, photos_limit, timezone_id, timezone, serviced_at, next_service_at, created_by, updated_by, address_notes sites No equivalent. province_id and country_id are filled in
uid, uid_provider sites, contractors The external identifier field is not carried over
the company's own settings — currency_id, the unit ids, photos_limit, approve_records_after, the colours, the deprecated_* and quickbooks_* fields contractor list, and the company under a route These are settings of the company, kept elsewhere now
role_type, role_type_id contacts Contact roles are a different list now and do not map
notes, template_route_id, event_id, available_after, notify_at routes No equivalent
device, devices users A phone's push-notification token identifies that phone; the apps register again with the new system, and it is not something to hand out through an API
hours_per_day, daily_cost, hourly_cost, quickbooks_item_id equipment Not carried over
cost, company_consumable_category consumable_category/index A consumable's cost is not carried over, and your rates are on the row itself (contractor_rate, sub_contractor_rate)
off_season_mode companies, wherever one is nested Off-season is part of billing now and is not published here

They are null rather than 0 on purpose: a zero would say "the crew spent no time on site", which would not be true.

These are filled in: first_site_started_at and last_site_ended_at on a timesheet, phone_code on a contact, and first_geofence_triggered_at / last_geofence_triggered_at on a visit.

Fields with a fixed value

field value why
map_icon "pin" Per-site icons are not carried over
weather_on false Per-site weather is a different feature now
images_exists false Photos moved to a separate service; answering this per row would make the list slow enough to time out. If you depend on it, tell us
photo_performances [] Same reason. The array is present, so iterating it is safe
favorite_count 0 On the contractor list. This counted you having pinned a client company, which is not something the new system has
walkthrough false On users. It recorded whether someone had seen the old app's tour
show_in_app true On services and on consumable_category/index. Hiding one from the app is not a switch any more; one that exists is shown
is_main false On companies. Company groups are not carried over

user_company_count on the contractor list still works: it is 1 when your own user is also a member of that client company, and 0 otherwise, as before.

Smaller differences

Routes: scheduled_for is now empty

A route used to be a thing with a date. It is now a standing definition that gets run — possibly many times, on many dates — so there is no single date to put in scheduled_for, and it comes back as null.

If you read it to find out when a route is next going out, read the new next_scheduled_for field beside it instead. We added a new name rather than putting a different meaning behind the old one, because a date that means something slightly different is worse than no date at all.

Routes: saving one with scheduled_for does not dispatch it

POST /route/store and PUT /route/update still accept scheduled_for, and do not act on it. The route is saved; nothing is scheduled; reading it back shows scheduled_for: null. You get a success response and no crew is sent.

This used to be how a route was sent out through the API. A route is now a standing definition, and sending it out is a separate step, done from Dispatch in the application.

If your integration schedules routes this way, tell us before the cutover.

Routes: sites join a route through the work contracted there

A route now carries work — a service at a site — rather than a bare list of sites. When you send sites[], the route gets the active work at each of those sites, in the order you sent them; send services[] as well and it is narrowed to those services.

Two things follow:

A route created without contractors[] is unassigned and cannot be sent out until somebody is put on it. Assigning another company requires an accepted agreement with it; otherwise the request is refused with Invalid Assigned Company.

Timesheet pay is current, not historical

rate and amount on an employee timesheet used to be stored on the row when the timesheet was generated, so they never moved afterwards. They are now calculated from the employee's current pay rate.

So changing someone's pay rate changes what their past timesheets report. If you reconcile one month against another, or keep your own copy of what a timesheet said at the time, that is the difference to know about. If you read a timesheet once and store the figures yourself, nothing changes for you.

Timesheet status has two values now, not three

It was approved, rejected or N/A. The new system has no way to record a reviewer rejected these hours, so rejected never appears. A case 'rejected': branch in your code still compiles and stops being entered; unreviewed hours are N/A as before.

Tags have different ids

A tag used to be stored once per thing it was on, so the same tag on three sites had three ids; it is now one tag with one id. The names are unchanged. If you store tag ids, rebuild that mapping once from the tags on each record.

Everything else keeps its original id — sites, routes, services, companies, contractors, contracts, timesheets, and people: a user, an operator on a timesheet or a visit, and a route's crew all carry the id you already have, and the operators[] filters accept it. Somebody added after the move gets a new id from 10,000,000 up.

People without an email

Somebody on your team with no email address signs in with their phone number, and is a user like anyone else. The exception is a number that is shared with another account or is incomplete: that person comes across as crew. They can still be put to work, but they are not a user — they are not in user/index, user/show with their id answers as it does for an unknown user, and they are not on a route's crew. Give them an email or a number of their own and they can be added as a user.

Subcontractors that never had an account

A subcontractor you work with that never had anybody signed up comes across as a company of its own, with the same id, so it is in sub_contractor/index and sub_contractor/show as before. To have them accept work in the application, invite someone from that company from the office.

A subcontractor sees the sites on the routes it is given

Work used to be handed to a subcontractor site by site, as a list of services at each site. It is now handed over by route: a subcontractor works, and its integration sees, the sites on the routes it has been put on. Nearly every site moved across that way, because it was already on a route given to the same subcontractor. A site that was handed over without one no longer shows up for the subcontractor until it is put on one of its routes.

A contact's role_type is null

A contact's role used to be a job title from a fixed list (CEO, Property Manager…). Contacts now record what they are for instead, which does not map onto those titles, so role_type_id and role_type are null. phone_type, and an address's province, country and type, keep their ids and their full objects.

Saving a client no longer deletes its contacts

This is the one place where we deliberately changed what the API does, because the old behaviour removed data without saying so.

POST /contractor/store used to delete every contact and address of a client on any call that did not include them. So this request —

{ "id": 4417, "name": "Northgate Mall Ltd" }

— renamed the client and silently removed all of its contacts, with a 200 and no mention of it.

From the cutover:

what you send what happens
no contacts key contacts are left exactly as they are
"contacts": [ … ] your list replaces what is there — anything not in it is removed, as before
"contacts": [] all contacts are removed, because you asked explicitly

addresses follows the same rule. If your integration was relying on a bare save to clear contacts, send "contacts": [] instead and you will get the old result.

The per-site services on the contract work the same way: a call with no contract.sites leaves the priced work alone, rather than removing it.

Writing: what is unchanged

The rules a write is checked against, the wording of a 422, and what each call answers with are the same as before — including the ones that are easy to trip on:

Two things did change on writes:

Writing: some fields are accepted and ignored

POST /site/store and PUT /site/update still accept everything they always did — nothing you send will be rejected for being a field we no longer have. But these are stored nowhere and reading the site back will not show them: map_icon, weather_on, uid, uid_provider, requirement.*, images[], measurements[], files[], tags[] and services[].

On POST /contractor/store, the per-contract equipment and consumable category rates are accepted and not stored. Those rates are now a property of your catalogue rather than of each client's contract, so there is nowhere to put a per-client one — and writing it to the catalogue would change the rate for every client.

users[] on the same endpoint is accepted and not acted on. It used to create a login for each person listed, on your client's company, and email them. No users are created and nobody is emailed; add a client's people from the application instead. If you depend on this, tell us.

On POST /route/store and PUT /route/update, notes, tags[], template_route_id, all_sites_required and sites[].skipped are accepted and not stored.

Three address fields need a mention because the behaviour is subtler:

The form feeds: contractor/dataprovider, equipment_category/index, consumable_category/index, consumable/dataprovider

These return the lists a form is built from. Most of what is in them is unchanged:

What changed:

Consumable categories are now your consumables

There used to be a fixed, system-wide list of consumable categories, and usage was recorded against a category. That list is gone. Usage is now recorded against your own consumables — the ones in consumable/index.

So wherever this API says "consumable category" — consumable_category/index, consumable/dataprovider, consumable_categories in contractor/dataprovider, and category under a visit's consumable_category_performances — the rows are your consumables, with their name, their group (snow, landscaping or misc) and their rates.

The ids are the ones you know. Each of your consumables carries the id of the category it was before the cutover, so a category id you stored still finds the same row. A consumable added after the cutover gets a new number.

consumable/index now has rows. It used to answer an empty list, because nothing was ever recorded in it. It now lists the same consumables, under their other name, so a client that read it expecting nothing will find your consumables there.

irrigation is misc. There are three groups now, so the consumables that were in irrigation are in misc.

Equipment with no category of its own is under "Uncategorised". Equipment in a category you had never set rates for used to be left out of equipment/index. It is listed now, in one "Uncategorised" category, with no rates, rather than under the category name it had before.

Looking a site up by uid no longer works

If you address sites by the numeric id, nothing changes. If you use the string uid — most often a Zapier setup — that lookup returns the same "not found" response it returns for any unknown id, because the field is not carried over. Switch to the numeric id, which you already receive in every response.

Not-found responses are unchanged, and they are not all the same

These are the responses you get today, and the responses you will go on getting:

you call with an unknown id, or one that is not yours you get
site/show 400 {"message": "Sorry, something went wrong. Contact us!"}
history/site/show 200 with a body of {}
report/employee_timesheet/show 422 with errors.id
contractor/show/{id} 400 {"message": "Invalid Company"}

We have deliberately not changed these into a consistent 404, because your error handling was written against them.

The 200 {} is the one to be aware of if you are writing new code against this API: it means you cannot tell "no such visit" from "a visit with no data". That was true before the cutover too.

Endpoints that were already failing

Two URLs in our logs have never once succeeded, and the reason is the same for both: they are not endpoints. They were not endpoints before the cutover either.

Both still answer 404, as they did before. If you would like either of them to exist, tell us.

history/shift/index rejects most calls, as it did before

GET /history/shift/index rejects about nine of every ten calls it receives, and has done so for months. Its parameter rules are unchanged after the cutover, so calls it rejected before are still rejected.

The rules it enforces, in case one of them is yours:

parameter rule
filter.routes[].id must be an existing route id
filter.operators[].id must be an existing user id
filter.ended_at must not be before filter.started_at
filter.search 100 characters or fewer
order must be an object, not a string — order[column]=name, not order=name

A stored id that has since been deleted is the most likely cause. If this endpoint matters to you, tell us and we will help you find which rule your calls are failing.

If something is wrong

Tell us, with the URL you called and the response you got. A difference that is not on this page is not intended, and we will look into it.