Welcome to the Stanna API
The Stanna API provides programmatic access to your customer health data, metrics, and insights. All endpoints are secured with API key authentication to protect your sensitive customer data.
Base URL
https://api.gostanna.com/api
All API requests should be made to this base URL.
Authentication
All API endpoints require authentication using API keys. You can create and manage API keys through your Stanna dashboard settings.
API keys follow the format: sk-[random string]
Authentication Methods
You can authenticate requests using either of these methods:
Bearer Token (Recommended)
Include your API key in the Authorization header:
curl -X GET "https://api.gostanna.com/api/metrics/summary?workspaceId=yourworkspace.com" \
-H "Authorization: Bearer sk-your-api-key-here"
Alternatively, you can use the X-API-Key header:
curl -X GET "https://api.gostanna.com/api/metrics/summary?workspaceId=yourworkspace.com" \
-H "X-API-Key: sk-your-api-key-here"
Creating API Keys
- Navigate to Settings in your Stanna dashboard
- Scroll down to the API Keys section
- Click Create New Key
- Give your key a descriptive name (e.g., “Production Dashboard”, “Mobile App”)
- Copy and securely store your API key - you won’t be able to see it again
Keep your API keys secure and never expose them in client-side code. API keys provide full access to your workspace data.
Required Parameters
All API endpoints require a workspaceId parameter. This is your workspace domain (e.g., yourcompany.com).
Rate Limiting
API requests are limited to:
- 100 requests per minute per API key
- 10,000 requests per day per workspace
Rate limit headers are included in all responses:
X-RateLimit-Limit: Maximum requests allowed
X-RateLimit-Remaining: Requests remaining in current window
X-RateLimit-Reset: Unix timestamp when the rate limit resets
Error Responses
The API uses standard HTTP status codes to indicate success or failure:
| Status Code | Description |
|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Valid key but insufficient permissions |
| 404 | Not Found - Resource doesn’t exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
Error responses include a JSON body:
{
"error": "Invalid API key",
"code": "AUTH_INVALID_KEY",
"status": 401
}