> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mesadepagos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Auth

> Authentication and JWT generation.

The Auth module authenticates partner users and returns the JWT required to access protected endpoints.

## Login

```http theme={null}
POST /v2/auth/login
```

### Request

```json theme={null}
{
  "email": "partner@example.com",
  "password": "secret123"
}
```

### Response

```json theme={null}
{
  "success": true,
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Partner User",
    "email": "partner@example.com",
    "role": "tenant",
    "status": "ACTIVE",
    "completedOnboardingSteps": ["business_info", "bank_details"]
  },
  "message": "Login successful"
}
```

## Using the Token

Include the token in every protected request:

```http theme={null}
Authorization: Bearer {accessToken}
```

## Common Errors

| Code  | Cause                                                            |
| ----- | ---------------------------------------------------------------- |
| `400` | The email or password has an invalid format.                     |
| `401` | Invalid credentials, or an expired token on protected endpoints. |
