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

# Lava CRM

> First-party CRM that ships with every Lava account: contacts, accounts (companies), leads, opportunities (deals), tasks, cases, and invoices over a REST API.

First-party CRM that ships with every Lava account: contacts, accounts (companies), leads, opportunities (deals), tasks, cases, and invoices over a REST API. Best for agents that read or update the user's own CRM, syncing contacts, logging activity, advancing deals, or creating follow-up tasks, with zero setup because Lava provisions and connects the credential automatically. Every call is scoped to the caller's org.

15 example endpoints available through Lava's AI Gateway. See the [Lava CRM API docs](https://crm.lava.so) for full documentation.

<Info>This is a managed Lava service — no setup required. Lava provisions and connects it for you automatically.</Info>

<Info>This is a **catch-all provider** — any valid URL under `https://lava-crm-api.fly.dev` is supported. Lava CRM REST API. Base: [https://lava-crm-api.fly.dev](https://lava-crm-api.fly.dev), all paths under /api/ with a trailing slash. Auth: Bearer token (provisioned automatically by Lava; no manual key). Resources: /api/contacts/, /api/accounts/ (companies), /api/leads/, /api/opportunities/ (deals), /api/tasks/, /api/cases/, /api/invoices/. List endpoints support page and search query params; detail endpoints are /api/\{resource}/\{id}/. Deal pipelines with fully custom stages live under /api/deal-pipelines/: list pipelines GET /api/deal-pipelines/, create a pipeline POST /api/deal-pipelines/ \{name}, board (each stage with its deals) GET /api/deal-pipelines/board/?pipeline\_id=\<id>, add a custom stage POST /api/deal-pipelines/\<pipeline\_id>/stages/ \{name}, rename a stage PUT /api/deal-pipelines/stages/\<stage\_id>/ \{name}, delete an (empty, non Won/Lost) stage DELETE /api/deal-pipelines/stages/\<stage\_id>/. To move a deal between stages, use PATCH /api/deal-pipelines/deals/\<deal\_id>/move/ \{stage\_id} with a stage\_id from the board — NOT the fixed 6-value 'stage' enum on /api/opportunities/ (PROSPECTING/QUALIFICATION/PROPOSAL/NEGOTIATION/CLOSED\_WON/CLOSED\_LOST). That enum is legacy and only accepts those six values; custom stages (e.g. Contacted, Meeting) only exist through /api/deal-pipelines/. Moving a deal to a Won/Lost stage closes it automatically. All access is scoped to the caller token owner org. The endpoints below are curated examples.</Info>

## Endpoints

### List contacts. Supports page and search query params.

**GET** `https://lava-crm-api.fly.dev/api/contacts/` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://lava-crm-api.fly.dev/api/contacts/', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Flava-crm-api.fly.dev%2Fapi%2Fcontacts%2F" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Create a contact. Common fields: first\_name, last\_name, primary\_email, mobile\_number.

**POST** `https://lava-crm-api.fly.dev/api/contacts/` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://lava-crm-api.fly.dev/api/contacts/', {
      body: {
    "first_name": "Jane",
    "last_name": "Smith",
    "primary_email": "jane@example.com"
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Flava-crm-api.fly.dev%2Fapi%2Fcontacts%2F" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"first_name":"Jane","last_name":"Smith","primary_email":"jane@example.com"}'
    ```
  </Tab>
</Tabs>

### Update a contact by id (partial update).

**PATCH** `https://lava-crm-api.fly.dev/api/contacts/{id}/` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://lava-crm-api.fly.dev/api/contacts/{id}/', { method: 'PATCH', body: {"title":"VP Sales"} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X PATCH "https://api.lava.so/v1/forward?u=https%3A%2F%2Flava-crm-api.fly.dev%2Fapi%2Fcontacts%2F%7Bid%7D%2F" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"title":"VP Sales"}'
    ```
  </Tab>
</Tabs>

### Delete a contact by id.

**DELETE** `https://lava-crm-api.fly.dev/api/contacts/{id}/` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://lava-crm-api.fly.dev/api/contacts/{id}/', { method: 'DELETE' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X DELETE "https://api.lava.so/v1/forward?u=https%3A%2F%2Flava-crm-api.fly.dev%2Fapi%2Fcontacts%2F%7Bid%7D%2F" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json"
    ```
  </Tab>
</Tabs>

### List accounts (companies the org does business with).

**GET** `https://lava-crm-api.fly.dev/api/accounts/` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://lava-crm-api.fly.dev/api/accounts/', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Flava-crm-api.fly.dev%2Fapi%2Faccounts%2F" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### List leads. Supports page and search query params.

**GET** `https://lava-crm-api.fly.dev/api/leads/` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://lava-crm-api.fly.dev/api/leads/', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Flava-crm-api.fly.dev%2Fapi%2Fleads%2F" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### List opportunities (deals) across the pipeline.

**GET** `https://lava-crm-api.fly.dev/api/opportunities/` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://lava-crm-api.fly.dev/api/opportunities/', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Flava-crm-api.fly.dev%2Fapi%2Fopportunities%2F" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### List tasks.

**GET** `https://lava-crm-api.fly.dev/api/tasks/` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://lava-crm-api.fly.dev/api/tasks/', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Flava-crm-api.fly.dev%2Fapi%2Ftasks%2F" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### List deal pipelines (a default pipeline is auto-provisioned). Each has stages with stage\_type open/won/lost.

**GET** `https://lava-crm-api.fly.dev/api/deal-pipelines/` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://lava-crm-api.fly.dev/api/deal-pipelines/', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Flava-crm-api.fly.dev%2Fapi%2Fdeal-pipelines%2F" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Create a deal pipeline. Seeds default stages plus a mandatory Won and Lost stage.

**POST** `https://lava-crm-api.fly.dev/api/deal-pipelines/` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://lava-crm-api.fly.dev/api/deal-pipelines/', { body: {"name":"Enterprise"} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Flava-crm-api.fly.dev%2Fapi%2Fdeal-pipelines%2F" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"name":"Enterprise"}'
    ```
  </Tab>
</Tabs>

### Pipeline board: every stage (column) with its deals and the stage ids needed to move deals. Pass ?pipeline\_id=\<id> to pick a pipeline; omit for the default.

**GET** `https://lava-crm-api.fly.dev/api/deal-pipelines/board/` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://lava-crm-api.fly.dev/api/deal-pipelines/board/', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Flava-crm-api.fly.dev%2Fapi%2Fdeal-pipelines%2Fboard%2F" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Move a deal to a stage. Use stage\_id from the board, not the opportunity 'stage' enum. Moving to a Won/Lost stage closes the deal. Optional above\_id/below\_id position it within the stage.

**PATCH** `https://lava-crm-api.fly.dev/api/deal-pipelines/deals/{deal_id}/move/` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://lava-crm-api.fly.dev/api/deal-pipelines/deals/{deal_id}/move/', { method: 'PATCH', body: {"stage_id":"{stage_id}"} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X PATCH "https://api.lava.so/v1/forward?u=https%3A%2F%2Flava-crm-api.fly.dev%2Fapi%2Fdeal-pipelines%2Fdeals%2F%7Bdeal_id%7D%2Fmove%2F" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"stage_id":"{stage_id}"}'
    ```
  </Tab>
</Tabs>

### Add a custom open stage to a pipeline (e.g. Contacted, Meeting). This is the only way custom stages exist on the backend.

**POST** `https://lava-crm-api.fly.dev/api/deal-pipelines/{pipeline_id}/stages/` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://lava-crm-api.fly.dev/api/deal-pipelines/{pipeline_id}/stages/', { body: {"name":"Contacted"} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Flava-crm-api.fly.dev%2Fapi%2Fdeal-pipelines%2F%7Bpipeline_id%7D%2Fstages%2F" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"name":"Contacted"}'
    ```
  </Tab>
</Tabs>

### Rename a stage by id.

**PUT** `https://lava-crm-api.fly.dev/api/deal-pipelines/stages/{stage_id}/` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://lava-crm-api.fly.dev/api/deal-pipelines/stages/{stage_id}/', { method: 'PUT', body: {"name":"Discovery"} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X PUT "https://api.lava.so/v1/forward?u=https%3A%2F%2Flava-crm-api.fly.dev%2Fapi%2Fdeal-pipelines%2Fstages%2F%7Bstage_id%7D%2F" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"name":"Discovery"}'
    ```
  </Tab>
</Tabs>

### Delete a stage by id. Only empty open stages can be deleted; Won and Lost are required and protected.

**DELETE** `https://lava-crm-api.fly.dev/api/deal-pipelines/stages/{stage_id}/` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://lava-crm-api.fly.dev/api/deal-pipelines/stages/{stage_id}/', { method: 'DELETE' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X DELETE "https://api.lava.so/v1/forward?u=https%3A%2F%2Flava-crm-api.fly.dev%2Fapi%2Fdeal-pipelines%2Fstages%2F%7Bstage_id%7D%2F" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json"
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="All Providers" icon="grid" href="/gateway/supported-providers">
    Browse all supported AI providers
  </Card>

  <Card title="Forward Proxy" icon="route" href="/gateway/forward-proxy">
    Learn how to construct proxy URLs and authenticate requests
  </Card>
</CardGroup>
