API Reference
Complete API reference for the Sophonz platform....
Last updated: 2025. 10. 13.
Complete API reference for the Sophonz platform.
Authentication
All API requests require authentication using an API key.
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Base URL
https://api.sophonz.com/v1
Core Endpoints
Applications
List Applications
GET /applications
Response:
{
"applications": [
{
"id": "app_123",
"name": "My Application",
"status": "active",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-15T12:30:00Z"
}
],
"total": 1,
"page": 1
}
Get Application
GET /applications/{id}
Response:
{
"id": "app_123",
"name": "My Application",
"description": "Application description",
"status": "active",
"environment": "production",
"metrics": {
"uptime": 99.9,
"response_time": 245,
"error_rate": 0.01
}
}
Create Application
POST /applications
Request Body:
{
"name": "New Application",
"description": "Description of the application",
"environment": "production",
"config": {
"monitoring": true,
"alerts": true
}
}
Monitoring
Get Metrics
GET /applications/{id}/metrics
Query Parameters:
start: Start time (ISO 8601)end: End time (ISO 8601)metric: Metric type (response_time, error_rate, throughput)granularity: Data granularity (1m, 5m, 1h, 1d)
Response:
{
"metric": "response_time",
"granularity": "5m",
"data": [
{
"timestamp": "2024-01-15T12:00:00Z",
"value": 245.5
},
{
"timestamp": "2024-01-15T12:05:00Z",
"value": 238.2
}
]
}
Create Alert
POST /applications/{id}/alerts
Request Body:
{
"name": "High Error Rate",
"condition": {
"metric": "error_rate",
"operator": ">",
"threshold": 0.05
},
"actions": [
{
"type": "email",
"recipients": ["admin@company.com"]
},
{
"type": "slack",
"channel": "#alerts"
}
]
}
AI Insights
Get Insights
GET /applications/{id}/insights
Response:
{
"insights": [
{
"id": "insight_123",
"type": "performance",
"severity": "medium",
"title": "Response time increase detected",
"description": "Average response time increased by 40% in the last hour",
"recommendation": "Consider scaling your application or optimizing slow queries",
"timestamp": "2024-01-15T12:30:00Z"
}
]
}
Get Predictions
GET /applications/{id}/predictions
Query Parameters:
metric: Metric to predicthorizon: Prediction horizon (1h, 6h, 24h, 7d)
Response:
{
"metric": "response_time",
"horizon": "24h",
"predictions": [
{
"timestamp": "2024-01-15T13:00:00Z",
"predicted_value": 250.3,
"confidence": 0.85
}
]
}
Deployments
List Deployments
GET /applications/{id}/deployments
Response:
{
"deployments": [
{
"id": "deploy_123",
"version": "v1.2.4",
"status": "success",
"started_at": "2024-01-15T10:00:00Z",
"completed_at": "2024-01-15T10:05:00Z",
"changes": [
"Fixed payment processing bug",
"Updated user interface"
]
}
]
}
Create Deployment
POST /applications/{id}/deployments
Request Body:
{
"version": "v1.2.5",
"description": "Bug fixes and performance improvements",
"config": {
"rollback_on_error": true,
"health_check_url": "/health"
}
}
Error Codes
| Code | Description |
|---|---|
| 400 | Bad Request - Invalid request parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource not found |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Server error |
Rate Limits
- Standard Plan: 1,000 requests per hour
- Pro Plan: 10,000 requests per hour
- Enterprise Plan: Unlimited
Rate limit headers are included in all responses:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1642248000
SDKs
Official SDKs are available for:
- JavaScript/Node.js
- Python
- Go
- Java
- C#
JavaScript Example
import { Sophonz } from '@sophonz/sdk';
const client = new Sophonz({
apiKey: 'your-api-key'
});
const apps = await client.applications.list();
console.log(apps);
Python Example
from sophonz import Client
client = Client(api_key='your-api-key')
apps = client.applications.list()
print(apps)