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

# HTTP Source

> Accept events via HTTP POST requests pushed directly to LiteJoin.

# HTTP Source

The `http` source opens an HTTP endpoint that accepts `POST` requests. External systems push events directly to LiteJoin — no polling required.

## Configuration

```yaml theme={null}
sources:
  - type: http
    name: http-ingest
    topics: []   # Empty means accept any topic
    config:
      addr: ":8080"
```

| Field    | Type      | Default  | Description                                                        |
| -------- | --------- | -------- | ------------------------------------------------------------------ |
| `addr`   | string    | required | Address to listen on (e.g., `:8080`, `0.0.0.0:8080`).              |
| `topics` | string\[] | `[]`     | If set, only accept messages for these topics. Empty = accept all. |

## Sending Events

Send a JSON message to the HTTP endpoint:

```bash theme={null}
curl -X POST http://localhost:8080/ingest \
  -H "Content-Type: application/json" \
  -d '{
    "topic": "orders",
    "key": "order_123",
    "payload": "{\"amount\": 45.00, \"user_id\": \"u_456\"}"
  }'
```

### Request Format

| Field     | Type          | Required | Description                |
| --------- | ------------- | -------- | -------------------------- |
| `topic`   | string        | yes      | Target topic name          |
| `key`     | string        | yes      | Unique key for the message |
| `payload` | string (JSON) | yes      | JSON payload as a string   |

### Batch Ingestion

Send multiple messages in a single request:

```bash theme={null}
curl -X POST http://localhost:8080/ingest \
  -H "Content-Type: application/json" \
  -d '[
    {"topic": "orders", "key": "order_123", "payload": "{\"amount\": 45.00}"},
    {"topic": "orders", "key": "order_124", "payload": "{\"amount\": 12.50}"}
  ]'
```

## When to Use

Use the HTTP source when:

* Your application can push events directly (webhooks, event hooks)
* You want low-latency ingestion without polling overhead
* You're integrating with systems that support outbound webhooks

For systems that only support request/response (no push), use the [API Source](/sources/api-source) instead.
