Skip to main content
GET
/
events
List all events
curl --request GET \
  --url https://api.flatpeak.com/events \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.flatpeak.com/events"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.flatpeak.com/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flatpeak.com/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.flatpeak.com/events"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.flatpeak.com/events")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.flatpeak.com/events")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "object": "list",
  "url": "/events",
  "has_more": true,
  "data": [
    {
      "id": "evt_65e42b7827c0526548432b9f",
      "object": "event",
      "time_created": "2022-01-24T14:15:22Z",
      "type": "device.create",
      "data": {
        "id": "dev_63a6087272941ef077a8fd3e",
        "object": "device",
        "live_mode": true,
        "reference_id": "DEV1234567890",
        "time_created": "2022-01-24T14:15:22Z",
        "account_id": "acc_661677911f2197045e6cf1b1",
        "last_seen": "2022-03-22T11:12:21Z"
      }
    }
  ]
}
{
"object": "error",
"type": "invalid_request",
"code": "access_denied",
"time_created": "2025-01-01T00:00:00Z"
}
{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"time_created": "2025-01-01T00:00:00Z"
}
{
"object": "error",
"type": "rate_limit",
"code": "too_many_requests",
"message": "Too many requests. Please retry after a short delay.",
"time_created": "2026-01-29T17:11:52Z"
}

Authorizations

Authorization
string
header
required

Authenticate with bearer you obtained from authentication endpoint.

Query Parameters

event_type
string

Type of event.

starting_after
string

Specifies a cursor for pagination use; provider_id defines the place in the list. To retrieve the next page in the list include starting_after where ID is the last ID in the currently retrieved list.

ending_before
string

Specifies a cursor for pagination use; provider_id defines the place in the list. To retrieve the previous page in the list, include ending_before, which is the first ID in the currently retrieved list.

limit
integer

A limit on the number of objects to be returned. Can range between 1 and 100, and the default is 30.

object_id
string

Filter events by Flatpeak identifier such as a location ID.

Example:

"loc_641b90b758fb8e6293716e40"

Response

object
string

Represents the object’s type. i.e. list.

Example:

"list"

url
string

Represents the URL slug for the object.

Example:

"/events"

has_more
boolean

Is set to true if more objects are available.

data
object[]