> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peeng.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Peeng Log Ingestion API — Concepts and Full Reference

> Base URL, authentication, batching limits, ISO 8601 timestamps, idempotency keys, and error conventions for the Peeng log ingestion HTTP API.

The Peeng log ingestion API is a simple HTTP API that lets you send structured log data directly from your application to Peeng. The base URL for every request is `https://api.peeng.dev`, and there is exactly one ingestion endpoint: `POST /v1/logs`. All requests and responses use JSON.

## Base URL

```
https://api.peeng.dev
```

## Authentication

Every request must include the `x-api-key` header. Requests without a valid key receive a `401` response.

```bash theme={null}
curl https://api.peeng.dev/v1/logs \
  -H "x-api-key: pk_test_a1b2c3..."
```

See [Authentication](/authentication) for full key management details, including how to rotate keys and scope them to specific environments.

## Content Type

All requests and responses use JSON. Send `Content-Type: application/json` on every request, including requests with a body.

## Batching

The API has exactly one ingestion endpoint — `POST /v1/logs` — and it always takes an array, even for a single log entry. A request can carry **1 to 500** log entries. There is no separate "single log" endpoint; send a one-item array when you have only one entry to ingest.

<Tip>
  Batching multiple entries in one request reduces round-trip overhead and counts as a single API call against your rate limit. Where possible, buffer log entries over a short window and flush them together.
</Tip>

## Timestamps

Every timestamp field expects **ISO 8601** format (e.g., `2025-01-15T10:30:00.000Z`). If you omit `timestamp` on a log entry, Peeng stamps it with the time the request was received. Use explicit timestamps when you buffer and flush entries asynchronously to preserve the original event time.

## Idempotency

Include an `Idempotency-Key` header to make a request safe to retry. If you send the same key more than once within 24 hours, Peeng returns the original response without writing duplicate entries. The key can be any string that is unique to the batch — a UUID works well.

See [Idempotency](/essentials/idempotency) for full details on retry behaviour and key expiry.

## Errors

Every error response follows a consistent JSON envelope. See [Errors](/essentials/errors) for the full response shape and a complete status code reference.
