Post Tail Alerts to N1netails
In the context of N1netails, a tail alert refers to a lightweight, structured notification triggered by a client system (such as a service, application, or script) to report an event, issue, or anomaly. These alerts are designed to be easy to emit, fast to process, and rich in metadata β making them ideal for real-time monitoring, embedded systems, or edge environments.
π¦ Why βTailβ?β
The term "tail" in n1netails plays on two ideas:
- Log tailing β Observing the last lines of logs (like
tail -f) to detect anomalies in real-time. - Fox tails (kitsune/ninetails) β Thematically tied to the projectβs branding, each "tail" represents a meaningful signal from your system.
A tail alert is essentially your system saying:
"Something noteworthy just happened β here's what it is, and hereβs the relevant context."
π‘ API Endpointβ
POST /ninetails/alertβ
Send a new alert to the N1netails API using a valid N1ne-Token.
Learn how to create a token β
π§Ύ Request Headersβ
| Header Name | Description | Required |
|---|---|---|
N1ne-Token | Your unique alert API token | β Yes |
Content-Type | Must be application/json | β Yes |
𧬠Request Bodyβ
{
"title": "Tail Title",
"description": "Tail Description",
"details": "Tail details (stack trace/logs here)",
"timestamp": "2025-07-02T20:00:00Z",
"level": "ERROR",
"type": "SYSTEM_ALERT",
"metadata": {
"region": "us-east-1",
"cluster": "db-primary",
"environment": "production"
}
}
Field Definitionsβ
| Field | Type | Description |
|---|---|---|
title | string | Short, human-readable title for the alert |
description | string | One-line summary of the issue |
details | string | Stack trace, logs, or additional diagnostic information |
timestamp | ISO-8601 string | When the issue was detected (UTC recommended) |
level | string | Alert severity. Supported values: INFO, SUCCESS, WARN, ERROR, CRITICAL |
type | string | Classification/category of the alert (examples below) |
metadata | object | Additional context as key-value pairs (environment, region, host, etc.) |
π§± Supported Alert Types (Examples)β
You may use any string value for type, but here are common examples:
SYSTEM_ALERTUSER_REPORTSCHEDULED_MAINTENANCESECURITY_BREACHPERFORMANCE_ISSUEINTEGRATION_FAILUREDATA_INCONSISTENCYCONFIGURATION_CHANGEDEPLOYMENT_EVENTMONITORING_ALERT
Success event examples:
SUCCESSFUL_DEPLOYMENTUSER_ACTION_COMPLETEDAUTOMATION_SUCCESSDATA_SYNC_SUCCESSBACKUP_COMPLETEDHEALTH_CHECK_PASSEDLOGIN_SUCCESSPASSWORD_RESET_SUCCESSSYSTEM_RECOVERYSLA_MET
β
Example curl Requestβ
if you have n1netails running on your localhost you can replace https://app.n1netails.com/ninetails/alert with your local instance useually located at http://localhost:9901/ninetails/alert
curl -X POST https://app.n1netails.com/ninetails/alert \
-H "Content-Type: application/json" \
-H "N1ne-Token: YOUR_TOKEN_HERE" \
-d '{
"title": "Database Alert",
"description": "High latency observed",
"details": "The read queries in the US-East cluster have been above 2s for over 5 minutes.",
"timestamp": "2025-07-02T20:00:00Z",
"level": "ERROR",
"type": "SYSTEM_ALERT",
"metadata": {
"region": "us-east-1",
"cluster": "db-primary",
"environment": "production"
}
}'
Replace
YOUR_TOKEN_HEREwith your actual token.
π§ Notesβ
- This endpoint returns 204 No Content on success.
- Unauthorized requests return 401 Unauthorized and are logged internally.
- Ensure the timestamp uses the UTC ISO-8601 format.