API Reference
The Perly REST API lets you programmatically manage customers, query health scores, ingest events, and configure integrations. All endpoints return JSON and use standard HTTP status codes.
https://api.perly.aiBearer <YOUR_API_KEY>Quick example
curl -X GET "https://api.perly.ai/v1/customers?limit=10" \
-H "Authorization: Bearer pk_live_..." \
-H "Content-Type: application/json"Customers
Create, retrieve, update, and manage customer profiles and metadata.
/v1/customersList all customers with optional filters and pagination
/v1/customers/:idRetrieve a single customer by ID
/v1/customersCreate a new customer profile
/v1/customers/:idUpdate customer attributes and metadata
/v1/customers/:idDelete a customer and associated data
Health Scores
Query computed health scores, trends, and risk assessments for customers.
/v1/customers/:id/healthGet the current health score and contributing signals for a customer
/v1/customers/:id/health/historyRetrieve historical health score data with daily or weekly granularity
/v1/health/summaryAggregate health score distribution across all customers
/v1/health/at-riskList customers whose health score dropped below a threshold
Events & Signals
Ingest custom events and retrieve signal data that feeds into health scores.
/v1/eventsIngest a batch of custom events (up to 1,000 per call)
/v1/eventsQuery events with filters for customer, type, and date range
/v1/signals/:customerIdList computed signals (usage, engagement, billing) for a customer
Integrations
Manage connected third-party integrations and sync status.
/v1/integrationsList all configured integrations and their sync status
/v1/integrationsConnect a new integration (Stripe, HubSpot, Salesforce, etc.)
/v1/integrations/:idRetrieve details and sync history for an integration
/v1/integrations/:idDisconnect an integration and stop syncing
/v1/integrations/:id/syncTrigger an immediate sync for a specific integration
Webhooks
Configure webhook endpoints to receive real-time notifications.
/v1/webhooksList all registered webhook endpoints
/v1/webhooksRegister a new webhook endpoint with event subscriptions
/v1/webhooks/:idUpdate webhook URL, events, or active status
/v1/webhooks/:idDelete a webhook endpoint
Rate Limits
All API endpoints are rate-limited per API key. Default limits:
- Read endpoints (GET): 1,000 requests/minute
- Write endpoints (POST/PATCH/DELETE): 200 requests/minute
- Event ingestion: 10,000 events/minute
Rate limit headers (X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset) are included in every response.
Error Codes
400Bad RequestInvalid parameters or request body401UnauthorizedMissing or invalid API key403ForbiddenInsufficient permissions for this action404Not FoundResource does not exist429Too Many RequestsRate limit exceeded500Internal Server ErrorSomething went wrong on our end