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

# CRM

> Push deals and companies from your own systems into the Messaly CRM, next to the campaigns you send them.

## Pipelines and stages

A pipeline is a set of ordered stages, each with a win probability. Read yours first: you need a pipeline `id` and a stage `id` to create a deal.

```bash theme={null}
curl https://app.telaven.com/api/v1/pipelines \
  -H "Authorization: Bearer $TELAVEN_API_KEY"
```

```json theme={null}
{
  "success": true,
  "data": [
    {
      "id": "p1…",
      "name": "Sales",
      "isDefault": true,
      "stages": [
        { "id": "lead", "name": "Lead", "order": 0, "probability": 10 },
        { "id": "proposal", "name": "Proposal", "order": 1, "probability": 60 }
      ]
    }
  ]
}
```

Create your own with [`POST /pipelines`](https://docs.telaven.com/api-reference/crm/create-pipeline).

## Deals

```bash theme={null}
curl -X POST https://app.telaven.com/api/v1/deals \
  -H "Authorization: Bearer $TELAVEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme bulk SMS",
    "pipelineId": "p1…",
    "stage": "proposal",
    "value": 120000,
    "probability": 60
  }'
```

`currency` defaults to your account currency. You can link a deal to a `companyId` and a main `contactId`.
[`GET /deals`](https://docs.telaven.com/api-reference/crm/list-deals) filters by `pipelineId`, `status` (`open`, `won`, `lost`) and `search`, and returns pipeline totals.

## Companies

```bash theme={null}
curl -X POST https://app.telaven.com/api/v1/companies \
  -H "Authorization: Bearer $TELAVEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Acme Ltd", "industry": "Retail", "city": "Downtown" }'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.