Overview
This quickstart guide will help you make your first API call to Stanna and retrieve your workspace metrics. You’ll need:- A Stanna account with an active workspace
- Access to your workspace settings to create an API key
Step 1: Create an API Key
1
Login to Stanna
Navigate to app.gostanna.com and log into your account
2
Go to Settings
Click on Settings in the main navigation
3
Create API Key
Scroll down to the API Keys section and click Create New Key
4
Name Your Key
Give it a descriptive name like “API Testing” and click Create Key
5
Copy Your Key
Copy the generated API key (starts with
sk-) and store it securelyYour API key provides full access to your workspace data. Keep it secure and never share it publicly.
Step 2: Find Your Workspace ID
Your workspace ID is your company domain. For example:- If your email is
john@acme.com, your workspace ID isacme.com - If your email is
sarah@tech-startup.io, your workspace ID istech-startup.io
Step 3: Make Your First API Call
Let’s retrieve your workspace metrics summary:your-domain.com with your actual workspace ID and sk-your-api-key-here with your actual API key.
Step 4: Understand the Response
A successful response will look like this:- totals: Key counts for your workspace
- revenue: Financial metrics including MRR and at-risk revenue
- health: Average health scores and changes
- asOf: When this data was last calculated
Step 5: Try Other Endpoints
Now that you have authentication working, try these popular endpoints:Get All Clients
Get Health Trends
Get Integration Status
Next Steps
Authentication Guide
Learn about security best practices and API key management
Clients API
Retrieve and manage your client data
Metrics API
Access detailed analytics and trends
Integrations API
Manage data sync from external platforms
Common Issues
401 Unauthorized
- Check that your API key is correct and properly formatted
- Ensure you’re using the
Authorization: Bearerheader format
403 Forbidden
- Verify your workspace ID matches your account
- Make sure your API key has the necessary permissions
404 Not Found
- Double-check the endpoint URL
- Ensure your workspace ID is correct
Rate Limiting
- The API allows 100 requests per minute per key
- Implement exponential backoff for retries
SDK and Libraries
While we don’t provide official SDKs yet, the API works great with standard HTTP libraries in any language:- Node.js:
fetch,axios, ornode-fetch - Python:
requestsorhttpx - Go: Standard
net/httppackage - PHP:
cURLorGuzzle - Ruby:
net/httporfaraday
Getting Help
If you run into issues:- Check your API key and workspace ID
- Review the endpoint documentation
- Test with a simple cURL command first
- Contact support at support@gostanna.com