POST/v1/logs/otlp
Export OpenTelemetry logs
Requires an API token with LOGS:SEND. Supports gzip compression.
Body parameters
resourceLogs:array | nulloptional
resource:object | nulloptional
schemaUrl:string | nulloptional
scopeLogs:array | nulloptional
scope:object | nulloptional
schemaUrl:string | nulloptional
logRecords:array | nulloptional
timeUnixNano:anyoptional
*anonymous*:stringoptional
*anonymous*:numberoptional
*anonymous*:nulloptional
observedTimeUnixNano:anyoptional
*anonymous*:stringoptional
*anonymous*:numberoptional
*anonymous*:nulloptional
severityNumber:integer | nulloptional
severityText:string | nulloptional
body:anyoptional
Log body as an OTLP AnyValue.
attributes:array | nulloptional
key:string
value:anyoptional
OTLP AnyValue.
droppedAttributesCount:integer | nulloptional
flags:integer | nulloptional
traceId:string | nulloptional
spanId:string | nulloptional
eventName:string | nulloptional
Responses
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | OTLP full success, in the request encoding |
| 400 | Bad Request | Invalid OTLP export |
| 401 | Unauthorized | Missing or invalid API token |
| 403 | Forbidden | Requires an explicit LOGS:SEND grant |
| 405 | Method Not Allowed | Requires POST |
| 413 | Payload Too Large | Export or record exceeds a size limit |
| 415 | Unsupported Media Type | Unsupported content type or compression |
| 429 | Too Many Requests | Log ingestion allowance exceeded |
| 503 | Service Unavailable | Ingestion unavailable or delivery not confirmed |
Request
POST
/v1/logs/otlpcurl --request POST \
--url https://api.onlineornot.com/v1/logs/otlp \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}' \
--header 'Content-Type: application/json' \
--data '{"resourceLogs":[{"resource":{"attributes":[{"key":"string","value":null}],"droppedAttributesCount":4294967295},"schemaUrl":"string","scopeLogs":[{"scope":{"attributes":[{"key":"string","value":null}],"droppedAttributesCount":4294967295,"name":"string","version":"string"},"schemaUrl":"string","logRecords":[{"timeUnixNano":"string","observedTimeUnixNano":"string","severityNumber":24,"severityText":"string","body":null,"attributes":[{"key":"string","value":null}],"droppedAttributesCount":4294967295,"flags":4294967295,"traceId":"string","spanId":"string","eventName":"string"}]}]}]}'
Response
{}
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 429 | Retry-After | integer | Seconds until the next billing period |
POST/v1/logs
Send JSON logs
Requires an API token with LOGS:SEND.
Body parameters
logs:object[]
Responses
| Status | Meaning | Description |
|---|---|---|
| 202 | Accepted | Log batch accepted for processing |
| 400 | Bad Request | Invalid log batch |
| 401 | Unauthorized | Missing or invalid API token |
| 403 | Forbidden | Requires an explicit LOGS:SEND grant |
| 413 | Payload Too Large | Batch or record exceeds its byte limit |
| 415 | Unsupported Media Type | Requires uncompressed application/json |
| 429 | Too Many Requests | Log ingestion allowance exceeded |
| 500 | Internal Server Error | Internal server error |
| 503 | Service Unavailable | Ingestion unavailable or delivery not confirmed |
Response Schema
result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]
Request
POST
/v1/logscurl --request POST \
--url https://api.onlineornot.com/v1/logs \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}' \
--header 'Content-Type: application/json' \
--data '{"logs":[{"timestamp":"2019-08-24T14:15:22Z","level":"TRACE","message":"string","service":"string","environment":"string","attributes":{"property1":null,"property2":null},"trace_id":"string","span_id":"string"}]}'
202 Response
{
"result": {
"accepted": 1,
"ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
]
},
"success": true,
"errors": [],
"messages": []
}
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 429 | Retry-After | integer | Seconds until the next billing period |
GET/v1/logs
Search logs
Search logs by receipt time.
Requires LOGS:READ.
Header parameters
X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.
Query parameters
from:string(date-time)
Inclusive server receipt time, in RFC 3339 format.
to:string(date-time)
Exclusive server receipt time, at most one hour after from.
limit:integeroptional
Default: 50
cursor:stringoptional
project_id:anyoptional
service:stringoptional
environment:stringoptional
level:stringoptional
Accepted values: "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL"
q:stringoptional
Case-insensitive literal substring of the log message.
Responses
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | Matching logs and a continuation cursor |
| 400 | Bad Request | Invalid or unbounded search request |
| 401 | Unauthorized | Missing or invalid credentials |
| 403 | Forbidden | Insufficient permissions |
| 404 | Not Found | Project not found |
| 500 | Internal Server Error | Internal server error |
| 503 | Service Unavailable | Log search unavailable |
Response Schema
result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]
Request
GET
/v1/logscurl --request GET \
--url 'https://api.onlineornot.com/v1/logs?from=2019-08-24T14%3A15%3A22Z&to=2019-08-24T14%3A15%3A22Z' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'
Response
{
"result": {
"logs": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"project_id": "a1b2c3d4e5f6g7h8",
"timestamp": "2019-08-24T14:15:22Z",
"received_at": "2019-08-24T14:15:22Z",
"level": "TRACE",
"message": "string",
"service": "string",
"environment": "string",
"attributes": {
"property1": null,
"property2": null
},
"trace_id": "string",
"span_id": "string"
}
],
"next_cursor": "string",
"scanned_bytes": 0
},
"success": true,
"errors": [],
"messages": []
}
GET/v1/logs/usage
Read log and trace usage
Read combined log and trace ingestion usage for the current billing period.
Requires LOGS:READ.
Header parameters
X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.
Responses
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | Current log usage and allowance |
| 400 | Bad Request | Invalid request |
| 401 | Unauthorized | Missing or invalid credentials |
| 403 | Forbidden | Insufficient permissions |
| 500 | Internal Server Error | Internal server error |
| 503 | Service Unavailable | Log usage unavailable |
Response Schema
result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]
Request
GET
/v1/logs/usagecurl --request GET \
--url https://api.onlineornot.com/v1/logs/usage \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'
Response
{
"result": {
"period_start": "2019-08-24T14:15:22Z",
"period_end": "2019-08-24T14:15:22Z",
"used_bytes": 0,
"used_records": 0,
"limit_bytes": 5000000000,
"remaining_bytes": 0,
"retention_days": 30
},
"success": true,
"errors": [],
"messages": []
}