Skip to main content
A service location is a business or service-area location of your company, for example an airport office or a depot. It has an address, tags and airport codes. It is shown on your company profile.
This page is about business locations. For GPS tracking, see Location overview.
All routes on this page belong to the Connect API service. Read Connect API conventions first. It explains the base URL, authentication, Idempotency-Key, If-Match, pending operations and the error format. This page uses $CONNECT_API_BASE_URL for the base URL. Ask GRiDD support (support@grdd.net) for the Connect API base URL for your environment.

What is available

Service location routes are implemented as owner routes (your own company) and as one authenticated read of another company’s published locations. The source does not mark this type as incomplete. The Connect API README names only Fleets and Vehicles as complete production implementations. This page describes the route contracts in the source and does not claim more.

Endpoints

Owner routes

These routes act on the company in your token.

Read another company’s published locations

This route returns a reduced record (PublicLocation). It returns only active locations that your relationship with the company allows. A confirmed partner of the company can also see partners locations. If the partnership cannot be confirmed, the API returns only public and gnet locations. If the owning company’s plan limits the published items that a viewer can see, the response holds only the first location and has lockedCount and lockedSlugs. Use lockedSlugs for matching only. Do not show them.

Not for external use

These routes exist in the service. They need a Service credential, an administrator role or another internal identity. Do not call them.
  • GET /api/locations/published, GET /api/locations/published/{griddid}, GET /api/locations/published/radius and GET /api/locations/pages/{slug} use the public website renderer credential.
  • GET /api/locations/system/{griddid} is for administrators.
  • POST /api/locations/index rebuilds the search index for all companies. It needs an administrator role or a service credential.
GET /api/locations/pages is not described here because its response is an untyped list of page records. The location search helpers POST /api/location-resolutions and GET /api/location-suggestions are part of search. They are not part of the location write flow. They are not described on this page.

Authentication and access

  • Send Authorization: Bearer YOUR_ACCESS_TOKEN. See Authentication.
  • The owner routes do not check a role in the token.
  • Location cap. Creating a location, and changing an inactive location to active, counts against a plan limit on active locations. The limits in the subscription contract in source are: Io 1, Basic 1, Professional 2, Premium 6, Enterprise unlimited. An active trial lifts the limit. Updates that do not activate a location, deleting, and deactivating are not limited, so an account over the limit can still clean up.
  • When the limit is reached, or the subscription is lapsed, the API returns 403 entitlement_denied. If the plan cannot be determined, it returns 503 temporarily_unavailable.

Location fields

Read record

Write body

All write bodies are strict. Unknown keys return 400 invalid_request. Create (POST /api/locations): Fields in location: Update (PATCH /api/locations/{slug}): the same body shape, but location can hold any subset of the fields above and none is required. contentLanguage must be update_version or add_version. Send If-Match and Idempotency-Key. Delete (DELETE /api/locations/{slug}): optional query locale and languageVersion. Send If-Match.

Coordinates

The location field is a free string in the contract. The service reads it as "longitude,latitude", for example "-80.2870,25.7959". This is the same form that the legacy core content route returns.

Airport codes

If you send airport_codes and a location with usable coordinates, the API checks the codes. A code that is more than 161 km (100 statute miles) from the location is rejected. The API skips codes that are not in its airport list. It does not check a location at 0,0. The response is 422 with code: "domain_rejected", message: "airport_out_of_range" and the codes in fieldErrors.airport_codes. No record is written.

Create a location

201 Created with the header ETag: "v1":
If follow-up work is not finished, the response is 202. It has status: "pending", an operationId and an effects list. See Pending operations.

Read your locations

Response 200. The record below is based on the fixture location-record.json. The fixture writes location as "25.7959,-80.2870". This page uses the "longitude,latitude" order that the service reads. See Coordinates.
The list has no pagination parameters. GET /api/locations/{slug} returns one record and the header ETag: "v2". If the slug does not belong to your company, the response is 404 not_found.

Update a location

Send the version you read in If-Match:
The response is 200 with the same shape as the create response (data, invalidated, status) and a new ETag. A pending update returns 202. A stale If-Match returns 412 version_conflict.
tags: [] removes all tags. When you omit a field, the API does not change it. When you send null or an empty list for a field that allows it, the API clears the field.

Delete a location

  • 204 No Content when the delete is complete.
  • 202 with status: "pending" and an operationId when follow-up work is not finished. The body has data: null, invalidated, status: "pending", operationId and effects.
Resume a pending operation:

Errors

Error bodies use the problem format. These codes come from the location routes.