# create()

Canonical URL: https://developers.iagenify.com/pt/sdk/ref/hosts/create/
Language: pt

`api.hosts.create({ runtime, framework, label, slug? }) → Promise<Host>`

Crea un host e riserva la sua adrese. La lima viene da label, o lo impunes — non è mai tranquilllès correctè.

Status: POST /api/hosting · slug is the URL · reserved names refused

```javascript
const site = await api.hosts.create({ runtime: "static", framework: "vite", label: "Portfolio" });
// { id, runtime: "static", framework: "vite", slug: "portfolio", url: "https://portfolio.…", status: "empty" }
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `runtime` | string | obrigatório | `site` · `app` · `function`. |
| `framework` | string |  | Il nome che una persona lee. |
| `label` | string |  | La prima parte del domicilio. Deriva da rótula altrimenti. |
| `slug` | string |  | The first part of the address. Derived from the label otherwise. |

## La lima è l'indirizzo {#slug}

> **Non potra essere cambiat poi**
>
> Cambiando il dispersò links ya condivisat, il dominio personalizzato ad esso e il certificate emitat per quel nome host. Per un altro address, crea un altro host — e update() cambia la etiqueta solo.

## Un lima invalidès è negatè, non fisso {#never-corrected}

Una lima corretta in tuo nome da un addresse non chiesed per, descoperta poi in un link che non funciona. `invalid_slug` dice così mentre tu ancora sei eligendo.

## Nomes reservados {#reserved}

I nomi di una piattaforma risponde per — i usati per posta, per log in, per facturazione, per l'administrazione — non sono disponibili. It's che impede un cliente di prendere uno; l'adresse uni-nivel-per-kind è la vera protezione, e questo è la cintura.

## Erros {#errors}

| Código | Status | Quando |
| --- | --- | --- |
| invalid_kind | 400 | Nessuna specie, o un tipo la plataforma non sa. |
| invalid_slug | 400 | Non un lima usable, o un nome riservat. |
| slug_taken | 400 | - Qualcuno lo ha. |
| hosting_limit | 409 | La contatura del plan è usata. |
| hosting_not_in_plan | 403 | Il plan n'has ningun hosting. |
| hosting_kind_unavailable | 403 | Aquella clase non sa ancora servir. |
| hosting_kind_unavailable | 501 | That kind cannot serve yet. |

## Comincia vazio {#empty}

`status: "empty"` e niente online. [deploy()](/pt/sdk/ref/host/deploy)è lo che mette qualcosa là.

- [deploy()](/pt/sdk/ref/host/deploy): Metì i files on line.
- [kinds()](/pt/sdk/ref/hosts/kinds): Antes di escoger un tipo.
- [usage()](/pt/sdk/ref/hosts/usage): Prima de crear.

```python
site = api.hosts.create(runtime="static", framework="vite", label="Portfolio")
# site.id, site.runtime == "static", site.framework == "vite", site.slug == "portfolio",
# site.url == "https://portfolio.…", site.status == "empty"
```
