## create invite token

**post** `/users/invite`

```bash
curl -H "Content-Type: application/json" -H "auth-token: 0b06eb2e-4ca4-4881-9a0f-b8df55431cd1" -X POST https://proxy-host.com/users/invite
```

* 200 {"token":"5caf94d2-2c91-4010-8df7-968d10802b9d"}


## sing up

**post** `/auth/invite/<INVITE TOKEN>`

```bash
curl -H "Content-Type: application/json" -X POST -d "{\"username\": \"test9\", \"password\": \"palm7\"}" https://proxy-host.com/auth/invite/b33d8819-ec64-4cf4-a6ec-77562d738fa4

```

* 200 {"user":"test9","token":"af662d8b-3d44-4110-8ad9-047dc752d97f"}
* 400 {"message":"Missing fields"}
* 401 {"message":"Token not valid"}
* 409 {"message":"username taken"}


## login

**post** `/auth/login`

```bash
curl -H "Content-Type: application/json" -X POST -d '{"username": "test8", "password": "mypassword"}' https://proxy-host.com/auth/login
```

* 200 {"login":true,"token":"027d3964-7d81-4462-a6f9-2c1f9b40b4be"}
* 401 {"login":false}


## verify SSH key

**post** `/auth/verifykey`

```bash
curl -H "Content-Type: application/json" -X POST -d "{\"key\":\"ssh-rsa   wmantly@gmail.com\"}" https://proxy-host.com/auth/verifykey
```

* 200 {"info":"4096 SHA256:dfdCYzt0atMBXVZTJzUxsu99IjXXFXpocSox5q+jOs8 wmantly@gmail.com (RSA)\n"}
* 400 {"message":"Key is not a public key file!"}


## add ssh key to current user

**post** `/users/key`

```bash
curl -H "Content-Type: application/json" -H "auth-token: 8eff4f16-086d-40fd-acbd-7634b9a36117" -X POST -d "{\"key\": \"ssh-rsa   wmantly@gmail.co\"}" https://proxy-host.com/users/key
```

* 200 {"message":true}
* 400 {"message":"Bad SSH key"}
