> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spn.wtf/llms.txt
> Use this file to discover all available pages before exploring further.

# Mahalaxmi - API Routes

> All 160+ API endpoints across auth, bots, campaigns, contacts, and more

All routes are defined in `server/routes.ts` (\~5300 lines, 160+ endpoints). All protected routes require `Authorization: Bearer <token>` or a valid session cookie.

## Auth

```
POST   /api/auth/signup
POST   /api/auth/login
POST   /api/auth/logout
POST   /api/auth/refresh
GET    /api/auth/check
POST   /api/auth/forgot-password
GET    /api/auth/google/url
GET    /api/auth/google/callback
GET    /api/auth/twitter/url
GET    /api/auth/twitter/callback
```

## Users

```
GET    /api/users/me
PATCH  /api/users/me
POST   /api/users/api-token
DELETE /api/users/api-token
GET    /api/users/coins
GET    /api/users/webhook-url
```

## Bots

```
GET    /api/bots
POST   /api/bots
GET    /api/bots/:id
PATCH  /api/bots/:id
DELETE /api/bots/:id
GET    /api/bots/:id/files
POST   /api/bots/:id/files
DELETE /api/bots/:id/files/:fileId
GET    /api/bots/:id/urls
POST   /api/bots/:id/urls
DELETE /api/bots/:id/urls/:urlId
GET    /api/bots/:id/tools
POST   /api/bots/:id/tools
DELETE /api/bots/:botId/tools/:toolId
GET    /api/bots/:id/webhooks
POST   /api/bots/:id/webhooks
PATCH  /api/bots/:id/webhooks/:webhookId
```

## Channels

```
GET    /api/channels
POST   /api/channels
GET    /api/channels/:id
PATCH  /api/channels/:id
DELETE /api/channels/:id
```

## WhatsApp

```
POST   /api/whatsapp/send
POST   /api/whatsapp/send-image
GET    /api/whatsapp/health
GET    /api/whatsapp/templates
```

## Campaigns

```
GET    /api/campaigns
POST   /api/campaigns
GET    /api/campaigns/:id
POST   /api/campaigns/send
```

## Contacts

```
GET    /api/contacts
POST   /api/contacts
GET    /api/contacts/:id
PATCH  /api/contacts/:id
DELETE /api/contacts/:id
GET    /api/contact-lists
POST   /api/contact-lists
```

## Integrations & Tools

```
GET    /api/integrations
POST   /api/integrations
GET    /api/integrations/:id
PATCH  /api/integrations/:id
DELETE /api/integrations/:id
GET    /api/tools
POST   /api/tools
GET    /api/tools/:id
PATCH  /api/tools/:id
DELETE /api/tools/:id
```

## Payments

```
POST   /api/coins/purchase
GET    /api/coins/transactions
POST   /api/stripe-webhook
```

## Analytics / Dashboard

```
GET    /api/dashboard/stats
GET    /api/analytics/users
GET    /api/analytics/usage
GET    /api/activities
```

## Admin

```
GET    /api/admin/users
GET    /api/admin/analytics
...    (various admin-only routes)
```

## Incoming Webhooks

| Endpoint                                    | Service                          |
| ------------------------------------------- | -------------------------------- |
| `POST /api/webhooks/gupshup/incoming_msg`   | Gupshup — messages               |
| `POST /api/webhooks/gupshup/message-events` | Gupshup — delivery/read receipts |
| `GET/POST /api/webhook/facebook`            | Facebook/Meta                    |
| `POST /api/webhook/wasimple`                | Wasimple                         |
| `POST /api/stripe-webhook`                  | Stripe                           |

## Outgoing Webhooks (user-defined)

Users can configure per-bot webhooks that fire during conversations:

* Managed via `GET/POST /api/bots/:id/webhooks`
* Webhook endpoint: `POST /api/v1/webhook` with API token auth
* Dynamic parameters can be passed in webhook payloads
