Events
Push Custom Event
Creates a custom event record associated with a user for tracking, and triggering downstream processes. Events are stored with optional categorization and custom data payload.
POST
/
event
Push Custom Event
curl --request POST \
--url https://prod.claimr.io/api/v1/event \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account": "user123",
"platform": "steam",
"pid": "campaign_abc123",
"name": "level_completed",
"id": "evt_xyz789",
"category": "gameplay",
"data": {
"level": 5,
"score": 1250,
"completion_time": 180
},
"ts": 1672531200
}
'import requests
url = "https://prod.claimr.io/api/v1/event"
payload = {
"account": "user123",
"platform": "steam",
"pid": "campaign_abc123",
"name": "level_completed",
"id": "evt_xyz789",
"category": "gameplay",
"data": {
"level": 5,
"score": 1250,
"completion_time": 180
},
"ts": 1672531200
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account: 'user123',
platform: 'steam',
pid: 'campaign_abc123',
name: 'level_completed',
id: 'evt_xyz789',
category: 'gameplay',
data: {level: 5, score: 1250, completion_time: 180},
ts: 1672531200
})
};
fetch('https://prod.claimr.io/api/v1/event', 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://prod.claimr.io/api/v1/event",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account' => 'user123',
'platform' => 'steam',
'pid' => 'campaign_abc123',
'name' => 'level_completed',
'id' => 'evt_xyz789',
'category' => 'gameplay',
'data' => [
'level' => 5,
'score' => 1250,
'completion_time' => 180
],
'ts' => 1672531200
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod.claimr.io/api/v1/event"
payload := strings.NewReader("{\n \"account\": \"user123\",\n \"platform\": \"steam\",\n \"pid\": \"campaign_abc123\",\n \"name\": \"level_completed\",\n \"id\": \"evt_xyz789\",\n \"category\": \"gameplay\",\n \"data\": {\n \"level\": 5,\n \"score\": 1250,\n \"completion_time\": 180\n },\n \"ts\": 1672531200\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://prod.claimr.io/api/v1/event")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account\": \"user123\",\n \"platform\": \"steam\",\n \"pid\": \"campaign_abc123\",\n \"name\": \"level_completed\",\n \"id\": \"evt_xyz789\",\n \"category\": \"gameplay\",\n \"data\": {\n \"level\": 5,\n \"score\": 1250,\n \"completion_time\": 180\n },\n \"ts\": 1672531200\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod.claimr.io/api/v1/event")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account\": \"user123\",\n \"platform\": \"steam\",\n \"pid\": \"campaign_abc123\",\n \"name\": \"level_completed\",\n \"id\": \"evt_xyz789\",\n \"category\": \"gameplay\",\n \"data\": {\n \"level\": 5,\n \"score\": 1250,\n \"completion_time\": 180\n },\n \"ts\": 1672531200\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"error": "Missing required parameters: pid, account, platform, or name"
}{
"success": true,
"error": {
"code": 401,
"message": "unauthorized"
}
}{
"success": true,
"error": {
"code": 403,
"message": "access denied"
}
}{
"success": true,
"error": {
"code": 500,
"message": "internal error"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
User account identifier
Example:
"user123"
Platform identifier where the user account exists
Example:
"steam"
Campaign ID associated with this event
Example:
"campaign_abc123"
Event name identifier
Example:
"level_completed"
Optional unique event identifier
Example:
"evt_xyz789"
Optional event category for grouping/filtering
Example:
"gameplay"
Optional custom data payload associated with the event
Example:
{
"level": 5,
"score": 1250,
"completion_time": 180
}
Optional timestamp (Unix timestamp). If not provided, current time will be used
Example:
1672531200
Response
Event created successfully
Example:
true
⌘I
Push Custom Event
curl --request POST \
--url https://prod.claimr.io/api/v1/event \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account": "user123",
"platform": "steam",
"pid": "campaign_abc123",
"name": "level_completed",
"id": "evt_xyz789",
"category": "gameplay",
"data": {
"level": 5,
"score": 1250,
"completion_time": 180
},
"ts": 1672531200
}
'import requests
url = "https://prod.claimr.io/api/v1/event"
payload = {
"account": "user123",
"platform": "steam",
"pid": "campaign_abc123",
"name": "level_completed",
"id": "evt_xyz789",
"category": "gameplay",
"data": {
"level": 5,
"score": 1250,
"completion_time": 180
},
"ts": 1672531200
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account: 'user123',
platform: 'steam',
pid: 'campaign_abc123',
name: 'level_completed',
id: 'evt_xyz789',
category: 'gameplay',
data: {level: 5, score: 1250, completion_time: 180},
ts: 1672531200
})
};
fetch('https://prod.claimr.io/api/v1/event', 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://prod.claimr.io/api/v1/event",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account' => 'user123',
'platform' => 'steam',
'pid' => 'campaign_abc123',
'name' => 'level_completed',
'id' => 'evt_xyz789',
'category' => 'gameplay',
'data' => [
'level' => 5,
'score' => 1250,
'completion_time' => 180
],
'ts' => 1672531200
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod.claimr.io/api/v1/event"
payload := strings.NewReader("{\n \"account\": \"user123\",\n \"platform\": \"steam\",\n \"pid\": \"campaign_abc123\",\n \"name\": \"level_completed\",\n \"id\": \"evt_xyz789\",\n \"category\": \"gameplay\",\n \"data\": {\n \"level\": 5,\n \"score\": 1250,\n \"completion_time\": 180\n },\n \"ts\": 1672531200\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://prod.claimr.io/api/v1/event")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account\": \"user123\",\n \"platform\": \"steam\",\n \"pid\": \"campaign_abc123\",\n \"name\": \"level_completed\",\n \"id\": \"evt_xyz789\",\n \"category\": \"gameplay\",\n \"data\": {\n \"level\": 5,\n \"score\": 1250,\n \"completion_time\": 180\n },\n \"ts\": 1672531200\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod.claimr.io/api/v1/event")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account\": \"user123\",\n \"platform\": \"steam\",\n \"pid\": \"campaign_abc123\",\n \"name\": \"level_completed\",\n \"id\": \"evt_xyz789\",\n \"category\": \"gameplay\",\n \"data\": {\n \"level\": 5,\n \"score\": 1250,\n \"completion_time\": 180\n },\n \"ts\": 1672531200\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"error": "Missing required parameters: pid, account, platform, or name"
}{
"success": true,
"error": {
"code": 401,
"message": "unauthorized"
}
}{
"success": true,
"error": {
"code": 403,
"message": "access denied"
}
}{
"success": true,
"error": {
"code": 500,
"message": "internal error"
}
}