---
title: "Push API for logs | Grafana Labs"
description: "How the Loki push API accepts log entries"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Push API for logs

`POST /loki/api/v1/push` is the endpoint that ingests log entries into Loki, which is the system behind Grafana Cloud Logs.

The default request body is a Snappy-compressed Protocol Buffer message, a compressed binary format, with `Content-Type: application/x-protobuf`. If you set `Content-Type: application/json`, you can POST a JSON body instead. That body is a `streams` array. Each stream has labels and a list of timestamped log lines.

[![An HTTP client posts log entries to the Loki push API, which stores them in Grafana Cloud Logs](http-api-logs-flow.svg)](http-api-logs-flow.svg "An HTTP client posts log entries to the Loki push API, which stores them in Grafana Cloud Logs")

## Considerations

- The API reference includes a curl example that posts one JSON stream.
- You can gzip the JSON body with `Content-Encoding: gzip`.
- You can attach structured metadata to a log line by adding a JSON object of string keys and values after the line text.
- This is the ingest endpoint in the Loki HTTP API. It is separate from the query API, which is documented for reading Grafana Cloud Logs programmatically.

## Documentation

- [Loki HTTP API: ingest logs](/docs/loki/latest/reference/loki-http-api/#ingest-logs)
- [Send logs to Grafana Cloud](/docs/grafana-cloud/send-data/logs/)
