> ## 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.

# API Overview

> REST API reference for the Mahalaxmi Traders platform

## Base URL

```
https://your-domain.com/api
```

## Authentication

All protected endpoints require a Bearer token in the `Authorization` header:

```http theme={null}
Authorization: Bearer YOUR_API_TOKEN
```

You can generate an API token from **Profile Settings → Generate API Token** in the platform.

Alternatively, session-based auth (HTTP-only cookies) is used by the web app automatically.

## Response format

All responses return JSON. Successful responses vary by endpoint — most return the created/updated object or a list. Errors return:

```json theme={null}
{
  "error": "Human-readable error message"
}
```

## HTTP status codes

| Code  | Meaning                                 |
| ----- | --------------------------------------- |
| `200` | Success                                 |
| `201` | Created                                 |
| `400` | Bad request / validation error          |
| `401` | Unauthorized — missing or invalid token |
| `403` | Forbidden — insufficient permissions    |
| `404` | Resource not found                      |
| `500` | Internal server error                   |

## Endpoints

<CardGroup cols={2}>
  <Card title="Auth" icon="key" href="/mahalaxmi/api/auth">
    Sign up, login, logout, token refresh, OAuth
  </Card>

  <Card title="Bots" icon="robot" href="/mahalaxmi/api/bots">
    Create and manage AI bots, attach channels and tools
  </Card>

  <Card title="Channels" icon="plug" href="/mahalaxmi/api/channels">
    Connect WhatsApp, Gmail, Twitter and other messaging platforms
  </Card>

  <Card title="Campaigns" icon="bullhorn" href="/mahalaxmi/api/campaigns">
    Broadcast, drip, and trigger-based messaging campaigns
  </Card>

  <Card title="Contacts" icon="address-book" href="/mahalaxmi/api/contacts">
    Manage customer contacts and contact lists
  </Card>

  <Card title="Webhooks" icon="webhook" href="/mahalaxmi/api/webhooks">
    Configure bot-triggered HTTP request actions
  </Card>
</CardGroup>
