---
title: "HTTP / curl"
description: "Send logs from shell scripts, cron jobs or any tool that can make a request."
canonical_url: "https://docs.logstrace.dev/guides/integrations/http"
---
# HTTP / curl

> Send logs from shell scripts, cron jobs or any tool that can make a request.

```bash
curl -fsS -X POST https://logstrace.dev/api/ingest \
  -H "Authorization: Bearer $LOGSTRACE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"channel":"backup","text":"Backup nightly finished in 412 s, 3.2 GB"}'
```

## A small shell helper

```bash
# usage: lt <channel> <level> <message...>
lt() {
  local channel=$1 level=$2; shift 2
  jq -nc --arg c "$channel" --arg l "$level" --arg t "$*" '{channel:$c, level:$l, text:$t}' |
    curl -fsS -m 5 -X POST https://logstrace.dev/api/ingest \
      -H "Authorization: Bearer $LOGSTRACE_KEY" \
      -H "Content-Type: application/json" --data-binary @- >/dev/null || true
}

lt backup info "Backup nightly finished in 412 s"
```

`jq` builds the JSON so quotes in the message can't break it; `|| true` keeps your script running if the request fails.

<note>

The server requires a `Content-Length` header. curl, `fetch`, `requests` and most HTTP clients set it; avoid chunked uploads.

</note>


## Sitemap

See the full [sitemap](https://docs.logstrace.dev/sitemap.md) for all pages.
