# Assign

## Assign

<mark style="color:green;">`POST`</mark> `https://api.suble.io/projects/:projectId/floating_ips/:id/assign`

Assign floating ip to virtual machine

#### Path Parameters

| Name      | Type   | Description               |
| --------- | ------ | ------------------------- |
| projectId | string | Unique id for the project |
| id        | string | Floating IP Id            |

#### Headers

| Name          | Type   | Description               |
| ------------- | ------ | ------------------------- |
| Authorization | string | User token or project key |

#### Request Body

| Name | Type   | Description           |
| ---- | ------ | --------------------- |
| vm   | string | Id of virtual machine |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success"
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "error": String
}
```

{% endtab %}
{% endtabs %}

## Detach

<mark style="color:red;">`DELETE`</mark> `https://api.suble.io/projects/:projectId/floating_ips/:id/assign?vm=:vm`

Detach floating ip from virtual machine

#### Path Parameters

| Name                                        | Type   | Description               |
| ------------------------------------------- | ------ | ------------------------- |
| projectId<mark style="color:red;">\*</mark> | string | Unique id for the project |
| id<mark style="color:red;">\*</mark>        | string | Floating IP Id            |

#### Query Parameters

| Name                                 | Type     | Description |
| ------------------------------------ | -------- | ----------- |
| vm<mark style="color:red;">\*</mark> | ObjectID | VM ID       |

#### Headers

| Name                                            | Type   | Description               |
| ----------------------------------------------- | ------ | ------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | User token or project key |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success"
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "error": String
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.suble.io/floating-ip/assign.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
