You will notice that events follow a pattern: resource.event. Our goal is to provide a consistent system that makes things easier to anticipate and code against.

Filtering Events

Events can be filtered to only show a single type using the event_type query parameter.

curl --request GET \
     --url 'https://api.flatpeak.com/events?event_type=location.create' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <token>'

Event Types

This is a list of all the types of events that are currently available from events API endpoint.

We may add more at any time, so in developing and maintaining your code, you should not assume that only these types exist.

EventDescription
customer.createOccurs whenever a customer is created.
customer.deleteOccurs whenever a customer is deleted.
customer.updateOccurs whenever a customer is updated.
customer.create.failedOccurs when customer creation has failed.
customer.delete.failedOccurs when customer deletion has failed.
customer.update.failedOccurs when customer update has failed.
location.createOccurs whenever a location is created.
location.deleteOccurs whenever a location is deleted.
location.updateOccurs whenever a location is updated.
location.create.failedOccurs when location creation has failed.
location.delete.failedOccurs when location deletion has failed.
location.update.failedOccurs when location update has failed.
device.createOccurs whenever a device is created.
device.deleteOccurs whenever a device is deleted.
device.updateOccurs whenever a device is updated.
device.create.failedOccurs when device creation has failed.
device.delete.failedOccurs when device deletion has failed.
device.update.failedOccurs when device update has failed.
schedule.createdOccurs when a new schedule is created for a location (beta).
tariff.expiringOccurs when a contract term for a tariff element is expiring.
tariff.expiredOccurs when a contract term for a tariff element has expired.
tariff.fetch.failedOccurs when attempts to sync a tariff element from an upstream data source (such as energy provider account) have failed.

Subscribing to events via Webhooks

You can subscribe to receive a webhook notification when an event occurs in your FlatPeak account. To setup, visit the webhooks section in the Dashboard. There is also a documentation article explaining how to work with FlatPeak webhooks.