Skip to content

Get started in five minutes

Sign up. It is instant: a bot check, a password under the same policy the household console enforces, and a verification email. Nothing reaches a house, and no key exists until your email is real.

The link in the email opens your sandbox: a tenant of your own with a home, four rooms and five virtual devices joining the broker, and your first alyt_dev_ key, shown once. Copy it. It is stored only as a hash; a lost key is replaced from the dashboard, never revealed. While this browser tab is open, the samples below and the reference carry that key in place of alyt_dev_....

Every request carries the key as a bearer token and names the tenant it acts on. Your sandbox tenant id is on the account page.

Terminal window
export ALYT_KEY="alyt_dev_..."
export TENANT="your-sandbox-tenant-id"
curl -s https://developers.alyt.com/api/v1/properties?tenantId=$TENANT \
-H "Authorization: Bearer $ALYT_KEY"

The same call with the SDK, which is generated from the contract, so every operation on the reference is a typed method:

import { createAlyt } from "alyt-sdk";
const alyt = createAlyt({ apiKey: process.env.ALYT_KEY! });
const { data, error } = await alyt.propertiesList({ query: { tenantId: process.env.TENANT! } });

The answer is your home. Every list is { items, nextCursor }; every response carries the IETF RateLimit fields so you see your allowance before you hit it.

Terminal window
PROPERTY=$(curl -s "https://developers.alyt.com/api/v1/properties?tenantId=$TENANT" -H "Authorization: Bearer $ALYT_KEY" | jq -r '.items[0].id')
curl -s "https://developers.alyt.com/api/v1/rooms?tenantId=$TENANT&propertyId=$PROPERTY" -H "Authorization: Bearer $ALYT_KEY" | jq '.items[] | {id, name}'
curl -s "https://developers.alyt.com/api/v1/devices?tenantId=$TENANT" -H "Authorization: Bearer $ALYT_KEY" | jq '.items[] | {id, name, capabilities, status}'

A device is a set of capabilities, and each capability a list of controls. The light’s power is a toggle; commands use the thing envelope the console uses.

Terminal window
LIGHT=$(curl -s "https://developers.alyt.com/api/v1/devices?tenantId=$TENANT" -H "Authorization: Bearer $ALYT_KEY" | jq -r '.items[] | select(.capabilities | index("LIGHT")) | .id')
curl -s -X POST "https://developers.alyt.com/api/v1/devices/$LIGHT/commands?tenantId=$TENANT" \
-H "Authorization: Bearer $ALYT_KEY" -H "content-type: application/json" \
-d '{"command":"set","payload":{"capability":"light","key":"power","value":true}}'

The command is queued, published on the device’s commands topic, and acknowledged by the virtual light within a few seconds. Read the device again and its reported state says power: true:

Terminal window
curl -s "https://developers.alyt.com/api/v1/devices/$LIGHT?tenantId=$TENANT" -H "Authorization: Bearer $ALYT_KEY" | jq '.reported.payload.light'

From the simulator, run the flapping scenario on the sensor: the broker’s last will marks it offline within seconds and the platform derives the alert. offline holds the socket open and says nothing, which is the wedge case the heartbeat window exists for.

Last updated