Aptrics API
Introduction to the Aptrics API.
Introduction
The Aptrics API lets you take the logic and structure you define in Aptrics and use it outside the product. You can retrieve metadata, query trusted metrics via Aptrics' query engine, and control semantic-layer syncs for supported integrations.
This API enables seamless integration with your existing tools and workflows, allowing your applications to leverage the power of your semantic layer programmatically. Whether you're building custom analytics applications, automating metric queries, or syncing data across platforms, the Aptrics API provides the flexibility and control you need.
→API documentationAvailable endpoints
| Endpoint | Description |
|---|---|
GET /v1/metrics | List all metrics in the metric catalog. |
GET /v1/metrics/search | Search metrics by keywords. |
GET /v1/metrics/{metricId} | Get a single metric by id. |
POST /v1/metrics/{metricId}/query | Query a specific metric using Aptrics' query engine and return aggregated results and SQL query. |
GET /v1/dimensions | List all available dimensions in your semantic layer. |
GET /v1/integrations/sync | Trigger semantic-layer syncs for supported integrations. |
API authentication
All API requests require authentication using an API key. Include your API key in the request header as follows:
Authorization: Bearer YOUR_API_KEYAPI keys can be generated in your Aptrics workspace settings. Keep your API keys secure and never expose them in client-side code or public repositories. If you suspect a key has been compromised, regenerate it immediately from your workspace settings.
API key expiration
API keys can be configured with optional expiration dates for enhanced security. When creating a new API key, you can specify:
- No expiration (key remains valid indefinitely)
- 7 days expiration (suitable for temporary integrations)
- 30 days expiration (recommended for regular integrations)
- 90 days expiration (for long-term integrations)
- Custom expiration date (set your own date)
When an API key approaches expiration, you'll receive email notifications. Plan ahead to regenerate keys before they expire to avoid service disruptions.
API documentation
For detailed API documentation including request/response examples, error codes, and schema definitions, visit our complete API reference. You'll find interactive API explorer, code examples in multiple languages, and comprehensive guides for each endpoint.
The interactive API explorer allows you to test requests directly with your API key, making it easy to understand how the API works and troubleshoot issues. All responses include detailed error messages to help you debug integration issues quickly.
