Errors
Errors
One error envelope for every failure, with a stable machine-readable code.
Logstreem uses conventional HTTP status codes. Every failure returns the same envelope.
Error envelope
{
"error": {
"type": "query_error",
"code": "query_unknown_field",
"message": "Line 2: no field named 'statuss' in dataset 'api-gateway-prod'.",
"param": "apl",
"doc_url": "https://logstreem.com/docs/errors#query_unknown_field",
"request_id": "req_9f3c2a7b41de08c5b2e6d1a4"
}
}Status codes
| Status | Meaning | Retry? |
|---|---|---|
200 / 201 | Success | — |
400 | Malformed body, or a query that will not parse | No — fix the request |
401 | Missing, malformed or revoked token | No |
403 | Token is valid but not scoped to this dataset | No |
404 | No such dataset, monitor or endpoint | No |
409 | Conflicts with current state, e.g. a dataset name in use | No |
413 | Ingest payload over the size cap | No — batch smaller |
429 | Rate limited. See Rate limits | Yes, with backoff |
5xx | Something broke on our side | Yes, with backoff |
Error codes
| Code | Status | What happened |
|---|---|---|
missing_token | 401 | No Authorization header was sent |
invalid_token | 401 | The token is malformed or has been revoked |
token_scope_denied | 403 | The token is not scoped to that dataset or action |
resource_not_found | 404 | The path or id does not resolve |
dataset_not_found | 404 | No dataset with that name on this org |
payload_too_large | 413 | Over 10 MB compressed in one ingest request |
invalid_json | 400 | The body is not valid JSON or NDJSON |
field_limit_exceeded | 400 | The dataset is at its 4,096-field cap |
query_syntax_error | 400 | LSQL would not parse — the message carries the line |
query_unknown_field | 400 | A field referenced by the query does not exist |
query_unsupported_operator | 400 | The operator is not available in this context |
query_timeout | 400 | The query exceeded its cost limit |
rate_limit_exceeded | 429 | Too many requests in the window |
Log the request id
request_id is also the X-Request-Id header on successful calls. Logging it on both paths makes a support request solvable in one round trip.