# [BETA] Attach volume

```http
POST /compute/v1/tenants/{tenantId}/volumes/{volumeId}/attach
```

Base URL: `https://api-portal.aur.lu/api`

Operation ID: `AttachVolume`

Authentication: ApiKeyAuth (API key in header `X-Api-Key`)

Required permission: `update:compute:volumes`

Attaches a volume to a virtual machine

## Parameters

### Path parameters

- `tenantId` (string, required) — Tenant ID
- `volumeId` (string, required) — Volume ID

## Request body (required)

Attachment details

Content type: `application/json`

- `deviceId` (integer)
- `instanceId` (string)

Example request body:

```json
{
  "deviceId": 0,
  "instanceId": "string"
}
```

## Responses

### 200 — OK

Content type: `application/json`

- `id` (string)
- `jobId` (string)

### 204 — Volume already attached

### 400 — Bad Request

Content type: `application/json`

- `message` (string)

### 403 — Compute is read-only or suspended for this tenant

Content type: `application/json`

- `message` (string)
