---
title: "attachEnvironmentService"
method: POST
path: "/platform/environments/{id}/services"
tags: ["Platform"]
---

# attachEnvironmentService

`POST /platform/environments/{id}/services`

## Request

- Base URL: `https://api.imprezahost.com/v1`
- URL: `https://api.imprezahost.com/v1/platform/environments/{id}/services`
- Auth: API key in header `X-API-Key` and API key in header `X-API-Secret`

Deploy scope. Explicit existing app association; does not deploy or copy settings. At most 100 per environment.

## Path parameters

- `id` string, required

## Request body

- object
  - `deployment_id` string, required
  - `component` string, required
  - `role` 'web' | 'worker' | 'database' | 'cache', required

## Response `200`

Metadata operation result

## Other responses

- `400`: Invalid input
- `403`: Required scope missing
- `404`: Resource or current ownership unavailable
- `409`: Conflicting association or active operation
- `429`: Quota exceeded
- `503`: Storage unavailable; read before retrying

---

[API](https://skmtc.dev/imprezahost/apis/impreza-host-public-api.md) · [All operations](https://skmtc.dev/imprezahost/apis/impreza-host-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/imprezahost/apis/impreza-host-public-api/revisions/db86511f604f?raw)
