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

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

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

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

## Path parameters

- `app_id` string, required

## Request body

- AppConfigVariableCreatePayload
  - `app_environment_id` string
  - `app_service_id` string
  - `scope_kind` 'app' | 'environment' | 'service', required
  - `key` string, required
  - `value` string
  - `value_kind` 'plain' | 'secret' | 'reference', required
  - `description` string
  - `exposed_to_build` boolean, required

## Response `200`

App configuration variable created

- object
  - `config_variable` AppConfigVariable, required
    - `id` string, required
    - `hosted_app_id` string, required
    - `app_environment_id` string, nullable, required
    - `app_service_id` string, nullable, required
    - `scope_kind` 'app' | 'environment' | 'service', required
    - `key` string, required
    - `value` string, nullable, required
    - `has_value` boolean, required
    - `value_kind` 'plain' | 'secret' | 'reference', required
    - `description` string, nullable, required
    - `exposed_to_build` boolean, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `201`: App configuration variable created
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `422`: Hosting delivery request failed validation
- `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)
