User endpoints

POST /api/user/login
Synopsis:

Endpoint for login and get a token

Request JSON Object:
  • email (string) – Email of the user

  • password (string) – Password of the user

Response JSON Object:
  • token (string) – The access token

Status Codes:

Example request

POST /api/user/login HTTP/1.1

{
 "email":"admin@mail.com",
 "password":"1234"
}

Example request

HTTP/1.1 200 OK

{"token":"abcabcabcabc"}
POST /api/user/logout
Synopsis:

By calling this endpoint the currently used token is not valid anymore

Status Codes:
  • 200 OK – Logout successful

POST /api/user/register
Synopsis:

Register a new user on the instance. This endpoint will work depending on your register policy.

Request JSON Object:
  • email (string) – (required) New user’s email

  • password (string) – (required) New user’s password

Status Codes:
GET /api/user/info
Synopsis:

Get user data

Status Codes:
  • 200 OK – Successful data retreival

Response JSON Object:
  • email (string) – User email

  • apiTokens (apiToken[]) – List of user API tokens

  • apiToken.Name (string) – Name of the API token

  • apiToken.ExpiresOn (string) – Expiration date

  • apiToken.ReadOnly (string) – Read only token

POST /api/user/tokens
Synopsis:

Create a API token

Status Codes:
Request JSON Object:
  • name (string) – Name of the token

  • expirationTime (string) – expiration date of the token in format like “2006-01-02T15:04:05Z07:00”

  • readOnly (boolean) – set token as read only

DELETE /api/user/tokens
Synopsis:

Delete a API token

Status Codes:
Request JSON Object:
  • name (string) – Name of the token to delete