REST API Endpoints
Complete reference for Mesachat REST API endpoints.
Tenants
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/bots/tenants | List all tenants |
| GET | /api/bots/tenants/:tenantId | Get tenant with bots |
Bots
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/bots | List all bots |
| GET | /api/bots/:tenantId/:botId | Get specific bot |
| POST | /api/bots/:botId/integrations | Create integration |
| PUT | /api/bots/:botId/integrations/:id | Update integration |
| DELETE | /api/bots/:botId/integrations/:id | Delete integration |
Create Integration
curl -X POST https://api.mesa.chat/api/bots/my-bot/integrations \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"integrationId": "telegram",
"integrationType": "telegram",
"enabled": true,
"credentials": {
"botToken": "...",
"botName": "my_bot"
}
}'
Agents
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/agents | List agent definitions and usage |
| GET | /api/definitions/agents | Get agent definitions |
| GET | /api/definitions/tools | Get tool definitions |
| GET | /api/definitions/capabilities | Get capability definitions |
API Keys
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/keys | List API keys (masked) |
| POST | /api/keys | Create API key |
| PUT | /api/keys/:id | Update API key |
| DELETE | /api/keys/:id | Delete API key |
Create API Key
curl -X POST https://api.mesa.chat/api/keys \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"tenantId": "my-tenant",
"scopeType": "tenant",
"scopeId": "my-tenant",
"keyType": "byok",
"provider": "openai",
"apiKey": "sk-..."
}'
Users
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/users | List users |
| GET | /api/current-user | Get current user profile |
Configuration
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/config | Get configuration |
| PUT | /api/config | Update configuration |
System
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/system/health | Health check |
| GET | /api/system/info | System information |
| GET | /api/database/status | Database status |
| GET | /api/migrations/status | Migration status |