Customers
The Customer Dashboard in Treblle provides a comprehensive view of your API’s usage by individual customers.
It helps you understand how different customers interact with your API, identify trends in their usage patterns, and pinpoint potential issues or areas for improvement.
Customer Workspace Access
Important: Customer ID Uniqueness Requirement
Treblle performs exact matching on customer IDs, meaning each customer ID must be globally unique across all APIs within your workspace. Using the same customer ID across different APIs will aggregate all data for that customer. This ensures proper data isolation and prevents customers from seeing each other’s data.
Note
Customer Role Integration: When you invite a customer to your workspace with the Customer role, they automatically gain access to APIs where their customer ID appears:
- Full API Documentation for APIs containing their customer ID in requests
- Personal Usage Data strictly limited to requests with their customer ID
What Customers See
Complete API Documentation Access (Scoped to Relevant APIs)
Customers have full access to documentation for APIs where their customer ID appears:
- Endpoints: All available endpoints and methods
- Authentication: How to authenticate with the API
- Parameters: Request parameters and validation rules
- Responses: Expected response formats and codes
- Examples: Code samples and integration guides
- OpenAPI Specs: Machine-readable API specifications
Tip
Documentation Transparency: Customers see the same comprehensive API documentation that your internal team uses for the APIs they interact with, enabling them to build integrations confidently.
Automatic API Discovery
APIs become visible to customers automatically when the first request containing their customer ID is received. No manual configuration needed.
Filtered Usage Data
Customers see only their own data:
- Request History: Only requests with their customer ID
- Performance Metrics: Load times for their requests only
- Error Tracking: Errors specific to their API calls
- Usage Analytics: Their consumption patterns and trends
- Device Information: Details about their request origins
Caution
Privacy Protection: Customers cannot see any data from other customers. All request history, metrics, and analytics are automatically filtered to show only their customer ID.
Dashboard and Analytics
Customers have access to a personalized dashboard showing:
- Overview Metrics: Total requests, failed requests, average response size, load time
- Performance Charts: Average load time trends, response size over time
- Error Tracking: 4xx and 5xx request counts with visualizations
- Recent Activity: Latest API requests with quick access to details
- Time-based Filtering: View data across different time periods (24H, 7D, 14D, 30D, All Time)
Note
Scope Reminder: All metrics, graphs, and analytics shown to customers are automatically filtered to include only data tagged with their customer ID. They never see aggregate workspace data or other customers’ information.
How Customer Access Works
-
Invite Customer to Workspace
- Send an invitation with the Customer role
- Customer accepts and joins your workspace
-
Automatic API Discovery
- Customer sees documentation for APIs where their customer ID appears in requests
- Updates dynamically as new APIs receive requests with their ID
- No manual API access configuration required
-
Customer View
- Documentation: Complete API specs for relevant APIs only
- Usage: Only requests tagged with their customer ID
- Analytics: Performance and error data for their requests only
Setting Up Customer Access
To enable customer access to their API data:
Step 1: Ensure Customer ID is Tracked
Add customer identification to your API requests using the treblle-metadata header:
// Add customer ID to request metadata header
req.headers['treblle-metadata'] = JSON.stringify({
'user-id': 'Netflix', // Must be globally unique
'Plan': 'Titanium Plan' // Optional additional metadata
});Caution
Important: Customer IDs must be unique across your entire workspace. Use consistent identifiers (like email, UUID, company name, or internal customer ID) to ensure proper data isolation.
Step 2: Invite Customer to Workspace
- Navigate to User Management > People
- Click Email Invite
- Provide customer details:
- Email: Customer’s email address
- Role: Select Customer
- Group (optional): Assign to customer group
- Click Send Invite
Step 3: Customer Experience
- Customer receives invitation email
- Customer logs in to Treblle
- Customer sees:
- Full API documentation for APIs where their ID appears
- Only their own request history and usage data
- Performance metrics for their requests
- Customer can debug their integrations independently
What Customers Cannot See
APIs Without Their Customer ID
Cannot see APIs where their customer ID has never appeared in requests
Other Customers’ Data
No visibility into other customers’ requests, errors, or usage patterns
Workspace Metrics
Cannot see aggregate workspace statistics or total API usage
Internal Performance
No access to infrastructure metrics or internal benchmarking data
Accessing the Customer Dashboard
The Customer Dashboard is available at the individual API level. To access it:
- Navigate to the specific API you want to analyze.
- Click on “Customers” in the left navigation bar.
- The Customer Dashboard will display all customers and their usage data for that specific API.
Tip
At the workspace level (Home page), you can view a Top Customers widget showing high-level customer metrics across all APIs. For detailed customer analysis, use the Customer Dashboard at the individual API level.
Customer Dashboard Overview
The Customer Dashboard provides a comprehensive overview of all customers using your API.
Here’s what you’ll find:
- Customer Profiles: A list of all your customers, identified by their display name or Customer ID. When available, Treblle shows the customer’s display name for easier identification instead of technical IDs.
- Request Count: The total number of API requests each customer makes.
- Overall Percentage: The percentage of total API requests attributed to each customer, giving you a sense of their impact on your API traffic.
- Last Active: A timestamp indicating when each customer made their last API request.
Dashboard Customization
You can customize the Customer Dashboard to show the widgets that matter most to you:
- Click the Customize Dashboard button (grid icon) in the top-right corner.
- Enable or disable widgets such as:
- New Customers: Number of new customers in your API
- Active Customers: Number of active customers in your API
- Top Customer: Customer with highest number of requests
- Average Requests Per Customer: Average number of API requests made by all customers
- Customers List: List of 10 most recent customers in your API
- Favorite Customers: List of customers you marked as favorite
- Top Customers List: List of customers with highest number of requests in your API
Individual Customer Profile
Click on any customer from the list to access their detailed profile and request history.
Customer Profile Overview
The Individual Customer Profile provides:
- Customer Name: The display name or customer ID at the top of the page
- Total Requests: The total number of API requests made by this customer
- Overall Percentage: The percentage of total API requests attributed to this customer
- Request Graph: A visual representation of the customer’s API request activity over time, helping you identify peak usage periods, trends, and potential anomalies
- Description Field: Space to add notes or context about the customer
Customer Request History
Below the overview, you’ll find a complete list of all API requests made by that customer, including:
- Method: HTTP method used (GET, POST, etc.)
- Response: Response status code
- Name: Endpoint name or path
- Load Time: Request processing duration
- Threat Level: Security assessment (Low, Medium, High)
- Device: Device type used for the request
- AI Agent: AI service detection if applicable
- Location: Geographic location of the request
- Time: Timestamp of the request
You can filter, search, and sort these requests to analyze specific patterns or troubleshoot issues for individual customers.
Adding Customer/User Information to Requests
treblle-user-id is used to identify your customers. You can pass any value here, such as ID, UUID, email, username, or company name.
The header can be included in either Request or Response Headers - Treblle will pick them up from both.
Tip
When you provide a display name or customer identifier, Treblle will show this name in the Customer Dashboard instead of just the technical customer ID, making it easier to identify and analyze customer behavior.
Steps to add the Customer Information in Treblle’s Express SDK
Here’s how you can modify your Express middleware to add these headers:
// Custom middleware to add Customer information
app.use((req, res, next) => {
if (req.user) { // Ensure the user is authenticated
req.headers['treblle-user-id'] = req.user.id; // Attach Customer ID
}
next();
});
// Treblle Middleware
app.use(treblle({
apiKey: process.env.TREBLLE_API_KEY,
sdkToken: process.env.TREBLLE_SDK_TOKEN
}));Treblle Dashboard View of Customer Information
The image below shows how the customer information will appear on the Treblle dashboard once you add it to the request.
Implementing Customer ID Tracking in Other SDKs
For other SDKs, the approach is similar. Here’s how you can implement it:
- First, check the user authentication, and then you can retrieve the Customer ID from the authentication system.
if (isAuthenticated) {
customerId = getCustomerIdFromSession() // Fetch Customer ID from session or token
}- After authentication, you can add the Customer ID to the request headers (typically as “treblle-user-id”).
request.headers.set('treblle-user-id', customerId)- Apply middleware to track customer data in API requests.
applyMiddleware('customerTrackingMiddleware', routes) For specific integration details for other SDKs, please refer to the Integration page.
The Customer Dashboard in Treblle gives valuable insights into how your customers use your API at the individual API level. With detailed customer profiles, request history, and usage analytics, you can spot patterns, monitor adoption, and address performance or support issues early on.
For a quick overview of top customers across all your APIs, use the Top Customers widget available on the workspace-level Home page.