GET /users/{entityId}

Returns all users belonging to a specific entity. The uuid in each row is the users_entities UUID — use it in the endpoints below.

Path parameters

ParameterDescription
entityIdEntity UUID from GET /entities

Response 200

{
  "status": "success",
  "message": "Users retrieved successfully",
  "count": 2,
  "data": {
    "users": [
      {
        "name": "Bob",
        "userType": "nonUser",
        "uuid": "<user-entity-uuid>",
        "startTime": "2024-04-23T14:00:00.000Z",
        "endTime": null,
        "externalReferenceId": null
      }
    ]
  }
}

curl

curl -s \
  -H "Authorization: SQRv1 Credential=<key>, Timestamp=<ts>, Signature=<sig>" \
  -H "X-SQR-Content-Hash: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" \
  "/users/<entityId>"
PATCH /user/{userId}

Updates a user's startTime and/or endTime. At least one field is required. Set endTime to null for open-ended access, or to the current timestamp to immediately expire the user.

Only updates the users_entities row — changes take effect at the user's next scan.

Path parameters

ParameterDescription
userIdUser-entity UUID from GET /users/{entityId}

Request body

FieldTypeDescription
startTimestring | nullISO 8601
endTimestring | nullISO 8601. null = open-ended.
{ "startTime": "2025-03-27T00:00:00Z", "endTime": "2026-05-01T00:00:00Z" }

Response 200

{ "status": "success", "message": "User updated successfully" }

curl

curl -s -X PATCH \
  -H "Authorization: SQRv1 Credential=<key>, Timestamp=<ts>, Signature=<sig>" \
  -H "X-SQR-Content-Hash: <sha256-of-body>" \
  -H "Content-Type: application/json" \
  -d '{"endTime":"2026-05-01T00:00:00Z"}' \
  "/user/<userId>"
GET /user/{userId}/groups

Returns all groups the user currently belongs to within entities linked to this integration.

Response 200

{
  "status": "success",
  "message": "Groups retrieved successfully",
  "count": 1,
  "data": { "groups": [{ "name": "Room 1", "uuid": "<group-uuid>" }] }
}

404 — user exists but has no group memberships.

POST /user/{userId}/groups

Adds and/or removes a user from groups in a single call. Both fields are optional but at least one should be provided. Group membership changes take effect immediately at the next device scan.

Request body

{
  "addGroupIds": ["<group-uuid-1>"],
  "removeGroupIds": ["<group-uuid-2>"]
}

Response 200

{ "status": "success", "message": "User groups modified successfully", "addCount": 1, "removeCount": 1 }

curl

curl -s -X POST \
  -H "Authorization: SQRv1 Credential=<key>, Timestamp=<ts>, Signature=<sig>" \
  -H "X-SQR-Content-Hash: <sha256-of-body>" \
  -H "Content-Type: application/json" \
  -d '{"addGroupIds":["<group-uuid>"]}' \
  "/user/<userId>/groups"