---
title: "[BETA] Attach a Compute instance to a Subnet"
method: PUT
path: "/vpc/{vpc-id}/subnet/{subnet-id}/attach"
tags: ["vpc-subnet"]
---

# \[BETA\] Attach a Compute instance to a Subnet

`PUT /vpc/{vpc-id}/subnet/{subnet-id}/attach`

## Request

- Base URL: `https://api-ch-gva-2.exoscale.com/v2`
- URL: `https://api-ch-gva-2.exoscale.com/v2/vpc/{vpc-id}/subnet/{subnet-id}/attach`
- Auth: none declared
- TypeScript: <https://skmtc.dev/exoscale/apis/exoscale-api/docs/vpc/:vpc-id/subnet/:subnet-id/attach/put.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `vpc-id` string, uuid, required
- `subnet-id` string, uuid, required

## Request body

- object
  - `instance` InstanceRef, required: Target Instance
    - `id` string, uuid: Instance ID
  - `ipv4` string, ipv4: Instance IPv4

## Response `200`

200

- Operation: Operation
  - `id` string, uuid: Operation ID
  - `reason` 'incorrect' | 'unknown' | 'unavailable' | 'forbidden' | 'busy' | 'fault' | 'partial' | 'not-found' | 'interrupted' | 'unsupported' | 'conflict': Operation failure reason
  - `reference` object: Related resource reference
    - `id` string, uuid: Reference ID
    - `link` string: Link to the referenced resource
    - `command` string: Command name
  - `message` string: Operation message
  - `state` 'failure' | 'pending' | 'success' | 'timeout': Operation status

## Changes

- **2026-11-06** `63da6f74c845`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/exoscale/apis/exoscale-api/changes/vpc/:vpc-id/subnet/:subnet-id/attach/put.md)

---

[API](https://skmtc.dev/exoscale/apis/exoscale-api.md) - [All operations](https://skmtc.dev/exoscale/apis/exoscale-api/llms.txt) - [OpenAPI document](https://skmtc.dev/exoscale/apis/exoscale-api/revisions/63da6f74c845?raw)
