Last updated: 2026-04-11

Authentication

API reference for authentication endpoints.

Dashboard API authentication is handled via AWS Cognito. All dashboard API endpoints (except auth) require a Bearer JWT token.

Base URL

https://api.spendlil.ai/api

Register

POST /auth/register

Create a new account and first user. Returns the SpendLil account key (sl_*).

json Request body
{
  "email": "you@company.com",
  "password": "securepassword",
  "firstName": "Jane",
  "lastName": "Smith",
  "companyName": "Acme Ltd"
}
json Response
{
  "accountId": "sl_abc123def456",
  "userId": "usr_789",
  "token": "eyJhbGci..."
}

Login

POST /auth/login

Authenticate and receive a JWT token.

json Request body
{
  "email": "you@company.com",
  "password": "securepassword"
}

Current User

GET /auth/me

Get the current user and account details. Requires Bearer token.