Skip to Content

Authentication

Auth Endpoints

MethodPathAuthDescription
GET/api/v1/auth/setup-statusNoCheck if initial setup is done
POST/api/v1/auth/registerNoRegister first user (initial setup only)
POST/api/v1/auth/loginNoLogin with email and password
POST/api/v1/auth/logoutNoLogout
POST/api/v1/auth/send-codeNoSend passwordless login code
POST/api/v1/auth/verify-codeNoVerify login code, returns JWT
GET/api/v1/auth/meYesGet current user
PUT/api/v1/auth/meYesUpdate profile
PUT/api/v1/auth/me/passwordYesChange password
POST/api/v1/auth/me/set-initial-passwordYesSet 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.

MethodPathDescription
GET/api/v1/settings/service-keysList service keys
POST/api/v1/settings/service-keysCreate a service key
DELETE/api/v1/settings/service-keys/:idDelete 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