Portal Data API

Programmatic access to engagement data from the Client Reporting Dashboard

Authentication

All endpoints (except /health) require an API key in the X-API-Key header.

curl -H "X-API-Key: your-api-key" https://portal-api.asperasalesagency.fi/stats
API Key Types:
Admin - Full access to all data, can filter by any client
Client - Access restricted to that client's data only

Endpoints

GET /engagements

List engagements with filtering and pagination.

Query Parameters

ParameterTypeDefaultDescription
date_fromdate30 days agoStart date (YYYY-MM-DD)
date_todatetodayEnd date (YYYY-MM-DD)
searchstring-Search in company, name, email, comment
statusstring-Filter by status (Dialogi, Onnistuminen, etc.)
companystring-Filter by company name (partial match)
pageint1Page number
sizeint50Results per page (max 1000)
clientstring-Admin only: filter by client name

Example

curl -H "X-API-Key: $API_KEY" \
  "https://portal-api.asperasalesagency.fi/engagements?date_from=2026-01-01&status=Onnistuminen&size=10"
GET /stats

Get engagement statistics (same calculations as the dashboard).

Query Parameters

ParameterTypeDefaultDescription
date_fromdate30 days agoStart date (YYYY-MM-DD)
date_todatetodayEnd date (YYYY-MM-DD)
clientstring-Admin only: filter by client name

Response

{
  "status_distribution": {"Dialogi": 95, "Onnistuminen": 32, "Vastaaja": 120},
  "dialogues_count": 127,
  "success_count": 32,
  "total_engagements": 247,
  "date_range": {"from": "2026-01-01", "to": "2026-01-31"}
}
GET /health

Health check (no authentication required).

curl https://portal-api.asperasalesagency.fi/health

Status Values

StatusDescription
OnnistuminenSuccess - meeting booked or deal created
DialogiDialogue - meaningful conversation
VastaajaVoicemail
Ei vastaaNo answer
KieltäytyiDeclined

Error Codes

CodeDescription
401Missing or invalid API key
403Access denied (e.g., client key accessing other client's data)
404Resource not found

Portal Data API v1.0.0 • Contact Support