Learn how to integrate ARK RAPID (LogAnalytics) with your applications using our REST API
Use this endpoint to send log entries to the ARK RAPID (LogAnalytics) service.
Submits a log entry to the specified application and log type.
| Parameter | Type | Required | Description |
|---|---|---|---|
| application | string | Yes | The name of your application (used for data sharding) |
| type | string | Yes | The type of log (e.g., error, info, warning, debug) |
| Header | Value | Required | Description |
|---|---|---|---|
| Authorization | Bearer {subscription_key} | Yes | Your subscription key for API access |
| Content-Type | application/json | Yes | The content type of the request body |
| Field | Type | Required | Description |
|---|---|---|---|
| content | string | Yes | The log message content |
| timestamp | string | No | ISO 8601 timestamp (defaults to current time) |
| level | string | No | Log level (ERROR, WARN, INFO, DEBUG) |
| metadata | object | No | Additional key-value pairs for context |
# Submit a log entry using cURL
curl -X POST \
https://log-api.immanuel.co/api/log/test/v1/trace/ref-key/ref-val/some long message1/by_user \
-H 'Authorization: Bearer YOUR_SUBSCRIPTION_KEY' \
-H 'Content-Type: application/json' \
-d '{
"content": "Database connection timeout",
"level": "ERROR",
"metadata": {
"user_id": "12345",
"request_id": "req-67890"
}
}'
// Submit a log entry using JavaScript
const response = await fetch(
'https://log-api.immanuel.co/api/log/test/v1/trace/ref-key/ref-val/some long message1/by_user',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_SUBSCRIPTION_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
content: 'Database connection timeout',
level: 'ERROR',
metadata: {
user_id: '12345',
class="code-keyword">request_id: 'req-67890'
}
})
});
# Submit a log entry using Python
import requests
import json
url = "https://log-api.immanuel.co/api/log/test/v1/trace/ref-key/ref-val/some long message1/by_user"
headers = {
"Authorization": "Bearer YOUR_SUBSCRIPTION_KEY",
"Content-Type": "application/json"
}
data = {
"content": "Database connection timeout",
"level": "ERROR",
"metadata": {
"user_id": "12345",
"request_id": "req-67890"
}
}
response = requests.post(url, headers=headers, data=json.dumps(data))
The API returns a JSON object with the following structure:
{
"id": "log-5f7b3d4c2a1e0",
"status": "success",
"message": "Log entry created successfully",
"timestamp": "2023-11-15T10:30:45.123Z"
}
{
"status": "error",
"message": "Invalid request parameters",
"code": "VALIDATION_ERROR",
"details": {
"content": "Content field is required"
}
}
Always implement proper error handling when calling the ARK RAPID (LogAnalytics) API. Check for HTTP status codes and handle errors gracefully in your application.
The API is rate-limited to 100 requests per minute per subscription key. If you exceed this limit, you will receive a 429 Too Many Requests response.
Log entries are retained for 30 days by default. Extended retention periods are available on enterprise plans.