Recipe: Sync roster

Mirror your HR roster into BriefQR operators. The ident is the worker’s unique code; employee_id links back to your system.

Create an operator

curl -X POST https://api.briefqr.com/v1/operators 
  -H "Authorization: Bearer bqr_live_..." 
  -H "Content-Type: application/json" 
  -H "Idempotency-Key: hr-sync-NURSE01" 
  -d '{ "ident": "NURSE01", "name": "Jane Doe", "employee_id": "E-1" }'

The Idempotency-Key makes a re-run safe — a repeated create returns the original operator instead of erroring. A genuinely duplicate ident (different request) returns 409 (code: duplicate_ident).

Update or deactivate

# rename / relink
curl -X PATCH https://api.briefqr.com/v1/operators/{id} 
  -H "Authorization: Bearer bqr_live_..." 
  -d '{ "name": "Jane A. Doe", "employee_id": "E-1" }'

# offboard (soft delete — history is preserved)
curl -X DELETE https://api.briefqr.com/v1/operators/{id} 
  -H "Authorization: Bearer bqr_live_..."

DELETE deactivates (is_active: false); it never destroys past sessions. Re-activate by PATCHing is_active: true.

Reconcile

List everyone and diff against your source of truth:

def all_operators(headers):
    cursor, out = None, []
    while True:
        params = {"limit": 200, **({"cursor": cursor} if cursor else {})}
        page = requests.get("https://api.briefqr.com/v1/operators",
                            headers=headers, params=params).json()
        out += page["data"]
        if not page["has_more"]:
            return out
        cursor = page["next_cursor"]

Match on employee_id, create the missing, deactivate the departed. To react to changes made inside BriefQR, subscribe to the operator.* webhooks.