Skip to the content.

Sites API

With Sites api V4 you can:

List sites

Fetch a paginated list of sites.

See the optional response fields.

Optional params:

examples:

GET /api/v4/sites?team_id=26&updated_after=2022-05-24T19:30:30Z&orderby=updated_after+asc&fields=-id,-team_id,-boundaries,-info,-job_number,-address,-site_owner_id,-created_at
200 OK

[
  {
    "uuid": "1b14cac0-bd7f-11ed-9b4e-acde48001122",
    "name": "Doctor Jack-Jack",
    "location": "Point (174.77604159462516 -41.286319623500816)",
    "updated_at": "2023-03-08 20:01:53 +1300"
  },
  {
    "uuid": "f36290bc-bd82-11ed-9b4e-acde48001122",
    "name": "Captain Ant Claw",
    "location": "Point (77.61010151368907 75.81002131462157)",
    "updated_at": "2023-03-07 10:11:12 +1300"
  }
]

Create a site

Creates one site.

Input fields for create:
POST /api/v4/sites

{
  "site": {
    "uuid": "1b14cac0-bd7f-11ed-9b4e-acde48001122",
    "address": "Level 3/354 Lambton Quay, Wellington Central, Wellington 6011",
    "boundaries": "POLYGON ((174.7760662374219 -41.28628888757578, 174.77599163848276 -41.2863095461495, 174.77600806701338 -41.286352248914284, 174.77608819800787 -41.2863304566517, 174.7760662374219 -41.28628888757578))",
    "info": "Harum nihil non. Dolorem accusamus aut.\nRepudiandae suscipit perferendis. Nam iste aspernatur.",
    "job_number": "5af30ff1ce",
    "location": "Point (174.77604159462516 -41.286319623500816)",
    "name": "Doctor Jack-Jack",
    "site_owner_id": 35,
    "team_id": 26
  }
}
201 Created

{
  "id": 14,
  "uuid": "1b14cac0-bd7f-11ed-9b4e-acde48001122",
  "address": "Level 3/354 Lambton Quay, Wellington Central, Wellington 6011",
  "boundaries": "POLYGON ((174.7760662374219 -41.28628888757578, 174.77599163848276 -41.2863095461495, 174.77600806701338 -41.286352248914284, 174.77608819800787 -41.2863304566517, 174.7760662374219 -41.28628888757578))",
  "info": "Harum nihil non. Dolorem accusamus aut.\nRepudiandae suscipit perferendis. Nam iste aspernatur.",
  "job_number": "5af30ff1ce",
  "location": "Point (174.77604159462516 -41.286319623500816)",
  "name": "Doctor Jack-Jack",
  "site_owner_id": 35,
  "team_id": 26,
  "created_at": "2023-03-08 20:01:53 +1300",
  "updated_at": "2023-03-08 20:01:53 +1300"
}

Fetch a site

Get a site.

See the optional response fields.

GET /api/v4/sites/14?fields=boundaries
200 OK

{
  "id": 14,
  "uuid": "1b14cac0-bd7f-11ed-9b4e-acde48001122",
  "address": "Level 3/354 Lambton Quay, Wellington Central, Wellington 6011",
  "boundaries": "POLYGON ((174.7760662374219 -41.28628888757578, 174.77599163848276 -41.2863095461495, 174.77600806701338 -41.286352248914284, 174.77608819800787 -41.2863304566517, 174.7760662374219 -41.28628888757578))",
  "info": "Harum nihil non. Dolorem accusamus aut.\nRepudiandae suscipit perferendis. Nam iste aspernatur.",
  "job_number": "5af30ff1ce",
  "location": "Point (174.77604159462516 -41.286319623500816)",
  "name": "Doctor Jack-Jack",
  "site_owner_id": 35,
  "team_id": 26,
  "created_at": "2023-03-08 20:01:53 +1300",
  "updated_at": "2023-03-08 20:01:53 +1300"
}

Update a Site

Updates the allowed fields on one single site. It only updates the fields sent.

Input fields for update:
PATCH /api/v4/sites/123

{
  "site": {
    "address": "Level 3/354 Lambton Quay, Wellington Central, Wellington 6011",
    "boundaries": "POLYGON ((174.7760662374219 -41.28628888757578, 174.77599163848276 -41.2863095461495, 174.77600806701338 -41.286352248914284, 174.77608819800787 -41.2863304566517, 174.7760662374219 -41.28628888757578))",
    "info": "Ullam eum odit. Sed nostrum quos. Enim quae ut.\nDolorem quae accusantium. In aut facere. Rerum dolor aut.",
    "job_number": "5af30ff1ce",
    "location": "Point (174.77604159462516 -41.286319623500816)",
    "name": "Doctor Jack-Jack",
    "site_owner_id": 35,
  }
}
204 No Content

Response fields

You can use the fields query parameter in any of the Site API endpoints to configure what fields will be included in the response. All fields in bold are included by default but you can opt-out of them using the - prefix.