---
id: w1/m2/t006
title: Minimal API — create tenant / app / domain
worker: worker1
status: done
estimate: 30m
depends_on: [w1/m2/t003]
---

## Objective

Expose the smallest product API that writes the source of truth: create a tenant, create an app, add a domain. Business logic lives here (validation), not in the operator or DB procs.

## Context

- Writes `tenants`/`apps`/`domains` rows (t003); the reconciler (t005) projects them to CRs.

## Steps

1. `POST /tenants`, `POST /apps`, `POST /domains` — validate + insert.
2. Return the created resource + its (eventual) status URL.

## Files

- `operator/internal/controlplane/api.go`

## Acceptance criteria

- [ ] `POST /apps` inserts a row and returns 201; invalid input is rejected with 4xx.

## Out of scope

- Auth on the API, UI (later).
