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

# API Reference

> Complete reference for the AI CSR API

## Base URL

All API requests should be made to:

```
https://YOUR_DEPLOYMENT.lupitor.com/api/v1
```

## Request Format

* **Content-Type**: `application/json`
* **Authentication**: Include `x-api-key` header
* **Date Format**: ISO 8601 timestamps

## Response Format

All API responses follow a consistent structure:

```json theme={null}
{
  "success": boolean,
  "data": object | null,
  "error": string | null
}
```

### Success Response

```json theme={null}
{
  "success": true,
  "data": {
    "leadId": "jh7abc123xyz"
  },
  "error": null
}
```

### Error Response

```json theme={null}
{
  "success": false,
  "data": null,
  "error": "campaignId is required"
}
```

## HTTP Status Codes

| Status Code | Meaning                                      |
| ----------- | -------------------------------------------- |
| `200`       | OK - Request successful                      |
| `201`       | Created - Resource created successfully      |
| `400`       | Bad Request - Invalid parameters             |
| `401`       | Unauthorized - Missing or invalid API key    |
| `403`       | Forbidden - Insufficient permissions         |
| `404`       | Not Found - Resource doesn't exist           |
| `429`       | Too Many Requests - Rate limit exceeded      |
| `500`       | Internal Server Error - Something went wrong |

## Rate Limits

<Info>
  Rate limits are applied per API key. Contact us if you need higher limits.
</Info>

* **Default**: 100 requests per minute
* **Bulk Operations**: 10 requests per minute

Rate limit information is included in response headers:

```
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640000000
```

## Available Endpoints

<CardGroup cols={2}>
  <Card title="Create Lead" icon="plus" href="/api-reference/leads/create">
    POST /leads
  </Card>

  <Card title="List Leads" icon="list" href="/api-reference/leads/list">
    GET /leads
  </Card>

  <Card title="Bulk Create Leads" icon="upload" href="/api-reference/leads/bulk-create">
    POST /leads/bulk
  </Card>
</CardGroup>

## Endpoint Aliases

<Note>
  **`/records` is an alias for `/leads`**

  All `/api/v1/leads` endpoints are also available at `/api/v1/records`. Use whichever naming convention fits your integration:

  | Primary Endpoint          | Alias Endpoint              |
  | ------------------------- | --------------------------- |
  | `POST /api/v1/leads`      | `POST /api/v1/records`      |
  | `GET /api/v1/leads`       | `GET /api/v1/records`       |
  | `POST /api/v1/leads/bulk` | `POST /api/v1/records/bulk` |

  Both endpoints are functionally identical and share the same documentation.
</Note>

## Need More Endpoints?

We're continuously expanding our API. If you need additional endpoints or features:

* Email us at [support@lupitor.com](mailto:support@lupitor.com)
* Check our [changelog](/changelog) for updates
