Skip to main content

Events REST API

Track and query user events via the REST API.

Endpoints

Log Event

Track a custom event.

POST /v1/apps/:appId/events

Request Body:

{
"eventId": "evt_purchase_completed",
"userId": "user_123",
"sessionId": "session_abc",
"metadata": {
"amount": 99.99,
"currency": "USD",
"productId": "prod_123"
}
}

Example Request:

curl -X POST \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"eventId":"evt_button_clicked","userId":"user_123"}' \
https://api.getresync.com/v1/apps/7/events

Example Response:

{
"success": true,
"eventId": "evt_purchase_completed",
"timestamp": "2025-11-23T10:00:00Z"
}

Query Events

Get events for analysis.

GET /v1/apps/:appId/events

Query Parameters:

ParameterTypeDescription
eventIdstringFilter by event ID
userIdstringFilter by user ID
startDatestringStart date (ISO 8601)
endDatestringEnd date (ISO 8601)
limitnumberNumber of results (default: 100, max: 1000)

Example Request:

curl -H "Authorization: Bearer your-api-key" \
"https://api.getresync.com/v1/apps/7/events?eventId=evt_purchase_completed&startDate=2025-01-01T00:00:00Z"

Example Response:

{
"data": [
{
"id": 789,
"eventId": "evt_purchase_completed",
"userId": "user_123",
"sessionId": "session_abc",
"metadata": {
"amount": 99.99,
"currency": "USD"
},
"timestamp": "2025-11-23T10:00:00Z"
}
],
"count": 1
}

Event Metadata

Include relevant context in metadata:

{
"eventId": "evt_purchase_completed",
"userId": "user_123",
"metadata": {
"amount": 99.99,
"currency": "USD",
"productId": "prod_123",
"category": "electronics",
"source": "mobile_app"
}
}

Event Retention

PlanRetention Period
All90 days
EnterpriseCustom

Next Steps