## Log in `POST https://getkollek.com/api/login` Exchange credentials for an API token. Invalid credentials return 401. When two-factor authentication is enabled on the user, a valid TOTP or recovery code must be passed in code, otherwise the endpoint returns 401. This endpoint is limited to 6 requests per minute. ### Body parameters - `email` (string, required): The email address of the user. - `password` (string, required): The password of the user. - `code` (string, optional): The TOTP or recovery code. Required when two-factor authentication is enabled on the user. - `device_name` (string, optional): A label for the API token that is created, such as the name of your app or device. **Returns:** A confirmation message and the API token to use on subsequent requests. ### Example request ```bash curl https://getkollek.com/api/login \ -X POST \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{ "email": "monica@example.com", "password": "a-very-strong-password", "device_name": "My integration" }' ``` ### Example response `Status: 200` ```json { "message": "Authenticated", "status": 200, "data": { "token": "2|aB3cD4eF5gH6iJ7kL8mN9oP0qR1sT2uV3wX4yZ5a" } } ```