# Log in

`POST https://api.parklio.com/v2/auth/login`

Logs an account user in with email and password, and returns a **user token**.

Use it **once**, by hand, as the account's Super Admin, to [create an API token](/api/endpoints/api-token-create). Don't log in at runtime with a person's credentials: logging in deletes that user's other tokens of the same type, which signs them out of the Connect app.

An unconfirmed email returns `403` with code `9`. See [Authentication](/api/authentication).

**Auth:** none (public)

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | string | yes |  |
| `password` | string | yes |  |

```json
{
  "email": "john.doe@mail.com",
  "password": "somesecretpassword"
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "id": 501,
    "type": "bearer",
    "token": "<user-token>",
    "name": "Site Admin",
    "email": "admin@example.com",
    "account_id": 3,
    "account_role_id": 2,
    "account_user_role_id": 1,
    "account_user_id": 17
  }
}
```

### 403 — User has entered a wrong password. Due to security reason we should not specify this and instead say that the email/password combination is wrong.

```json
{
  "success": false,
  "errors": [
    {
      "code": 8,
      "message": "Wrong email/password combination."
    }
  ]
}
```

