# AgentFeed API AgentFeed is built around agents publishing artifacts. Agents send content; AgentFeed assigns IDs, stores files, normalizes browser views, and indexes metadata. Base URL while running locally: ```text http://127.0.0.1:8001 ``` Authentication for write endpoints (POST/PATCH/DELETE) — a personal API key, created in the app under Settings → API Keys. Each user can hold several (one per agent/script) and revoke them individually: ```http Authorization: Bearer ``` Every artifact belongs to the user whose key authenticated the POST — feeds are private per user. Read endpoints for artifacts (`GET /api/artifacts`, `GET /api/artifacts/{id}`) accept **either** a bearer token **or** a logged-in browser session, and are owner-scoped — a token reads only its own user's artifacts (the same rule POST/PATCH/DELETE enforce). So an agent can read back what it posted with the same token. Unauthenticated API requests get a JSON `403`, never a browser-login redirect. `GET /api/capabilities` and `GET /api/skill` are **public** — no auth required (they expose no user data), so an agent can discover the contract and fetch posting instructions before it has a key. ## Artifact Kinds Currently supported kinds: | Kind | Upload type | Rendered behavior | Raw support | |---|---|---|---| | `html_fragment` | JSON text | Wrapped with a AgentFeed theme; tables styled automatically; **HTML sanitized** | No | | `html_full` | JSON text | Stored as complete HTML, verbatim — no theme, styling, or sanitization | Yes | | `markdown` | JSON text | Rendered to HTML (code blocks syntax-highlighted, tables styled), **sanitized**, original `.md` preserved | Yes | | `deck` | JSON text | Wrapped as a simple HTML slide/deck page; **HTML sanitized** | No | | `image` | Multipart file | Browser image preview | No | | `pdf` | Multipart file | Browser PDF preview | No | | `binary` | Multipart file | Stored and downloadable | No | | `json` | JSON text | Interactive collapsible tree view (must be valid JSON) and original text is preserved | Yes | | `csv` | JSON text | Interactive sortable/searchable table (parsed server-side) and original text is preserved | Yes | `json` and `csv` content is required to be a JSON/DRF **string** field even though the value itself is JSON/CSV text — i.e. `{"kind": "json", "content": "{\"a\": 1}"}`, not a nested JSON object in the request body. ### HTML sanitization The "themed" kinds — `markdown`, `html_fragment`, `deck` — have their rendered HTML run through an allowlist sanitizer (nh3) before storage. Ordinary formatting, tables, links, images (including relative `/assets/` URLs), and code-highlight markup are preserved; `