Users

This document describes the endpoints used for managing users on NervesHub through the User API.

post
Register

https://api.nerves-hub.org/users/register
This endpoint allows you to register for a new account.
Request
Response
Body Parameters
password
required
string
The password for the new account
username
required
string
The username of the account
email
required
string
The email address used for the account
200: OK
Account successfully created
{
"username": "user1234",
"email": "user@domain.com"
}

post
Authenticate

https://api.nerves-hub.org/users/auth
Validate authentication of your account with your email and password.
Request
Response
Body Parameters
password
required
string
The password of the account
email
required
string
The email address of the account
200: OK
Correct email and password
{
"username": "user1234",
"email": "user@domain.com"
}

post
Sign certificate

https://api.nerves-hub.org/users/sign
Authenticate using your account email and password and then sign a user certificate signing request to generate a valid user certificate. Almost all endpoints in the User API are protected using client SSL using the certificate returned from this request.
Request
Response
Body Parameters
csr
required
string
A PEM encoded user certificate signing request
email
required
string
The email address of the account
password
required
string
The password of the account
description
required
string
A description to use for the certificate
200: OK
The certificate was signed
{
"cert": "--BEGIN CERTIFICATE--"
}

get
Show user

https://api.nerves-hub.org/users/me
Return information about the user for a provided user certificate. Requires: client side SSL user certificate
Request
Response
‚Äč
200: OK
Found user from valid user certificate
{
"username": "user1234",
"email": "user@domain.com"
}
500: Internal Server Error
{
"errors": "reason"
}