# Authenticate and obtain API token (POST)

Authenticates a user and returns a Bearer token for use with all other API endpoints.
This is an alternative to the GET method that accepts credentials in the request body
instead of query parameters and headers, which is more secure and suitable for
programmatic access.
**This endpoint must be called first before using any other API endpoints.**
**Token Lifecycle:**
- Tokens are valid for the duration specified in the response (typically 24 hours)
- The `expires_at` field indicates when the token will expire (Unix timestamp)
- You should re-authenticate before the token expires to maintain access

**Example Request:**

```bash
curl -X POST "https://api.genoox.com/v1/auth/login" \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "your_password"}'
```
**Rate Limiting:**
This endpoint is rate-limited. Too many failed authentication attempts may result
in temporary blocking of the account.

Endpoint: POST /v1/auth/login
Version: 96
Security: bearerAuth

## Request fields (application/json):

  - `email` (string, required)
    The email address associated with your Franklin account
    Example: user@example.com

  - `password` (string, required)
    Your Franklin account password
    Example: your_password

## Response 200:

  - `200` (unknown)
    Authentication successful

## Response 200 fields (application/json):

  - `token` (string, required)
    The Bearer token to use for authenticating subsequent API requests.
Include this in the Authorization header as: `Bearer <token>`
    Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

  - `duration` (integer, required)
    Token validity duration in seconds (typically 86400 = 24 hours)
    Example: 86400

  - `expires_at` (integer, required)
    Unix timestamp (seconds since epoch) when the token will expire
    Example: 1704153600

## Response 401:

  - `401` (unknown)
    Authentication failed. Possible causes:
- Invalid email or password
- Account not authorized for API access
- Account is blocked

## Response 401 fields (application/json):

  - `error` (string, required)
    Error type
    Example: Not Found

  - `message` (string, required)
    Human-readable error description
    Example: Analysis with ID 12345 was not found

## Response 429:

  - `429` (unknown)
    Rate limit exceeded

## Response 429 fields (application/json):

  - `error` (string, required)
    Error type
    Example: Not Found

  - `message` (string, required)
    Human-readable error description
    Example: Analysis with ID 12345 was not found

## Response 429 headers (application/json):

  - `Retry-After` (integer)
    Number of seconds to wait before retrying

## Response 401 examples:

  - `Invalid credentials` (unknown)

  - `Not authorized for API` (unknown)

