---
title: "Create an app secret"
method: POST
path: "/api/v1/hosting/apps/{app_id}/secrets"
tags: ["hosting"]
---

# Create an app secret

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

## 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}/secrets`
- Auth: HTTP bearer

## Path parameters

- `app_id` string, required

## Request body

- object
  - `slug` string, required
  - `name` string, required
  - `env_key` string, nullable
  - `description` string, nullable
  - `rotation_policy` string, nullable
  - `expose_to_build` boolean
  - `value` string
  - `value_kind` string

## Response `200`

Success

- object

## Other responses

- `201`: Created secret metadata
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `422`: Unprocessable entity
- `502`: Bad gateway

---

[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)
