Authentication
Auth Endpoints
| Method | Path | Auth | Description |
|---|---|---|---|
GET | /api/v1/auth/setup-status | No | Check if initial setup is done |
POST | /api/v1/auth/register | No | Register first user (initial setup only) |
POST | /api/v1/auth/login | No | Login with email and password |
POST | /api/v1/auth/logout | No | Logout |
POST | /api/v1/auth/send-code | No | Send passwordless login code |
POST | /api/v1/auth/verify-code | No | Verify login code, returns JWT |
GET | /api/v1/auth/me | Yes | Get current user |
PUT | /api/v1/auth/me | Yes | Update profile |
PUT | /api/v1/auth/me/password | Yes | Change password |
POST | /api/v1/auth/me/set-initial-password | Yes | Set password for passwordless accounts |
POST /api/v1/auth/register
Register the first user account. Only available when no users exist (initial setup).
{
"email": "[email protected]",
"password": "securepassword",
"first_name": "Jane",
"last_name": "Doe"
}POST /api/v1/auth/login
Authenticate with email and password. Returns a JWT token.
{
"email": "[email protected]",
"password": "securepassword"
}Response:
{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "[email protected]",
"first_name": "Jane",
"last_name": "Doe",
"role": "superadmin"
}
}
}POST /api/v1/auth/send-code
Send a one-time login code for passwordless authentication.
{
"email": "[email protected]",
"method": "email"
}POST /api/v1/auth/verify-code
Verify a one-time code. Returns a JWT token on success.
{
"email": "[email protected]",
"code": "123456"
}PUT /api/v1/auth/me
Update the current user’s profile.
{
"first_name": "Jane",
"last_name": "Smith"
}PUT /api/v1/auth/me/password
Change the current user’s password.
{
"current_password": "oldpassword",
"new_password": "newpassword"
}User Object
{
"id": "uuid",
"email": "string",
"first_name": "string",
"last_name": "string",
"role": "superadmin | admin | user",
"must_reset_password": false,
"two_factor_enabled": false,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}Service Keys
API keys for programmatic access. Recommended for CI/CD pipelines, Terraform providers, and AI agents.
| Method | Path | Description |
|---|---|---|
GET | /api/v1/settings/service-keys | List service keys |
POST | /api/v1/settings/service-keys | Create a service key |
DELETE | /api/v1/settings/service-keys/:id | Delete a service key |
POST /api/v1/settings/service-keys
{
"name": "ci-cd-pipeline",
"expires_at": "2025-12-31T00:00:00Z"
}The expires_at field is optional. If omitted, the key never expires.
The full key value is returned only once in the creation response. Store it securely.
Usage:
curl https://plane.lnchr.cloud/<tenant>/api/v1/applications \
-H "x-lnchr-key: lnchr_sk_abc123..."Last updated on