Login / Create a Session

Initiate a new session for using protected REST APIs.

Request

Value

Method

POST

URL

/login

Request body:

JSON path

Type

Required

Value

user

string

true

user name

password

string

true

user password

Example:

{
"password": "admin",
"user": "admin"
}

Successful response

HTTP status code: 200

Response contains the session_id

{
"session_id": "a5dd6114dbd14a3b8f4577b7b54e6b0a"
}

Error response

Invalid user information

HTTP status code: 403

{
"err": "Failed to login"
}

Unexpected event on server

HTTP status code: 500

{
"err": "<error message>"
}

Note: Check Metadefender Core server logs for more information.