# Stacks API

1 operation 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.

## POST /environments/{environmentId}/stacks/check

Check a compose file for running as a stack

Parses the compose file, lists its components and applies the Compose allow-list for the given server. Nothing is stored. Violations of kind `unsupported` always block a stack; `restricted` ones only on a server without Unrestricted. A file that is not valid YAML or not a compose file is a 422 `invalid_compose`.

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

Parameters:
- `environmentId` (path, string, required)

Request body (application/json, required): CheckStackInputBody
  - `compose` (string, required): The compose file (YAML) to check
  - `serverId` (string): The server the stack will run on; decides whether Unrestricted applies

Response 200: OK (StackCheck)
  - `components` (StackComponent[] | null, required)
  - `composeAvailable` (boolean | null, required)
  - `notes` (string[] | null, required)
  - `unrestricted` (boolean, required)
  - `violations` (Violation[] | null, required)
Errors: 401 Unauthorized; 403 Forbidden; 404 Not Found; 422 Unprocessable Entity (`invalid_compose`); 500 Internal Server Error
