Get Event
curl --request GET \
--url https://app.cometly.com/public-api/v1/events/{event_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.cometly.com/public-api/v1/events/{event_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.cometly.com/public-api/v1/events/{event_id}', 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://app.cometly.com/public-api/v1/events/{event_id}",
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://app.cometly.com/public-api/v1/events/{event_id}"
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://app.cometly.com/public-api/v1/events/{event_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.cometly.com/public-api/v1/events/{event_id}")
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{
"id": "<string>",
"profile_id": "<string>",
"company_id": "<string>",
"space_id": "<string>",
"event_name": "<string>",
"configured_name": "<string>",
"amount": 123,
"is_upsell": true,
"event_time_utc": "<string>",
"order_id": "<string>",
"order_name": "<string>",
"message": "<string>"
}Events
Get Event
Retrieve details of a specific event by its ID
GET
/
public-api
/
v1
/
events
/
{event_id}
Get Event
curl --request GET \
--url https://app.cometly.com/public-api/v1/events/{event_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.cometly.com/public-api/v1/events/{event_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.cometly.com/public-api/v1/events/{event_id}', 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://app.cometly.com/public-api/v1/events/{event_id}",
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://app.cometly.com/public-api/v1/events/{event_id}"
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://app.cometly.com/public-api/v1/events/{event_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.cometly.com/public-api/v1/events/{event_id}")
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{
"id": "<string>",
"profile_id": "<string>",
"company_id": "<string>",
"space_id": "<string>",
"event_name": "<string>",
"configured_name": "<string>",
"amount": 123,
"is_upsell": true,
"event_time_utc": "<string>",
"order_id": "<string>",
"order_name": "<string>",
"message": "<string>"
}Overview
This endpoint allows you to retrieve the details of a previously created event from Cometly.Path Parameters
string
required
The unique identifier of the event to retrieve
Response
Success Response
Returns the event object directly (not wrapped in adata property).
string
The unique identifier of the event
string
The identifier of the contact profile associated with this event
string
Your company identifier
string
The space identifier this event belongs to
string
The name of the event (e.g.,
purchase, custom_event_1)string
The configured name of the event. For custom events (
custom_event_1 through custom_event_50), this is the user-configured name. For standard events, this equals event_name.number
Transaction amount
boolean
Indicates if this is an upsell transaction
string
Timestamp of when the event occurred (UTC)
string
Order identifier
string
Order name or description
Error Response
string
Error description explaining what went wrong
Example Requests
curl https://app.cometly.com/public-api/v1/events/123456 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
const eventId = '123456';
const response = await fetch(`https://app.cometly.com/public-api/v1/events/${eventId}`, {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
});
const data = await response.json();
<?php
$eventId = '123456';
$url = 'https://app.cometly.com/public-api/v1/events/' . $eventId;
$headers = [
'Authorization: Bearer YOUR_API_KEY',
'Accept: application/json',
'Content-Type: application/json'
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
?>
import requests
event_id = '123456'
url = f'https://app.cometly.com/public-api/v1/events/{event_id}'
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
Status Codes
| Status Code | Description |
|---|---|
| 200 | Event successfully retrieved |
| 401 | Missing or invalid API key |
| 403 | API key doesn’t have permission or subscription is inactive |
| 404 | Event not found |
| 422 | Invalid event ID provided |
| 429 | Too many requests - rate limit exceeded. See Rate Limiting |
Notes
- Rate Limit: This endpoint has a limit of 30 requests per minute per Space. See Rate Limiting for details.