# Builds API

2 operations under /api/v1. Errors are RFC 9457 problem+json with a stable `code` field. The complete schemas are in https://nebulactrl.com/api/v1/openapi.json.

## GET /team/build-settings

Get the team's default build location and registry

Projects and services can override the default; resolution is service, then project, then team.

Authentication: session cookie or `Authorization: Bearer nct_…` token.

Response 200: OK (TeamSettings)
  - `buildLocation` (enum: target | build_server, required)
  - `registryId` (string, required)
  - `updatedAt` (string (date-time) | null, required)
Errors: 401 Unauthorized; 403 Forbidden; 500 Internal Server Error

## PUT /team/build-settings

Set the team's default build location and registry

With buildLocation build_server, git services build on a build server and push the image to the registry; the deploying server pulls it by digest. Without a usable build server or registry a build falls back to the target server and says so in the deployment's events. Administrators only.

Authentication: session cookie or `Authorization: Bearer nct_…` token.

Request body (application/json, required): PutTeamSettingsInputBody
  - `buildLocation` (enum: target | build_server, required): Where services build by default: on their own server (target) or on a build server.
  - `registryId` (string): Default registry builds are pushed to; omitted clears it.

Response 200: OK (TeamSettings)
  - `buildLocation` (enum: target | build_server, required)
  - `registryId` (string, required)
  - `updatedAt` (string (date-time) | null, required)
Errors: 401 Unauthorized; 403 Forbidden; 422 Unprocessable Entity; 500 Internal Server Error
