# Organization API: Customer Portal: Server icon

> The 4 Organization API operations for server icon.

Source: https://www.coritan.com/docs/api/reference/organizations/customer-portal/servers-server-icon/

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

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/server-icon`](#op-get-api-v1-orgs-org-slug-portal-servers-uuid-server-icon) | The server's Minecraft server icon, server-icon.png in the server root |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/server-icon`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-server-icon) | Convert a picture to the 64×64 PNG Minecraft accepts and save it as /server-icon.png |
| DELETE | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/server-icon`](#op-delete-api-v1-orgs-org-slug-portal-servers-uuid-server-icon) | Delete /server-icon.png |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/server-icon/preview`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-server-icon-preview) | Render a picture as a server icon in every fit mode, without saving it |

### The server's Minecraft server icon, server-icon.png in the server root {#op-get-api-v1-orgs-org-slug-portal-servers-uuid-server-icon}

`GET /api/v1/orgs/{org_slug}/portal/servers/{uuid}/server-icon`

The server's Minecraft server icon, ``server-icon.png`` in the server root.

``present`` says whether the file is there, and ``icon`` is the picture as a
data URI when it is a readable image of 256 KB or less. ``format``,
``width``, ``height`` and ``bytes`` describe it, and ``valid`` says whether
the game shows it: Minecraft only shows a PNG of exactly 64×64 pixels.
``problems`` names what is wrong with any other file (``not_png``,
``wrong_size``, ``unreadable``, ``too_large`` or ``is_directory``).
``support.supported`` is false on a Bedrock server or another game, which
have no server list icon. Needs ``file.read``.

#### 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. |

### Convert a picture to the 64×64 PNG Minecraft accepts and save it as /server-icon.png {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-server-icon}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/server-icon`

Convert a picture to the 64×64 PNG Minecraft accepts and save it as ``/server-icon.png``.

Send the picture as the multipart field ``file`` (up to 10 MB, as for the
preview) and the fit mode as ``fit``. The file replaces any icon already
there. The game reads it when the server starts, so restart the server to
show it. The answer is the saved icon as a data URI with ``valid: true``.
Needs ``file.create``. A file that is not a picture or an unknown ``fit``
answers 400, and one over 10 MB answers 413.

#### Parameters

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

#### Request body

`multipart/form-data` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `file` | string (binary) | yes |  |
| `fit` | string | no | How to square a picture that is not square: cover, contain or stretch. |

#### Responses

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

### Delete /server-icon.png {#op-delete-api-v1-orgs-org-slug-portal-servers-uuid-server-icon}

`DELETE /api/v1/orgs/{org_slug}/portal/servers/{uuid}/server-icon`

Delete ``/server-icon.png``.

The server list shows the default icon after the next restart. Needs
``file.delete``.

#### 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. |

### Render a picture as a server icon in every fit mode, without saving it {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-server-icon-preview}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/server-icon/preview`

Render a picture as a server icon in every fit mode, without saving it.

Send the picture as the multipart field ``file``, up to 10 MB. PNG, JPEG,
GIF, WebP, BMP, TIFF, ICO and most other image formats are read; SVG is
refused, so export it as a PNG first. ``variants`` holds one 64×64 PNG data
URI per fit mode: ``cover`` crops the edges to fill the square,
``contain`` keeps the whole picture with transparent edges and ``stretch``
squashes it. ``suggested_fit`` is ``contain`` for a transparent picture
that is not square and ``cover`` otherwise, and ``source`` describes the
upload. Needs ``file.create``. A file that is not a picture answers 400,
and one over 10 MB answers 413.

#### Parameters

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

#### Request body

`multipart/form-data` (required)

| Field | Type | Required |
| --- | --- | --- |
| `file` | string (binary) | yes |

#### Responses

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