# Nova AI - Custom Endpoints

Specialized endpoints for accessing conversation history and other Nova-specific data under the `nova-api/v1` prefix.

## Base URL

`https://novaaiapi.nabzclan.vip/nova-api/v1`

## Authentication

Include your API key in the `Authorization` header:

```bash
Authorization: Bearer YOUR_API_KEY
```

---

## List Conversations

Returns a paginated list of conversations for the authenticated user.

### Endpoint

**GET** `/conversations`

### Parameters

- **mode** (string, optional): The type of conversations to retrieve. Defaults to `all`.
  - `all` — Returns all conversation types
  - `chat` — Web UI chat conversations
  - `agents` — Web UI agent conversations
  - `personal` — Personal AI conversations
  - `api` — API-created chat conversations
  - `api_agents` — API-created agent conversations
- **page** (integer, optional): The page number to retrieve. Defaults to 1.

### Example Request

```bash
curl -X GET https://novaaiapi.nabzclan.vip/nova-api/v1/conversations?mode=api&page=1 \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Response

```json
{
  "object": "list",
  "data": [
    {
      "id": "conv_123abc...",
      "title": "Conversation Title",
      "mode": "api",
      "created_at": "2023-01-01T12:00:00.000000Z",
      "updated_at": "2023-01-01T12:30:00.000000Z",
      "messages": [
        {
          "id": 101,
          "role": "user",
          "content": "Latest message content...",
          "created_at": "2023-01-01T12:30:00.000000Z"
        }
      ]
    }
  ],
  "has_more": true,
  "total": 45,
  "mode_filter": "api"
}
```

---

## Get Conversation

Retrieves a specific conversation object, including all its messages.

### Endpoint

**GET** `/conversations/{conversation_id}`

### Parameters

- **conversation_id** (string, required): The ID of the conversation to retrieve.

### Example Request

```bash
curl -X GET https://novaaiapi.nabzclan.vip/nova-api/v1/conversations/conv_123abc \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Response

```json
{
  "id": "conv_123abc...",
  "mode": "chat",
  "title": "Conversation Title",
  "created_at": "2023-01-01T12:00:00.000000Z",
  "updated_at": "2023-01-01T12:30:00.000000Z",
  "messages": [
    {
      "id": 1,
      "role": "system",
      "content": "You are a helpful assistant.",
      "created_at": "2023-01-01T12:00:00.000000Z"
    },
    {
      "id": 2,
      "role": "user",
      "content": "Hello world",
      "created_at": "2023-01-01T12:00:05.000000Z"
    },
    {
      "id": 3,
      "role": "assistant",
      "content": "Hello! How can I help you today?",
      "model": "nova-1.0",
      "created_at": "2023-01-01T12:00:10.000000Z"
    }
  ]
}
```

For full documentation, visit: https://nova-ai.nabzclan.vip/user/developer/docs/nova-custom-endpoints