Overview
The Nest protocol uses HTTP Basic Authentication on every request. The device embeds its serial number in the user ID field, allowing the server to identify any device from any request.This page covers device-level authentication on the Device Protocol API (port 8000). For the Control API (port 8082), see API Authentication.
HTTP Basic Auth
Every subscribe, PUT, and entry request includes:d.{SERIAL}.{suffix}:
Identity header fallback
Some non-production firmware configurations sendX-nl-client-id or X-nl-device-id headers instead of Basic Auth. On production firmware, Basic Auth is always present. Handle headers as fallback only:
| Header | Format | When sent |
|---|---|---|
Authorization: Basic | base64(d.{SERIAL}.{suffix}:pass) | Always (production firmware) |
X-nl-client-id | d.{SERIAL}.{suffix} | Non-production only |
X-nl-device-id | {SERIAL} (bare serial) | Non-production only, entry requests |
Credential Provisioning
The server can provision new credentials to the device by includingX-nl-set-client-credentials in any 200 response:
Recommended approach for NLE
The NLE self-hosted server skips credential provisioning entirely:- Accept all subscribe and PUT requests regardless of password
- Parse the device serial from the Basic Auth user ID
- Look up the device in the database by serial
Entry Key (Pairing Code)
During device setup, users must enter a code displayed on the thermostat to claim it. The device fetches this code from thepassphrase_url returned by /nest/entry.
Request
Response
| Field | Type | Notes |
|---|---|---|
value | string | 7-character alphanumeric code |
expires | number | Milliseconds since epoch — must be a JSON number, not a string |
XXX-XXXX format (e.g., A3X-R7M2). The expiration must be at least 30 minutes in the future.
The server returns the same unexpired key on repeated calls — generating a new key on each poll would invalidate the code before the user can enter it.
Pairing Completion
After the user enters the entry code, the server completes pairing by pushing two buckets to the device on its open subscribe connection: 1. User bucket — triggers pairing on the device:name field is what triggers pairing completion internally. Without it, the setup screen remains visible.
2. Structure bucket — establishes the device-home association:
Include both the user bucket and structure bucket on every subscribe reconnection for paired devices — not just at registration time. If the server restarts or the device reboots, the device re-registers and needs these buckets to restore pairing state.