Introduction
General information about Timo API
Base URLs
The Timo API is available in both sandbox and production environments for testing and production use.
Authentication
To authenticate API requests, include your API key in the Authorization header. You receive your API key during onboarding.
To obtain a JWT token, make a POST request to the token endpoint:
Endpoints Overview
The Timo API relies on three main concepts: Hotels, Service Requests, and WhatsApp Messages. This section outlines the workflow for generating a direct debit payment.
Hotels
Hotels represent the properties managed in the system. Each hotel has departments, staff, and service categories.
Service Requests
Service requests are created when guests request services through WhatsApp. Each request is routed to the appropriate department.
WhatsApp Integration
WhatsApp messages are received via webhook and processed by the AI orchestrator to create service requests.
System Status
Real-time system health and status information
Quick Start Guide
Get up and running with Timo API quickly
Local Development (Fastest - SQLite)
Access:
- Frontend:
http://localhost:3069 - Backend API:
http://localhost:8000 - Admin Panel:
http://localhost:8000/admin
Docker Setup (PostgreSQL + Redis)
This starts PostgreSQL, Redis, Django backend, Celery worker, and Celery beat.
First Time Setup
- Create superuser:
python manage.py createsuperuser - Create a Hotel in admin panel
- Create a Department for that hotel
- Create ServiceCategory and ServiceItem
Test API Connection
Environment Variables
Required and optional environment configuration
Required (Development)
Database (Production)
Redis (Optional)
CORS
WhatsApp (Twilio)
OpenAI
Deployment Guide
Deploy Timo API to production
Production URLs
- Public API:
https://api.lavaka.io - Webhook URL:
https://api.lavaka.io/api/whatsapp/webhook - Health Check:
https://api.lavaka.io/api/health
VPS Setup (Quick)
This script sets up PostgreSQL, Redis, nginx, SSL, and systemd services.
Development vs Production Toggle
Dokploy Deployment
- Set build path to
/backend - Use Dockerfile build type
- Configure environment variables (see Environment tab)
- Set domain:
api.lavaka.io - Health check path:
/api/health
Verification
Client Onboarding
Streamlined process for onboarding new hotel clients
Overview
The client onboarding system provides a complete solution for setting up new hotel clients. It automatically creates:
- Hotel record with unique code and locale settings
- Admin user account with secure password
- Default departments (Housekeeping, Maintenance, Room Service, Front Desk, Concierge)
- Welcome email with login credentials
super_admin and dev users.
Web-Based Onboarding Form
The easiest way to onboard clients is through the web interface:
- Log in as
super_adminordevuser - Navigate to Super Admin β Onboard Client (or go to
/onboard-client) - Fill out the form with client information
- Submit - the system handles everything automatically
Form Fields
Hotel Information
- Hotel Name (required) - Full name of the hotel
- Hotel Code (optional) - Auto-generated from hotel name if blank
- Default Locale - Language preference (en, es, fr, de)
Admin User Information
- Admin Email (required) - Email for login and notifications
- Admin Username (optional) - Auto-generated as
{hotel_code}_admin - First Name / Last Name (optional) - Admin user's name
- Password (optional) - Auto-generated secure password if enabled
Options
- Generate Password - Auto-generate secure 16-character password
- Create Default Departments - Pre-create standard departments
- Send Email - Send welcome email with credentials
API Endpoint
You can also onboard clients programmatically via the API:
http://api.lavaka.io/api/hotels/onboard-client/
π Auth Required
Onboard a new client - creates hotel + admin user + sends email
Request Example
Request Body
Success Response (201)
Error Response (400)
Step-by-Step Process
Step 1: Prepare Client Information
Gather the following information from your client:
- Hotel name (e.g., "Grand Plaza Hotel")
- Admin contact email
- Admin name (optional)
- Preferred locale/language
Step 2: Onboard Client
Use either the web form or API to create the client account:
Step 3: Share Credentials
After successful onboarding:
- If email was sent: Client receives welcome email with credentials
- If email failed: Share the password securely from the response
- Provide login URL:
http:/.lavaka.io/signin
Step 4: Client First Login
The client should:
- Log in with provided credentials
- Change password immediately
- Complete the Setup Wizard to configure their hotel
- Create additional staff users as needed
Auto-Generation Rules
Hotel Code
If not provided, hotel code is auto-generated from hotel name:
Admin Username
If not provided, username is auto-generated:
Password
If generate_password=true, a secure 16-character password is generated:
- Contains uppercase, lowercase, numbers, and special characters
- Example:
Xy9#mK2$pL8@nQ4 - Only shown once in response and email
Default Departments
If create_default_departments=true, the following departments are automatically created:
- Housekeeping
- Maintenance
- Room Service
- Front Desk
- Concierge
These can be customized or additional departments can be added later via the Setup Wizard or API.
Email Notifications
When send_email=true, a welcome email is sent to the admin user with:
- Hotel information
- Account credentials (username and temporary password)
- Login URL
- Next steps instructions
Email Configuration
For production, configure email settings in your .env file:
Integration with Setup Wizard
After onboarding, clients can complete their hotel configuration:
- New hotel appears in the Setup Wizard hotel selection
- Super admins see an "Onboard Client" button in the Setup Wizard
- Onboarding form redirects to Setup Wizard after completion
- Clients can configure departments, staff, service categories, and items
Troubleshooting
Email Not Sending
- Check email configuration in
.env - Verify SMTP credentials
- Check Django logs for email errors
- In development, emails print to console
Username Already Exists
- The system validates uniqueness
- Choose a different username or hotel code
- Error message will indicate the conflict
Hotel Code Already Exists
- Hotel codes must be unique
- Provide a custom hotel code
- Error message will indicate the conflict
Best Practices
- Use consistent naming: Follow the
{hotel_code}_adminconvention for usernames - Generate passwords: Always use auto-generated passwords for security
- Send emails: Enable email notifications to provide credentials securely
- Create departments: Use default departments to get clients started quickly
- Document credentials: Keep a secure record of initial credentials
- Follow up: Ensure clients change passwords and complete setup wizard
API Endpoints
Complete API reference documentation
Authentication
http://api.lavaka.io/api/auth/token
Get JWT access and refresh tokens
http://api.lavaka.io/api/auth/refresh
Refresh access token using refresh token
Hotels
http://api.lavaka.io/api/hotels/onboard-client/
π Super Admin
Onboard a new client - creates hotel + admin user + sends email
See Client Onboarding section for detailed documentation.
http://api.lavaka.io/api/hotels/
π Auth Required
List all hotels or create a new hotel
http://api.lavaka.io/api/hotels/{id}/
π Auth Required
Hotel details, update, or delete
http://api.lavaka.io/api/whatsapp/verify
Webhook verification for WhatsApp
http://api.lavaka.io/api/whatsapp/webhook
Receive WhatsApp messages
Service Requests
http://api.lavaka.io/api/requests/
π Auth Required
List or create service requests
Knowledge Base
http://api.lavaka.io/api/knowledge/scrape/
π Auth Required
Scrape hotel website for knowledge base
http://api.lavaka.io/api/knowledge/logs/
π Auth Required
Get scraping logs
System
http://api.lavaka.io/api/health
System health check (JSON)
http://api.lavaka.io/api/sitemap
Complete API endpoint map
http://api.lavaka.io/api/cors-debug
CORS configuration debug