Locations

Authentication: All endpoints require an Authorization: Bearer <access token> header.

Most endpoints require an X-Company-ID: <company_id> header to scope requests to a specific company. This is the recommended header for most API operations.

Some endpoints require an X-Location-ID: <location_id> header when the query doesn't accept a locationId parameter.

See Authentication for details on how to obtain and use these headers.

Query Locations

GraphQL Query

query Locations {
  locations {
    id
    name
    timeZone
    rosterable
    parentId
  }
}

Example Variables

{}

Example Response

{
  "data": {
    "locations": [
      {
        "id": "12325",
        "name": "Integration Sandbox",
        "timeZone": "Australia/Brisbane",
        "rosterable": true,
        "parentId": "0"
      },
      {
        "id": "12326",
        "name": "Brisbane Office",
        "timeZone": "Australia/Brisbane",
        "rosterable": true,
        "parentId": "12325"
      }
    ]
  }
}

Add Location

GraphQL Mutation

mutation AddLocation($input: AddLocationInput!) {
  addLocation(input: $input) {
    id
    name
    rosterable
  }
}

Example Variables

{
  "input": {
    "name": "Milton Office",
    "rosterable": true
  }
}

Example Response

{
  "data": {
    "addLocation": {
      "id": "12754",
      "name": "Milton Office",
      "rosterable": true
    }
  }
}

Update Location

GraphQL Mutation

mutation UpdateLocation($input: UpdateLocationInput!) {
  updateLocation(input: $input) {
    id
    name
    rosterable
  }
}

Example Variables

{
  "input": {
    "id": "12754",
    "name": "Park Road Office",
    "rosterable": true
  }
}

Example Response

{
  "data": {
    "updateLocation": {
      "id": "12754",
      "name": "Park Road Office",
      "rosterable": true
    }
  }
}

Delete Location

GraphQL Mutation

mutation DeleteLocation($id: ID!) {
  deleteLocation(id: $id)
}

Example Variables

{
  "id": "12761"
}

Example Response

{
  "data": {
    "deleteLocation": "12761"
  }
}

Restore Location

GraphQL Mutation

mutation RestoreLocation($id: ID!) {
  restoreLocation(id: $id)
}

Example Variables

{
  "id": "12761"
}

Example Response

{
  "data": {
    "restoreLocation": "12761"
  }
}