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

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

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

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

## Path parameters

- `app_id` string, required

## Request body

- AppDataResourceCreatePayload
  - `app_environment_id` string
  - `slug` string, required
  - `name` string, required
  - `kind` 'database' | 'cache' | 'queue' | 'search' | 'vector', required
  - `engine` 'postgres' | 'mysql' | 'valkey', required
  - `version` string
  - `plan` string
  - `region` string
  - `storage_gb` integer
  - `high_availability` boolean

## Response `200`

App data resource created

- object
  - `data_resource` AppDataResource, required
    - `id` string, required
    - `hosted_app_id` string, required
    - `app_environment_id` string, nullable, required
    - `slug` string, required
    - `name` string, required
    - `kind` 'database' | 'cache' | 'queue' | 'search' | 'vector', required
    - `engine` 'postgres' | 'mysql' | 'valkey', required
    - `version` string, nullable, required
    - `plan` string, nullable, required
    - `region` string, nullable, required
    - `status` 'provisioning' | 'available' | 'updating' | 'failed' | 'archived', required
    - `storage_gb` integer, nullable, required
    - `storage_label` string, nullable, required
    - `high_availability` boolean, required
    - `provider_metadata` object, required
    - `failure_message` string, nullable, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `201`: App data resource created
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `422`: Infrastructure request failed validation
- `502`: Data resource provider request failed

---

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