Create Events with Device Token
Create Events with Device Token
Enable devices to create events directly with the Hyperion platform using monitorable access tokens.Overview
The primary use case for monitorable access tokens is enabling devices -- such as alarm panels, IoT sensors, cameras, and mobile apps -- to create events directly with the Hyperion platform without exposing partner-level credentials.
A monitorable token is scoped to a single monitorable, giving the device just enough access to report events. This is ideal for scenarios where:
- Alarm panels need to report intrusion, fire, or panic events in real time
- IoT sensors detect environmental changes (smoke, water, temperature) and need to notify Hyperion
- Mobile apps allow end users to trigger manual alerts from their device
- Connected cameras detect motion or other activity and create corresponding events
How It Works
- Your backend generates a monitorable access token using your partner credentials
- The token is provisioned onto the device
- The device uses the token to create events directly via the
/eventsendpoint - Hyperion processes the event and triggers the appropriate monitoring response
Getting Started
Before creating events with a device token, you need:
- An application with the
monitorable:token:writeandevent:writescopes. If you haven't created an application yet, see the Create Application API Reference to get started. - An existing monitorable to create events for. See the Monitor Persons guide if you need to create one.
Once you have your application credentials, use the Set Access Token button in the navbar to configure your partner access token for making API requests.
Step 1: Generate a Monitorable Access Token
Events created with a device token must use a monitorable-scoped token. First, generate a token for the monitorable that will be provisioned onto the device.
Enter your monitorable ID in the path parameter field below and send the request:
Response
Upon successful generation, you'll receive an access token. Click the Copy access token button in the response to copy it to your clipboard.
{
"accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"tokenType": "Bearer",
"expiresIn": 86400
}
Step 2: Create an Event with the Device Token
Now that you have copied the monitorable token, you can create events as the device would. An event represents an occurrence related to a monitorable, such as an alarm, alert, or status change.
To create an event, paste your monitorable access token in the field below and send a POST request to the /events endpoint with the event details:
Response
Upon successful creation, you'll receive a response containing the event details:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"externalId": "ext-event-12345",
"partnerId": "550e8400-e29b-41d4-a716-446655440001",
"monitorableId": "550e8400-e29b-41d4-a716-446655440002",
"systemStatus": "ACTIVE",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
Conclusion
You've successfully created an event using a monitorable device token. In a production environment, this flow allows devices to report events directly to the Hyperion platform without requiring partner-level credentials on the device itself.
Next Steps
- Create Events - Learn how to create events using your partner access token
- Receive Notifications - Set up webhooks to receive event notifications
Learn More
Related Concepts
- Events - Understanding event types and structure
- Monitorables - Entities that events are associated with
- Webhooks - Receiving event notifications
API Reference
- Generate Monitorable Token - Create a monitorable access token
- Create Event - Create a new event
- Get Event - Retrieve event details
- List Events - List all events