Files
descrybe/docs/API_V11_AUDIT.md
T
2026-10-15 21:22:43 +02:00

46 lines
3.2 KiB
Markdown

# Public API / processing audit (v11)
## Customer-facing API contract
- **Public API base**: `https://api.descrybe.io/api/v1`
- **Interactive reference**: `https://descrybe.io/docs`
- **Spec**: `https://api.descrybe.io/api/v1/openapi.yaml`
- **Authentication**: Company API key in `Authorization: Bearer dk_...` or `X-API-Key: dk_...`, except public health/spec operations.
- **Dashboard operations**: Team and platform-admin controls are not available via an API key. They require a signed-in dashboard session and CSRF where applicable.
Source comparison: `apps/api/internal/httpapi/v1.go` vs `apps/api/internal/httpapi/v1_openapi.go`. The router registers **35 public paths and 49 method/path operations**; all 49 are covered by the OpenAPI definition. The OpenAPI document also includes two intentionally separate session-only paths (`/team/{userID}`, `/admin/emails/set-password`).
## Processing modes
The **What to process** menu now includes only these content deliverables:
| Choice | Execution mode | What happens |
|---|---|---|
| AI Title | `title` | Runs the enrichment pipeline to generate product copy |
| AI Description | `description` | Runs the enrichment pipeline to generate product copy |
| SEO Meta | `seo_meta` | Generates `meta_title` / `meta_description`, preserving existing product name and description |
| Any combination | `enhance` | Runs the combined enrichment pass; the backend is not yet a fully independent field-by-field AI generator |
Category resolution and attribute parsing are internal prerequisites and are not checkboxes. The backend uses `processing_type` to select execution; `processing_types` is an informational selection list, not an execution instruction.
For the public API, `POST /products/process` accepts products by EAN; `POST /process` uses raw-product UUIDs. The payloads, status codes, and response wrappers differ. See [public-api-reference.md](public-api-reference.md) and the interactive OpenAPI spec.
## Feed and export formats
- Feed ingestion: XML (including `SHOPITEM` and nested `PARAMS`), CSV, JSON.
- Feed create: `name` plus `url` or `item_path`. Remote feeds can generally infer an item path. Explicit JSON array paths are also supported.
- Secret-bearing feed headers are configured through the logged-in dashboard; the public `POST /feeds` body does not accept arbitrary headers.
- Export-feed create supports `xml`, `csv`, and `json`; public token URLs have the corresponding extension. JSON token download is registered at `/api/public/export-feeds/{token}.json`.
## Deployment
Deploy the **web, API, and worker** from the same ZIP. This update does not require a database migration. After deployment, check the production `/docs` page, the three processing checkboxes, a SEO-only job, and a JSON export URL.
## Checks and limitations
- OpenAPI YAML parses; all references resolve; all 49 public route/method registrations appear in the document.
- Two frontend processing selection tests pass.
- The modified frontend TypeScript blocks parse.
- All 664 Go source/test files parse with standard `go/parser`.
- A complete Go 1.25 API/worker compilation, Svelte build, database-integrated processing, and live endpoint E2E were **not** available here, so production runtime compatibility still requires your deployment checks.