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

# CRM API

> Manage CRM contacts and pipeline

## Overview

The CRM API lets you manage contacts, deals, and pipeline stages programmatically. All endpoints are scoped to your organization.

***

## Contacts

### List Contacts

```bash theme={null}
GET /api/crm/contacts
```

**Query Parameters**

| Parameter | Type   | Description                  |
| --------- | ------ | ---------------------------- |
| `search`  | string | Search by name or email      |
| `tag`     | string | Filter by tag                |
| `page`    | number | Page number (default: 1)     |
| `limit`   | number | Items per page (default: 25) |

**Response**

```json theme={null}
{
  "contacts": [
    {
      "id": "contact_abc123",
      "name": "Jane Smith",
      "email": "jane@example.com",
      "company": "Acme Inc.",
      "tags": ["client", "enterprise"],
      "createdAt": "2025-02-10T08:00:00Z"
    }
  ],
  "total": 150,
  "page": 1,
  "limit": 25
}
```

### Create Contact

```bash theme={null}
POST /api/crm/contacts
```

**Request Body**

```json theme={null}
{
  "name": "Jane Smith",
  "email": "jane@example.com",
  "company": "Acme Inc.",
  "phone": "+1-555-0123",
  "tags": ["lead"],
  "notes": "Met at SaaStr conference"
}
```

### Update Contact

```bash theme={null}
PATCH /api/crm/contacts/{id}
```

### Delete Contact

```bash theme={null}
DELETE /api/crm/contacts/{id}
```

***

## Pipeline

### List Pipeline Stages

```bash theme={null}
GET /api/crm/pipeline/stages
```

### Move Contact to Stage

```bash theme={null}
POST /api/crm/pipeline/move
```

**Request Body**

```json theme={null}
{
  "contactId": "contact_abc123",
  "stageId": "stage_qualified"
}
```

***

## Tasks

### List Tasks

```bash theme={null}
GET /api/crm/tasks
```

### Create Task

```bash theme={null}
POST /api/crm/tasks
```

**Request Body**

```json theme={null}
{
  "title": "Follow up with Jane",
  "contactId": "contact_abc123",
  "dueDate": "2025-04-20T10:00:00Z",
  "assignedTo": "user_xyz"
}
```
