NodeJS API Kickstarter API Reference

An opinionated NodeJS API Boilerplate focused on extensability and developer productivity.

Authentication

Bearer

Formatted as 'Bearer {Token}'

type
apiKey
in
header
name
Authorization

Auth

POST /auth/email

Authenticate with email/password

Todo object

Request Example
{
  "email": "string (email)",
  "password": "string"
}
200 OK

A JWT used to authenticate all other API calls as this user. Should be passed in the Authorization Header in the format Bearer {token}

type
object
Response Content-Types: application/json
Response Example (200 OK)
{
  "token": "string (JWT)"
}

Todo

GET /todo

Returns TODO of authenticated user

200 OK

todos

type
Response Content-Types: application/json
Response Example (200 OK)
[
  {
    "name": "string",
    "comment": "string",
    "id": "string",
    "creatorId": "string"
  }
]

POST /todo

Create a TODO

Todo object

Request Example
{
  "name": "string",
  "comment": "string"
}
201 Created

todos

Response Content-Types: application/json
Response Example (201 Created)
{
  "name": "string",
  "comment": "string",
  "id": "string",
  "creatorId": "string"
}

GET /todo/{todoId}

Get a single TODO

todoId
in path
object

Todo ID

200 OK

todo

Response Content-Types: application/json
Response Example (200 OK)
{
  "name": "string",
  "comment": "string",
  "id": "string",
  "creatorId": "string"
}

User

POST /user

Create a new user with its email

Email / Password combo used to authenticate the user

Request Example
{
  "email": "string (email)",
  "password": "string"
}
200 OK

A JWT used to authenticate all other API calls as this user is also returned. Should be passed in the Authorization Header in the format Bearer {token}

type
object
409 Conflict

The email is already used.

Response Content-Types: application/json
Response Example (200 OK)
{
  "user": {
    "id": "string",
    "email": "string (email)",
    "active": "boolean"
  },
  "auth": {
    "token": "string (JWT)"
  }
}

Schema Definitions

emailAuthInput: object

email: string (email)
password: string
Example
{
  "email": "string (email)",
  "password": "string"
}

todoInput: object

name: string (at least 1 chars)
comment: string
Example
{
  "name": "string",
  "comment": "string"
}

todo: object

name: string (at least 1 chars)
comment: string
id: string
creatorId: string
Example
{
  "name": "string",
  "comment": "string",
  "id": "string",
  "creatorId": "string"
}

user: object

id: string
email: string (email)
active: boolean
Example
{
  "id": "string",
  "email": "string (email)",
  "active": "boolean"
}