---
title: "POST /api/v1/hosting/apps/{app_id}/preview_profiles"
method: POST
path: "/api/v1/hosting/apps/{app_id}/preview_profiles"
tags: ["hosting"]
---

# POST /api/v1/hosting/apps/{app_id}/preview_profiles

`POST /api/v1/hosting/apps/{app_id}/preview_profiles`

## Request

- Base URL: `https://composal.com` (the document declares no server; this is the origin it was published from)
- URL: `https://composal.com/api/v1/hosting/apps/{app_id}/preview_profiles`
- Auth: HTTP bearer

## Path parameters

- `app_id` string, required

## Request body

- object
  - `name` string, required
  - `slug` string, required
  - `source_environment_id` string, required
  - `ttl_days` integer
  - `automatic` boolean
  - `configuration` PreviewDefaultsConfiguration
    - `variables` object
    - `build_variables` object
    - `required_keys` string[]
    - `service_resources` PreviewResourceOverrides: Service public IDs mapped to resource overrides. Omitted fields inherit; an empty map removes all local overrides. Null reservations select platform defaults.

## Response `201`

Created preview defaults

- object
  - `profile` PreviewProfileRecord, required
    - `id` string, required
    - `hosted_app_id` string, required
    - `source_environment_id` string, required
    - `name` string, required
    - `slug` string, required
    - `automatic` boolean, required
    - `ttl_days` integer, required
    - `created_at` string
    - `updated_at` string
    - `configuration` PreviewDefaultsConfiguration, required
      - `variables` object
      - `build_variables` object
      - `required_keys` string[]
      - `service_resources` PreviewResourceOverrides: Service public IDs mapped to resource overrides. Omitted fields inherit; an empty map removes all local overrides. Null reservations select platform defaults.

## Other responses

- `401`: Authentication required
- `403`: Organization administrator required
- `404`: App or source not found
- `409`: Source cannot be captured
- `422`: Invalid preview configuration
- `502`: Hosting dependency unavailable

---

[API](https://skmtc.dev/composal/apis/vex-api.md) - [All operations](https://skmtc.dev/composal/apis/vex-api/llms.txt) - [OpenAPI document](https://skmtc.dev/composal/apis/vex-api/revisions/74298a24e040?raw)
