---
title: "Render a redacted effective Compose preview for a connected repository."
method: POST
path: "/repositories/{repository_id}/compose-file/preview"
tags: ["Git Providers"]
---

# Render a redacted effective Compose preview for a connected repository.

`POST /repositories/{repository_id}/compose-file/preview`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/repositories/{repository_id}/compose-file/preview`
- Auth: HTTP bearer

## Path parameters

- `repository_id` integer, required

## Request body

- ComposePreviewRequest
  - `branch` string, nullable
  - `composeOverride` string, nullable
  - `environmentId` integer, nullable: Environment whose variables resolve `${VAR}`; defaults to the project's production environment. Requires `project_id`.
  - `excludedServices` string[]
  - `path` string, required
  - `previewPolicy` ComposeSecurityPolicy: Advisory preview only. Deployment reloads the saved project policy. Ignored when `project_id` is set: the saved policy is used instead.
    - `disabled_checks` ComposeSecurityCheck[]
  - `projectId` integer, nullable: The project this Compose file deploys. When set, the preview runs the deploy job's check with that project's saved security policy and the environment's variables (values are never returned), so it fails with the same error class a deployment would.

## Response `200`

Effective Compose preview rendered

- ComposePreviewResponse
  - `check` ComposeCheckReport, nullable: Result of running the deploy-time resolution and policy validation.
    - `command` ComposeCheckCommand, nullable: The `docker compose` invocation a check ran, sanitized for display.
      - `argv` string[], required: Program and arguments. Contains paths and option names only; no variable values are passed on the command line.
      - `exit_code` integer, nullable: Process exit code; `None` when it was killed or did not start.
      - `stderr` string, nullable: The tail of stderr with variable values, quoted text, assignments, URLs and absolute paths removed. Line numbers and error wording are kept.
    - `error` string, nullable: The same message the deployment would fail with. Variable values are redacted.
    - `error_class` 'interpolation' | 'policy_violation' | 'invalid_path' | 'invalid_yaml' | 'invalid_override' | 'unsupported_compose_version' | 'config_resolution' | 'compose_unavailable' | 'internal', nullable: Stable, user-facing class of a Compose check failure. The deploy job, the preview and the check action all report the same class for the same input.
    - `notes` string[], required: Caveats about what this check could not cover.
    - `passed` boolean, required: Whether the configuration would pass the deploy-time checks.
    - `referenced_variables` string[], required: Variables the file references, in sorted order. Names only.
    - `resolution_ran` boolean, required: Whether `docker compose config` actually ran for this check.
    - `resolution_reasons` string[], required: Why `docker compose config` had to run (project override, include, extends, YAML tags). Empty when the file was validated directly.
    - `unset_variables` string[], required: Variables referenced without a default that are not set; Compose substitutes an empty string for each.
  - `disabledServices` string[], required
  - `effectiveCompose` string, required: Effective user-controlled Compose YAML with sensitive values redacted.
  - `enabledServices` string[], required
  - `overrideRedundancy` 'identical' | 'superset', nullable: How a saved project override relates to the repository Compose file.
  - `overrideWarning` string, nullable: What to do about `override_redundancy`.
  - `path` string, required
  - `redactedValues` integer, required
  - `repositoryId` integer, required

## Other responses

- `400`: Compose file or override is invalid
- `401`: Authentication required
- `404`: Repository not found

## Changes

- **2026-11-09** `12896146b193`: 1 breaking
  - removed the required property `allOf[#/components/schemas/ProblemDetails]/extensions` from the response with the `400` status
- **2026-10-15** `1e4cb0e3bc90`: 7 info
  - added the new optional request property `environmentId`
  - added the new optional request property `projectId`
  - added the optional property `allOf[subschema #2]/compose_check` to the response with the `400` status
  - added the optional property `allOf[subschema #2]/error_class` to the response with the `400` status
  - …3 more
- **2026-10-05** `4b228ebed583`: 2 info
  - added the new optional request property `previewPolicy`
  - added the media type `application/problem+json` for the response with the status `400`
- **2026-10-05** `63a80791dc58`: 1 breaking, 1 warning
  - removed the media type `application/problem+json` for the response with the status `400`
  - removed the request property `previewPolicy`
- **2026-09-23** `f4efc4d5c7b7`: 3 breaking, 1 warning, 1 info
  - the response's body type changed from `object` to no type for status `400`
  - removed the required property `detail` from the response with the `400` status
  - removed the required property `title` from the response with the `400` status
  - removed the optional property `policy_check` from the response with the `400` status
  - …1 more

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/repositories/:repository_id/compose-file/preview/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
