# Create a tenant

> Create a tenant that the account of the key owns.

`POST /v1/tenants`

```bash curl
curl -X POST "https://api.shako.dev/v1/tenants" \
  -H "Authorization: Bearer $SHAKO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"acme"}'
```

```python Python
import os

import requests

response = requests.post(
    "https://api.shako.dev/v1/tenants",
    headers={"Authorization": f"Bearer {os.environ['SHAKO_API_KEY']}"},
    json={
        "name": "acme",
    },
)
response.raise_for_status()
print(response.json())
```

```javascript JavaScript
const response = await fetch("https://api.shako.dev/v1/tenants", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.SHAKO_API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "acme"
  }),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
```

```json 201 (excerpt)
{
  "name": "acme"
}
```

Authenticate with `Authorization: Bearer <API key>` on `https://api.shako.dev`. Role: owner, with a key for the account (--account).

## Request body

**name** `string` *required*

The new tenant's name: a-z, 0-9 and single hyphens, at most 20 characters. It is in the SSH names and the URLs of its VMs.

## Response

201 with [the new tenant object](https://shako.dev/api/objects/tenant.md).

## Behavior

Only the first tenant of an account gets the free credit, one time.

The errors: https://shako.dev/api/errors.md. All the endpoints of Tenants: https://shako.dev/api/tenants.md.
