API Reference
The Mesh-Trace REST API lets you programmatically ingest and query traces, manage collector nodes, discover services, and configure alerting rules. All endpoints return JSON and use standard HTTP status codes.
Quick Start with cURL
Make your first API call in under a minute
Python SDK
pip install mesh-trace
Node.js SDK
npm install @mesh-trace/sdk
Authentication #
All API requests require a valid API key passed via the Authorization header using Bearer token authentication.
Bearer Token
Include your API key in every request header. Keys prefixed with mtk_test_ access sandbox data only.
Generate API keys from Settings > API Keys in the dashboard. Each key is scoped to your organization and can be revoked at any time.
API keys carry the same permissions as your user account. Store them securely and never expose them in client-side code or version control.
Base URL #
All API requests should be sent to the following base URL.
For enterprise customers with dedicated infrastructure, your base URL may differ. Check your onboarding email or contact your account manager.
Rate Limits #
The API uses a sliding window rate limiter scoped per API key.
1,000 requests per minute
Rate limit headers are included in every response so you can track your usage:
When rate limited, the API returns 429 Too Many Requests. Implement exponential backoff in your integration. Enterprise plans support custom rate limits up to 10,000 req/min.
Error Handling #
The API uses conventional HTTP status codes to indicate success or failure. Error responses include a structured JSON body.
| Status | Meaning | Common Causes |
|---|---|---|
| 200 | OK | Request succeeded |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid parameters or malformed JSON |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | API key lacks required permissions |
| 404 | Not Found | Resource does not exist |
| 429 | Rate Limited | Too many requests — back off and retry |
| 500 | Server Error | Internal error — contact support if persistent |
| 503 | Unavailable | Service temporarily unavailable |
SDKs & Libraries #
Official client libraries with full type definitions, automatic retries, and built-in pagination support.
Python
pip install mesh-trace
Node.js / TypeScript
npm i @mesh-trace/sdk
Go
go get mesh-trace/sdk-go
Ruby
gem install mesh_trace
Traces #
Query and search distributed traces captured by Mesh-Trace collectors across your infrastructure.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
service | string | Filter by service name (e.g. api-gateway) |
start_time | ISO 8601 | Start of the query window. Default: 1 hour ago |
end_time | ISO 8601 | End of the query window. Default: now |
min_duration_ms | integer | Minimum trace duration in milliseconds |
status | string | Filter by status: ok, error, unset |
limit | integer | Max results (1–200). Default: 50 |
cursor | string | Pagination cursor from previous response |
Example Response
Path Parameters
| Parameter | Type | Description |
|---|---|---|
trace_id required | string | 32-character hex trace ID (W3C format) |
Example Response
Request Body
| Field | Type | Description |
|---|---|---|
query required | string | Search expression (e.g. service.name = "api-gateway" AND duration > 100ms) |
start_time required | ISO 8601 | Start of the search window |
end_time required | ISO 8601 | End of the search window |
limit | integer | Max results (1–500). Default: 100 |
Example Request
Collector Nodes #
Monitor and manage Mesh-Trace collector nodes deployed across your clusters.
Example Response
Path Parameters
| Parameter | Type | Description |
|---|---|---|
node_id required | string | Unique node identifier |
Example Response
Services #
Discover services and explore the dependency topology of your infrastructure.
Example Response
Query Parameters
| Parameter | Type | Description |
|---|---|---|
cluster | string | Filter by cluster name |
time_window | string | Aggregation window: 1h, 6h, 24h. Default: 1h |
Example Response
Alerts #
Create and manage alerting rules to get notified about anomalies in your traced services.
Request Body
| Field | Type | Description |
|---|---|---|
name required | string | Human-readable alert name |
condition required | object | Trigger condition (metric, threshold, window) |
channels required | array | Notification channels: slack, email, pagerduty, webhook |
severity | string | critical, warning, or info. Default: warning |
Example Request
Example Response
Changelog #
Recent API changes and version history.
New Service topology endpoint
Added GET /v1/topology for querying the service dependency graph with time-windowed aggregation.
Improvement Trace search performance
Trace search queries now execute up to 3x faster with improved indexing on span attributes.
New Alert rules API
Create, update, and delete alert rules programmatically via POST /v1/alerts/rules.
Fix Pagination cursor stability
Fixed an issue where pagination cursors could become invalid when new traces were ingested between page requests.
Breaking API v2 deprecated
API v2 endpoints have been removed. All integrations must migrate to v3. See the migration guide for details.