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

# 原生 JSON 接入

> 以 JSON 向流 POST 记录。

```http theme={null}
POST /api/v1/intake/{type}/{stream}
```

`{type}` 为 `logs`、`metrics` 或 `traces`。POST 单条记录对象或数组。流在首次写入时创建，schema 随
字段出现演进。时间戳为 Unix 纪元起的微秒（`_timestamp`）。

**路径参数**

| 参数       | 类型     | 说明                            |
| -------- | ------ | ----------------------------- |
| `type`   | string | `logs` / `metrics` / `traces` |
| `stream` | string | 流名，如 `app`                    |

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST http://localhost:5080/api/v1/intake/logs/app \
    -H "authorization: Bearer $MS_JWT" \
    -H 'content-type: application/json' \
    -d '[{"_timestamp":1700000000000000,"level":"error","msg":"db pool exhausted","trace_id":"abc123"}]'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  { "accepted": 1, "rejected": 0, "errors": [] }
  ```
</ResponseExample>

`402` 表示许可证、订阅、试用或每日摄取额度阻止写入；`413` 表示组织存储配额已超；`429` 表示触发
摄取限流。该接口需要 `streams.write`。
