POST Log Entry

Use this endpoint to send log entries to the ARK RAPID (LogAnalytics) service.

POST api/log/{application}/v1/{log_type}/{ref-key}/{ref-val}/{some long message1}/{by_user}

Submits a log entry to the specified application and log type.

URL Parameters

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)

Headers

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

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

Code Examples

# 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))

Response

The API returns a JSON object with the following structure:

Success Response (201 Created)
{
  "id": "log-5f7b3d4c2a1e0",
  "status": "success",
  "message": "Log entry created successfully",
  "timestamp": "2023-11-15T10:30:45.123Z"
}
Error Response (400 Bad Request)
{
  "status": "error",
  "message": "Invalid request parameters",
  "code": "VALIDATION_ERROR",
  "details": {
    "content": "Content field is required"
  }
}

Try It Out


            

API Best Practices

Error Handling

Always implement proper error handling when calling the ARK RAPID (LogAnalytics) API. Check for HTTP status codes and handle errors gracefully in your application.

Rate Limiting

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.

Data Retention

Log entries are retained for 30 days by default. Extended retention periods are available on enterprise plans.