# Send data over HTTP

> POST a JSON array of records to https://app.lampwick.dev/ingest with your project's ingest token as a bearer token, from any language or script.

HTTP ingest takes records from apps without a Lampwick package: a Node or Python service, a cron script, a deploy hook. One request carries a batch of records; the [Laravel package](/docs/laravel/) sends to the same endpoint.

## Requirements

- The project's ingest token, from the **Connect your app** card on the project's **Settings** page. Only team owners see it.
- HTTPS. The full token goes in the `Authorization` header.

## Send a record

```bash
curl -X POST https://app.lampwick.dev/ingest \
  -H "Authorization: Bearer YOUR_PROJECT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '[{"t":"log","level":"error","message":"Backup failed"}]'
```

`YOUR_PROJECT_TOKEN` is the project's ingest token.

## Check that it works

Lampwick answers `202` with the number of records it took:

```json
{"accepted": 1}
```

The log line shows up under **Logs** in the project.

## Record fields

| Field | Required | What it is |
|---|---|---|
| `t` | yes | The record type, for example `log`, `exception`, `request`, `job-attempt`, `command`, `scheduled-task`, `query`, `outgoing-request`, `queued-job`, `cache-event`, `mail` or `notification`. |
| `timestamp` | no | Unix time in seconds, as a float. Left out, it is the time Lampwick receives the record. |
| `duration` | no | In microseconds. |
| `_group` | no | The key Lampwick groups records by: a route or a job class, and for exceptions the issue. |
| `trace_id`, `execution_id` | no | Tie records to the request or job they happened in. |
| `user` | no | The id of your app's signed-in user. |

Lampwick stores records of unknown types but shows only the known types in the dashboard. `GET /api/v1/types` lists the grouped types and their fields.

## Responses

| Status | Meaning |
|---|---|
| `202` | Accepted: `{"accepted": n}`. |
| `400` | The body is not a valid JSON array of records. |
| `401` | The token is wrong. |
| `411` | The request has no `Content-Length` header. |
| `413` | The body is larger than the limit (16 MB by default). Send smaller batches. |
| `503` | Lampwick is busy. Retry after the seconds in the `Retry-After` header. |

## Troubleshooting

| What you see | Cause and fix |
|---|---|
| `401` | The token is wrong, or it was rotated. Copy it again from the project's **Settings** page. |
| `411` | Your client streams the body without a length. Send it with `Content-Length` (curl does this for `-d`). |
| `503` | Wait for `Retry-After` and send the same batch again. |
| `202`, but nothing in the dashboard | Check `t`: records of an unknown type are stored but not shown. |
