# Organization API: Customer Portal: Allocations

> The 8 Organization API operations for allocations.

Source: https://docs.coritan.com/api/reference/organizations/customer-portal/servers-allocations/

Part of [Customer Portal](/api/reference/organizations/customer-portal/).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations`](#op-get-api-v1-orgs-org-slug-portal-servers-uuid-allocations) | List allocations |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-allocations) | Create allocation |
| GET | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations/available-ports`](#op-get-api-v1-orgs-org-slug-portal-servers-uuid-allocations-available-ports) | Available ports |
| GET | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations/request`](#op-get-api-v1-orgs-org-slug-portal-servers-uuid-allocations-request) | Get port request |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations/request`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-allocations-request) | Ask staff for an extra port on a free server whose brand requires it |
| DELETE | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations/{allocation_id}`](#op-delete-api-v1-orgs-org-slug-portal-servers-uuid-allocations-allocation-id) | Delete allocation |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations/{allocation_id}/primary`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-allocations-allocation-id-primary) | Make one of the server's ports the one players type |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations/{allocation_id}/publish-port`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-allocations-allocation-id-publish) | Publish a port on the game's default port of the attached floating IP |

### List allocations {#op-get-api-v1-orgs-org-slug-portal-servers-uuid-allocations}

`GET /api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations`

The server's ports, where they publish, the node-range limit, the rules
for ports on its dedicated IP (``dedicated_ip``, when one is attached) and
which default port its players type (``game``).

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Create allocation {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-allocations}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json`

| Field | Type | Required |
| --- | --- | --- |
| `port` | integer or null | no |
| `notes` | string or null | no |
| `on_dedicated_ip` | boolean | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `201` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Available ports {#op-get-api-v1-orgs-org-slug-portal-servers-uuid-allocations-available-ports}

`GET /api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations/available-ports`

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuid` | path | string | yes |  |
| `org_slug` | path | string | yes |  |
| `limit` | query | integer | no | Default: `50`. |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Get port request {#op-get-api-v1-orgs-org-slug-portal-servers-uuid-allocations-request}

`GET /api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations/request`

Whether this server's extra ports go through a ticket, and the open
request if there is one, so the panel can say "requested" rather than
offer the form twice.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Ask staff for an extra port on a free server whose brand requires it {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-allocations-request}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations/request`

Ask staff for an extra port on a free server whose brand requires it.

Opens one ticket tagged ``port-request`` against the order; a second
request while one is open is answered with the first. Refused with 403
when the brand does not require requests, because then the customer can
add the port themselves and the panel should not have offered this.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `note` | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `201` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Delete allocation {#op-delete-api-v1-orgs-org-slug-portal-servers-uuid-allocations-allocation-id}

`DELETE /api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations/{allocation_id}`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `allocation_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Make one of the server's ports the one players type {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-allocations-allocation-id-primary}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations/{allocation_id}/primary`

Make one of the server's ports the one players type.

On a dedicated IP this is how the default port is chosen: the row on 25565
(or 19132) becomes primary, Wings hands it to the process as ``SERVER_PORT``,
the brand hostname's route follows, and a running server restarts onto it.
The ``publish`` block says what happened.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `allocation_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Publish a port on the game's default port of the attached floating IP {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-allocations-allocation-id-publish}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/allocations/{allocation_id}/publish-port`

Publish a port on the game's default port of the attached floating IP.

The whole point of a dedicated address is that players type it and nothing
else, so this is what makes ``25565`` (or ``19132`` for Bedrock) answer on
the float. Wings rebinds and a running server restarts, exactly as on attach.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `allocation_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json`

| Field | Type | Required |
| --- | --- | --- |
| `port` | integer or null | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |
