---
id: w2/m4/t001
title: Verify the shipped create surface against Render's OpenAPI, field-by-field
worker: worker2
status: done
estimate: 20m
depends_on: []
---

## Objective

The create surface exists (shipped inside w2/m2/t001: `Service.Create` in `lego/backend/internal/apps/service.go`, `POST /v1/services` 201, `createService`, MCP `create_web_service`) but was built under deploy-from-chat pressure and never verified field-by-field against Render's OpenAPI — the verification standard every other REST surface followed. Do that verification now: request body (`serviceDetails` nesting, `env`, `plan`, image/repo source), response envelope, status codes, error shapes. Classify each divergence: fix trivially in place, or record it as a documented "safe superset" omission in docs/ADR006-bex-api.md.

## Context

- Spec artifact: `render-public-api-1.json` (referenced throughout docs/ADR006-bex-api.md).
- The established rule: bex accepts the fields it honors and omits what it can't (build plans, regions, disks) — divergence is fine when documented, silent drift is not.
- Also check the `/v1/apps` alias serves the create route like every other service route, and that MCP `create_web_service` arg names still match `render-oss/render-mcp-server`.

## Steps

1. Diff Render's `POST /v1/services` request/response schema against `rest.go` + the `CreateRequest` mapping.
2. Fix cheap mismatches (field names, status codes, envelope) in place; list structural omissions in docs/ADR006-bex-api.md's create row.
3. Record findings that need real work as notes for t007 (tests) or inbox notes.

## Files

- `lego/backend/internal/apps/rest.go`, `lego/backend/internal/apps/service.go` (fixes only)
- `docs/ADR006-bex-api.md`

## Acceptance criteria

- [ ] Every field in Render's create schema is classified: honored / documented omission / fixed — no unclassified drift.
- [ ] docs/ADR006-bex-api.md's create documentation matches the verified reality.

## Out of scope

- The delete half (t002/t003); building from `repo` (w1/m5).
