---
search:
  tags:
    - Auth
    - POST
seo:
  description: >-
    Public. Exchanges an email and a password for a bearer token. Repeated
    failures… Reference for the POST /api/v1/auth/login endpoint in the
    PharmaFlow API.
sidebar:
  label: Log in and issue an access token
  badge: POST
title: Log in and issue an access token
type: openapi-operation
---
Public. Exchanges an email and a password for a bearer token. Repeated failures from one address are throttled, and an inactive account is refused once the password checks out.

`POST /api/v1/auth/login`

**Request body** (`application/json`, required)

- `email` (string, required)
- `password` (string, required)

Request body example:

```json
{
  "email": "string",
  "password": "string"
}
```

**Responses**

- `200` — Signed in
- `400` — Invalid request body: an email and a password are required
- `401` — Invalid email or password
- `403` — Account is inactive
- `429` — Too many login attempts, try again later

Response example, 200:

```json
{
  "access_token": "string",
  "token_type": "string",
  "user_id": "string",
  "role": "string",
  "branch_id": "string",
  "branch_name": "string",
  "full_name": "string"
}
```
