# Public API

Public endpoints live under `/api/public/*` and bypass session auth. Authenticate with an API key issued from `/projects/:id`.

## Submit an item

`POST /api/public/items`

### Headers

```
Content-Type: application/json
x-api-key: <your project API key>
```

### Body

```json
{
  "project_id": "uuid",
  "input": { "anything": "json" },
  "suggestion": "AI's proposed answer (string or JSON)",
  "confidence": 0.82,
  "risk_flags": ["pii", "high_value"],
  "metadata": { "source": "support-bot-v3" }
}
```

### Response

```json
{
  "id": "uuid",
  "status": "auto_approved" | "queued" | "escalated",
  "decision": null | { ... }
}
```

## Stable URLs

Use these for webhook destinations and external integrations — they survive renames:

* Production: `https://human-in-the-loop.cc`
* Custom domain: `https://human-in-the-loop.cc`

## Source

`src/routes/api/public/items.ts`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hitl-01.gitbook.io/hitl-docs/api/public-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
