API Reference
Complete reference for the Solinth REST API.
15 min readUpdated December 2024
Overview
The Solinth API is a RESTful API that allows you to programmatically interact with your Solinth account. All requests use JSON and require authentication.
Base URL
https://api.solinth.com/v1Authentication
All API requests require a Bearer token in the Authorization header:
Authorization: Bearer sk_live_xxxxxxxxxxxxxAPI Key Security
Keep your API key secure. Never expose it in client-side code or commit it to version control.
Events
Track Event
POST /events
Send a single event to Solinth.
Request Body
{
"event": "purchase",
"timestamp": "2024-01-15T10:30:00Z",
"properties": {
"amount": 99.00,
"currency": "USD",
"customer_id": "cust_123"
}
}Response
{
"success": true,
"event_id": "evt_abc123"
}Batch Events
POST /events/batch
Send multiple events in a single request (up to 1000).
Request Body
{
"events": [
{ "event": "pageview", "properties": { "page": "/home" } },
{ "event": "signup", "properties": { "plan": "free" } }
]
}Metrics
Query Metrics
GET /metrics
Retrieve aggregated metrics.
Query Parameters
event(required) - Event name to querymetric- Aggregation type: count, sum, avg, min, maxproperty- Property to aggregate (for sum, avg, etc.)from- Start date (ISO 8601)to- End date (ISO 8601)interval- Grouping: hour, day, week, month
Response
{
"data": [
{ "date": "2024-01-01", "value": 1500 },
{ "date": "2024-01-02", "value": 1750 }
],
"total": 3250
}Dashboards
List Dashboards
GET /dashboards
Get Dashboard
GET /dashboards/:id
Create Dashboard
POST /dashboards
Update Dashboard
PATCH /dashboards/:id
Delete Dashboard
DELETE /dashboards/:id
Rate Limits
| Plan | Requests/Minute | Events/Day |
|---|---|---|
| Free | 100 | 10,000 |
| Pro | 1,000 | 1,000,000 |
| Enterprise | 10,000 | Unlimited |
Error Codes
| Code | Description |
|---|---|
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid API key |
403 | Forbidden - Insufficient permissions |
404 | Not Found - Resource doesn't exist |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error |
SDKs
We offer official SDKs for JavaScript, Python, Ruby, and Go. Check our GitHub for the latest versions.