Skip to main content

Test data without live sensors

You do not need live sensors (or live occupants) to build an integration. XY Sense can provide a sandbox floor in dev mode, where you generate synthetic occupancy and sighting traffic on demand. Generated events flow through the same pipeline as real sensor data: they appear in polling queries and are delivered to registered webhooks.

Getting a dev-mode floor

Dev mode is enabled per floor by XY Sense. Ask your XY Sense representative to set up a sandbox floor (or enable dev mode on a test floor) for your integration.

Requirements

Generator mutations require write access on the API key (WritePublicApi), not just on your user account. If you get You are not authorized to access the 'generateOccupancyEvents' field, the key's scope in the Admin Console is the first thing to check.

A brand-new sandbox has no data until you generate some. If your first occupancyChanges poll returns empty results, generate events first.

Generator mutations

MutationWhat it does
generateOccupancyEventsToggles occupancy on randomly selected spaces on the floor. includeHeadcountChanges adds headcount-only events.
toggleOccupancyStatusToggles a single space between occupied and not occupied.
updateOccupancyStatusSets a specific space to a specific status, source, headcount, and collection time.
generateFloorSightingsEmits random sightings for a floor, optionally continuously for durationSecs.
addFloorSightingsSets exact sighting coordinates for a floor, useful for deterministic floor-plan tests.

Generate occupancy events

Open in API Explorer
mutation generateOccupancyEvents {
generateOccupancyEvents(floorId: "<floor guid>", count: 1, includeHeadcountChanges: true) {
floorSpaceId
headcount
occupancyStatus
previousOccupancyStatus
collectedDate
}
}

Example response

{
"data": {
"generateOccupancyEvents": [
{
"floorSpaceId": "ac52e43d-7c21-4464-ab21-d0ace07a94b1",
"headcount": 0,
"occupancyStatus": "NotOccupied",
"previousOccupancyStatus": "RecentlyOccupied",
"collectedDate": "2026-06-02T04:17:39.1066221Z"
}
]
}
}

Verify the data arrived

  • Polling: run occupancyChanges(includeLatest: true) for the floor and confirm the generated events appear. See Occupancy polling.
  • Webhooks: register a webhook first, then generate events and watch your receiver. There is a full walkthrough in Webhook test events.
  • Postman: the Postman collection includes the generate mutation and the polling loop as runnable requests.

Notes

  • Generated events are indistinguishable from real events downstream, so you can build your parsing, cursor handling, and idempotency against them with confidence.
  • Occupancy states still follow the normal state model (CurrentlyOccupiedRecentlyOccupiedNotOccupied over 30/60-second thresholds), so allow a minute if you are asserting on state transitions.
  • Analytics is processed overnight like everything else, so it cannot be generated on demand. Test analytics queries against a floor that had (real or generated) activity the previous day.