> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.rhombus.community/llms.txt
> Use this file to discover all available pages before exploring further.

# Get occupancy events for sensor

> Get recent events for specified proximity tag



## OpenAPI

````yaml https://api2.rhombussystems.com/api/openapi/public.json post /api/occupancy/getOccupancyEventsForSensor
openapi: 3.0.1
info:
  contact:
    email: developer@rhombussystems.com
  description: >-
    This API is for use by Rhombus customers and partners.


    ## Authentication


    All requests require two headers:

    - `x-auth-scheme` — The authentication scheme identifier. Use `api-token`
    for standard API key auth, or `partner-api-token` for partner API auth.

    - `x-auth-apikey` — Your Rhombus API key.


    Example:

    ```

    POST /api/camera/getMinimalCameraStateList

    x-auth-scheme: api-token

    x-auth-apikey: YOUR_API_KEY

    Content-Type: application/json

    ```
  title: Rhombus API
  version: '1.0'
servers:
  - description: Production Server
    url: https://api2.rhombussystems.com
security:
  - ApiKeyAuth: []
paths:
  /api/occupancy/getOccupancyEventsForSensor:
    post:
      tags:
        - Occupancy Webservice
      summary: Get occupancy events for sensor
      description: Get recent events for specified proximity tag
      operationId: getOccupancyEventsForSensor
      parameters:
        - description: >-
            Authentication scheme identifier. Use `api-token` for standard API
            key authentication, `partner-api-token` for partner API key
            authentication. Must be paired with the `x-auth-apikey` header
            containing your API key.
          example: api-token
          in: header
          name: x-auth-scheme
          required: true
          schema:
            type: string
            default: api-token
            enum:
              - api-token
              - api
              - partner-api-token
              - partner-api
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Occupancysensor_GetOccupancyEventsForSensorWSRequest
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Occupancysensor_GetOccupancyEventsForSensorWSResponse
          description: OK
components:
  schemas:
    Occupancysensor_GetOccupancyEventsForSensorWSRequest:
      type: object
      description: Request object for getting occupancy events for a specific sensor.
      properties:
        createdAfterMs:
          type: integer
          format: int64
          description: >-
            Filter events created after this timestamp (milliseconds since
            epoch)
          example: 1640908800000
          nullable: true
        createdBeforeMs:
          type: integer
          format: int64
          description: >-
            Filter events created before this timestamp (milliseconds since
            epoch)
          example: 1640995200000
          nullable: true
        limit:
          type: integer
          format: int32
          description: Maximum number of events to return
          example: 100
          nullable: true
        sensorUuid:
          type: string
          format: RUUID
          description: base 64 (url-safe) uuid string
          example: AAAAAAAAAAAAAAAAAAAAAA
          nullable: true
    Occupancysensor_GetOccupancyEventsForSensorWSResponse:
      type: object
      description: Response object containing occupancy events for a specific sensor.
      properties:
        error:
          type: boolean
          nullable: true
        errorMsg:
          type: string
          nullable: true
        events:
          type: array
          description: List of occupancy events for the sensor
          items:
            $ref: '#/components/schemas/OccupancyEventType'
          nullable: true
        warningMsg:
          type: string
          nullable: true
    OccupancyEventType:
      type: object
      description: List of occupancy events for the sensor
      properties:
        baseStationUuid:
          type: string
          format: RUUID
          description: base 64 (url-safe) uuid string
          example: AAAAAAAAAAAAAAAAAAAAAA
          nullable: true
        batteryPercentage:
          type: integer
          format: int32
          nullable: true
        bleDeviceUuid:
          type: string
          format: RUUID
          description: base 64 (url-safe) uuid string
          example: AAAAAAAAAAAAAAAAAAAAAA
          nullable: true
        bleRssi:
          type: integer
          format: int32
          nullable: true
        closeBaseStations:
          type: array
          items:
            type: string
            format: RUUID
            description: base 64 (url-safe) uuid string
            example: AAAAAAAAAAAAAAAAAAAAAA
            nullable: true
          nullable: true
        locationUuid:
          type: string
          format: RUUID
          description: base 64 (url-safe) uuid string
          example: AAAAAAAAAAAAAAAAAAAAAA
          nullable: true
        lux:
          type: integer
          format: int32
          nullable: true
        orgUuid:
          type: string
          format: RUUID
          description: base 64 (url-safe) uuid string
          example: AAAAAAAAAAAAAAAAAAAAAA
          nullable: true
        state:
          $ref: '#/components/schemas/OccupancyStateEnum'
        stateChanged:
          type: boolean
          nullable: true
        subLocationsHierarchyKey:
          type: string
          format: SubLocationsHierarchyKey
          description: |
            A sequence of one or more base 64 (url-safe) uuid substrings.
            These substrings are separated by dots (.).
          example: AAAAAAAAAAAAAAAAAAAAAA.AAAAAAAAAAAAAAAAAAAAAA.AAAAAAAAAAAAAAAAAAAAAA
          nullable: true
          pattern: ^([A-Za-z0-9\-_]{22})([.][A-Za-z0-9\-_]{22})*$
        tampered:
          type: boolean
          nullable: true
        timestampMs:
          type: integer
          format: int64
          nullable: true
    OccupancyStateEnum:
      type: string
      enum:
        - VACANT
        - MOVEMENT
        - OCCUPIED
  securitySchemes:
    ApiKeyAuth:
      description: >-
        Your Rhombus API key. Must be accompanied by the `x-auth-scheme` header
        set to `api-token` (or `partner-api-token` for partner endpoints).
      in: header
      name: x-auth-apikey
      type: apiKey

````