# create()

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

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

Creates a host and reserves its address. The slug comes from the label, or you impose it — it is never quietly corrected.

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 | required | `static` or `edge`. |
| `framework` | string |  | For `static`: html, vite, react, vue, angular, astro or next-static. For `edge`: worker or hono. |
| `label` | string |  | The name a person reads. |
| `slug` | string |  | The first part of the address. Derived from the label otherwise. |

## The slug is the address {#slug}

> **It cannot be changed afterwards**
>
> Changing it would break links already shared, the custom domain attached to it and the certificate issued for that hostname. For another address, create another host — and update() changes the label only.

## An invalid slug is refused, not fixed {#never-corrected}

A slug corrected on your behalf gives an address nobody asked for, discovered later in a link that does not work. `invalid_slug` says so while you are still choosing.

## Reserved names {#reserved}

The names a platform answers for — the ones used for mail, for signing in, for billing, for administration — are not available. That is what keeps a customer from taking one; the one-level-per-kind addressing is the real protection, and this is the belt.

## Errors {#errors}

| Code | Status | When |
| --- | --- | --- |
| unsupported_runtime | 400 | A runtime other than static or edge. |
| unsupported_framework | 400 | The framework is incompatible with the selected runtime. |
| invalid_slug | 400 | Not a usable slug, or a reserved name. |
| slug_taken | 409 | Someone has it. |
| hosting_limit | 403 | The plan's count is used. |
| hosting_not_in_plan | 403 | The plan has no hosting at all. |
| hosting_kind_unavailable | 501 | That kind cannot serve yet. |

## It starts empty {#empty}

`status: "empty"` and nothing online. [deploy()](/sdk/ref/host/deploy) is what puts something there.

- [deploy()](/sdk/ref/host/deploy): Putting files online.
- [kinds()](/sdk/ref/hosts/kinds): Before choosing a kind.
- [usage()](/sdk/ref/hosts/usage): Before creating.

```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"
```
