

# iglooKey

iglooKey is a shareable digital key. Your application creates an iglooKey for one or more devices and sends the recipient a link. The recipient opens the link on their phone and unlocks the lock over Bluetooth.

## How It Works

```mermaid
sequenceDiagram
  Note over Your Server, Our Server: igloohome API
  Your Server->>Our Server: Create iglooKey
  Our Server-->>Your Server: Shareable link
  Your Server->>Recipient: Shareable link
  Recipient->>Lock: Open link and unlock
  Lock->>Lock: Unlock
```

1. Your application creates an iglooKey for the devices the recipient needs.
2. You send the shareable link to the recipient.
3. The recipient opens the link on their phone and unlocks the lock.
4. You can change the validity of an iglooKey, or revoke it when access must end.

Create, update, and revoke iglooKeys with the iglooKey endpoints in the [Access API Reference](/home/api_access#iglookey). To be notified when an iglooKey is claimed or used, see [iglooKey Events](/home/iglookey-events).

## Validity

| Setting | Explanation |
| --- | --- |
| Validity window | The iglooKey works from its start time until its end time. |
| Activation window | Optional. The recipient must open the iglooKey within this time after the start time. |
| Offline access | How long the iglooKey keeps working without an internet connection, up to 24 hours. Defaults to 24 hours. Once it runs out, the recipient's phone must go online to restore offline unlock, as long as the iglooKey is still within its validity window. |

## Online and Offline Unlock

Every iglooKey supports both online and offline unlock. The recipient's phone checks for an internet connection at unlock time and uses the matching behavior:

- **Offline:** The phone unlocks the lock.
- **Online:** The phone unlocks the lock and also does the following:
  - Syncs the activity logs from the device. Each sync retrieves only a few logs, so a lock with many saved logs can take several online unlocks to clear its stored activity logs.
  - Reads the device battery level.
