# Login to Account with Username and Password


Endpoint: POST /login
Version: 3.30.0
Security: ApiKeyAuth

## Security:

  - `ApiKeyAuth` (unknown)
    apiKey in header Authorization

## Request body:

  - `application/json` (unknown)
    The parameters to login to an account.

## Request fields (application/json):

  - `username` (string)
    Username of the account that needs to login

  - `password` (string)
    Password of the account that needs to login.

  - `api_key` (string)
    API key (without 'apk ' prefix) of the account that needs to login. When api_key is set then username/password would be ignored if provided.

## Response 200:

  - `200` (unknown)
    Account Login Successful

## Response 200 fields (application/json):

  - `access_token` (string, required)
    Opaque token that validates the successful account login and is used to authenticate subsequent api calls.
This token needs to be sent as part of 'Authorization' header for all api calls prefixed with value contained in 'token_type' property.
For example, if the 'access_token' value is "abc123" and 'token_type' is "Bearer" then HTTP requests should contain following header :
"Authorization: Bearer abc123"

  - `token_type` (string, required)
    Type of the token returned in 'access_token' property.

  - `expires_in` (integer, required)
    Seconds duration after which the token will expire.

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `error` (string)
    Error code for any failure

  - `error_description` (string)
    Error description for any failure

