# API

{% hint style="info" %}
For this to work you probably want an `API key`. You can request an API key by sending an email to <laurens@inuva.me> or sending a message in [Discord ](https://discord.gg/A3PBghf5d9)(there will be a user interface for this in the future)
{% endhint %}

### Boot

This wakes the instance up from sleep or boots it when it's in a shut down state.

```bash
curl -H 'Authorization: Bearer <api_key>' -X POST https://inuva.me/api/instance/boot
```

This will return the following

* <mark style="background-color:red;">422: User does not have an instance</mark>
* <mark style="background-color:red;">401: Unauthenticated</mark>
* <mark style="background-color:green;">202: Accepted</mark>

### Reset

This ***tries*** to reset the machine when it's stuck in a bad state. After the reset it will reboot the instance.

```bash
curl -H 'Authorization: Bearer <api_key>' -X POST https://inuva.me/api/instance/reset
```

This will return the following

* <mark style="background-color:red;">422: User does not have an instance</mark>
* <mark style="background-color:red;">401: Unauthenticated</mark>
* <mark style="background-color:green;">202: Accepted</mark>

### Shutdown

This shuts the instance down.

{% hint style="warning" %}
Under normal circumstances you do not have to worry about shutting the machine down. It will hibernate automatically after 30 minutes idle.
{% endhint %}

```bash
curl -H 'Authorization: Bearer <api_key>' -X POST https://inuva.me/api/instance/shutdown
```

This will return the following

* <mark style="background-color:red;">422: User does not have an instance</mark>
* <mark style="background-color:red;">401: Unauthenticated</mark>
* <mark style="background-color:green;">202: Accepted</mark>
