# start_cmd is top-level; the readiness probe lives under runtime_config.
# COPY needs an uploaded build_context, so the full body is large — see the
# API reference for the complete CreateTemplateRequest schema.
curl -N -X POST "${NULLSPACE_API_URL}/v1/templates/build" \
-H "Authorization: Bearer ${NULLSPACE_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"name": "api-template",
"base_image": "python:3.12",
"steps": [
{"action": "pip_install", "packages": ["fastapi", "uvicorn"]},
{"action": "workdir", "path": "/workspace"}
],
"start_cmd": "uvicorn app:app --host 0.0.0.0 --port 8080",
"runtime_config": {"readiness": {"kind": "tcp", "port": 8080}}
}'