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

# Build an AI-Powered Sales Deal Room

> Create a shared deal room with prospect research, AI-generated briefs, and competitive positioning. 10 minutes.

## What you'll build

A structured deal room for an enterprise account, shareable with the buying committee.

* Board per prospect with all deal intelligence in one place
* AI-generated account brief from extracted prospect research
* Competitive positioning notes for the whole team
* Shareable link for the buying committee

## Prerequisites

* ChatGrid API key ([get one here](/authentication))
* Node.js 18+ or Python 3.10+

## Step 1: Create a deal room board

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.chatgrid.ai/v1/boards \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"name": "Acme Corp - Enterprise Deal"}'
  ```

  ```typescript Node.js theme={null}
  const board = await fetch("https://api.chatgrid.ai/v1/boards", {
    method: "POST",
    headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" },
    body: JSON.stringify({ name: "Acme Corp - Enterprise Deal" }),
  }).then((r) => r.json());
  const boardId = board.data.id;
  ```

  ```python Python theme={null}
  import requests
  board = requests.post("https://api.chatgrid.ai/v1/boards",
      headers={"Authorization": f"Bearer {API_KEY}"},
      json={"name": "Acme Corp - Enterprise Deal"}).json()
  board_id = board["data"]["id"]
  ```
</CodeGroup>

Save `data.id` from the response as your `boardId`.

## Step 2: Add prospect research nodes

Add the prospect's website and LinkedIn page as source nodes.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.chatgrid.ai/v1/boards/{boardId}/nodes \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"type": "url", "position": {"x": 0, "y": 0}, "data": {"url": "https://acme-corp.com/about"}}'

  curl -X POST https://api.chatgrid.ai/v1/boards/{boardId}/nodes \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"type": "url", "position": {"x": 420, "y": 0}, "data": {"url": "https://linkedin.com/company/acme-corp"}}'
  ```

  ```typescript Node.js theme={null}
  for (const [index, url] of ["https://acme-corp.com/about", "https://linkedin.com/company/acme-corp"].entries()) {
    await fetch(`https://api.chatgrid.ai/v1/boards/${boardId}/nodes`, {
      method: "POST",
      headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" },
      body: JSON.stringify({ type: "url", position: { x: index * 420, y: 0 }, data: { url } }),
    });
  }
  ```

  ```python Python theme={null}
  for index, url in enumerate(["https://acme-corp.com/about", "https://linkedin.com/company/acme-corp"]):
      requests.post(f"https://api.chatgrid.ai/v1/boards/{board_id}/nodes",
          headers={"Authorization": f"Bearer {API_KEY}"},
          json={"type": "url", "position": {"x": index * 420, "y": 0}, "data": {"url": url}})
  ```
</CodeGroup>

## Step 3: Vectorize and generate an account brief

Vectorize extracted prospect notes, create a chat, then ask AI for a structured account brief.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.chatgrid.ai/v1/boards/{boardId}/documents/vectorize \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "content": "Acme Corp prospect notes: enterprise manufacturer expanding analytics, wants faster onboarding, and uses Salesforce and Slack heavily.",
      "metadata": {"source": "acme-corp.com/about", "type": "prospect-research"}
    }'

  curl -X POST https://api.chatgrid.ai/v1/boards/{boardId}/chats \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"title": "Deal Strategy"}'

  curl -X POST https://api.chatgrid.ai/v1/boards/{boardId}/chats/{chatId}/messages \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "content": "Based on the prospect materials on this board, write a 1-page account brief: company overview, business priorities, pain points we can solve, and talking points for our first call.",
      "stream": false
    }'
  ```

  ```typescript Node.js theme={null}
  await fetch(`https://api.chatgrid.ai/v1/boards/${boardId}/documents/vectorize`, {
    method: "POST",
    headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" },
    body: JSON.stringify({
      content: "Acme Corp prospect notes: enterprise manufacturer expanding analytics, wants faster onboarding, and uses Salesforce and Slack heavily.",
      metadata: { source: "acme-corp.com/about", type: "prospect-research" },
    }),
  });

  const chat = await fetch(`https://api.chatgrid.ai/v1/boards/${boardId}/chats`, {
    method: "POST",
    headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" },
    body: JSON.stringify({ title: "Deal Strategy" }),
  }).then((r) => r.json());

  const brief = await fetch(
    `https://api.chatgrid.ai/v1/boards/${boardId}/chats/${chat.data.id}/messages`,
    {
      method: "POST",
      headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" },
      body: JSON.stringify({
        content: "Based on the prospect materials on this board, write a 1-page account brief: company overview, business priorities, pain points we can solve, and talking points for our first call.",
        stream: false,
      }),
    }
  ).then((r) => r.json());
  ```

  ```python Python theme={null}
  requests.post(f"https://api.chatgrid.ai/v1/boards/{board_id}/documents/vectorize",
      headers={"Authorization": f"Bearer {API_KEY}"},
      json={
          "content": "Acme Corp prospect notes: enterprise manufacturer expanding analytics, wants faster onboarding, and uses Salesforce and Slack heavily.",
          "metadata": {"source": "acme-corp.com/about", "type": "prospect-research"},
      })

  chat = requests.post(f"https://api.chatgrid.ai/v1/boards/{board_id}/chats",
      headers={"Authorization": f"Bearer {API_KEY}"},
      json={"title": "Deal Strategy"}).json()

  brief = requests.post(
      f"https://api.chatgrid.ai/v1/boards/{board_id}/chats/{chat['data']['id']}/messages",
      headers={"Authorization": f"Bearer {API_KEY}"},
      json={"content": "Based on the prospect materials on this board, write a 1-page account brief: company overview, business priorities, pain points we can solve, and talking points for our first call.", "stream": False},
  ).json()
  ```
</CodeGroup>

## Step 4: Add proposal and competitive positioning

Add a proposal template as a notepad and competitive intel as batch sticky notes.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.chatgrid.ai/v1/boards/{boardId}/nodes \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"type": "document", "position": {"x": 0, "y": 420}, "data": {"content": "# Proposal: Acme Corp\n\n## Executive Summary\n[Brief goes here]\n\n## Solution\n- ...\n\n## Pricing\n- Tier 1 / Tier 2\n\n## Timeline\nWeek 1-2: Discovery | Week 3-4: POC | Week 5+: Rollout"}}'

  curl -X POST https://api.chatgrid.ai/v1/boards/{boardId}/nodes/batch \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "operations": [
        {"action": "create", "data": {"type": "note", "position": {"x": 0, "y": 780}, "data": {"text": "vs. Competitor A: Native integrations, no middleware. 40% faster onboarding."}}},
        {"action": "create", "data": {"type": "note", "position": {"x": 420, "y": 780}, "data": {"text": "vs. Competitor B: 30% lower per-seat pricing at 500+ users."}}},
        {"action": "create", "data": {"type": "note", "position": {"x": 840, "y": 780}, "data": {"text": "Key differentiator: Real-time collaboration. Theirs is single-player."}}}
      ]
    }'
  ```

  ```typescript Node.js theme={null}
  await fetch(`https://api.chatgrid.ai/v1/boards/${boardId}/nodes`, {
    method: "POST",
    headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" },
    body: JSON.stringify({
      type: "document",
      position: { x: 0, y: 420 },
      data: { content: "# Proposal: Acme Corp\n\n## Executive Summary\n[Brief goes here]\n\n## Solution\n- ...\n\n## Pricing\n- Tier 1 / Tier 2\n\n## Timeline\nWeek 1-2: Discovery | Week 3-4: POC | Week 5+: Rollout" },
    }),
  });

  const stickyNotes = [
    { type: "note", position: { x: 0, y: 780 }, data: { text: "vs. Competitor A: Native integrations, no middleware. 40% faster onboarding." } },
    { type: "note", position: { x: 420, y: 780 }, data: { text: "vs. Competitor B: 30% lower per-seat pricing at 500+ users." } },
    { type: "note", position: { x: 840, y: 780 }, data: { text: "Key differentiator: Real-time collaboration. Theirs is single-player." } },
  ];
  await fetch(`https://api.chatgrid.ai/v1/boards/${boardId}/nodes/batch`, {
    method: "POST",
    headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" },
    body: JSON.stringify({
      operations: stickyNotes.map((note) => ({ action: "create", data: note })),
    }),
  });
  ```

  ```python Python theme={null}
  requests.post(f"https://api.chatgrid.ai/v1/boards/{board_id}/nodes",
      headers={"Authorization": f"Bearer {API_KEY}"},
      json={"type": "document", "position": {"x": 0, "y": 420}, "data": {"content": "# Proposal: Acme Corp\n\n## Executive Summary\n[Brief goes here]\n\n## Solution\n- ...\n\n## Pricing\n- Tier 1 / Tier 2\n\n## Timeline\nWeek 1-2: Discovery | Week 3-4: POC | Week 5+: Rollout"}})

  sticky_notes = [
      {"type": "note", "position": {"x": 0, "y": 780}, "data": {"text": "vs. Competitor A: Native integrations, no middleware. 40% faster onboarding."}},
      {"type": "note", "position": {"x": 420, "y": 780}, "data": {"text": "vs. Competitor B: 30% lower per-seat pricing at 500+ users."}},
      {"type": "note", "position": {"x": 840, "y": 780}, "data": {"text": "Key differentiator: Real-time collaboration. Theirs is single-player."}},
  ]
  requests.post(f"https://api.chatgrid.ai/v1/boards/{board_id}/nodes/batch",
      headers={"Authorization": f"Bearer {API_KEY}"},
      json={"operations": [{"action": "create", "data": note} for note in sticky_notes]})
  ```
</CodeGroup>

## What's happening under the hood

Website nodes keep source URLs visible on the board. Vectorization chunks the text you provide and generates embeddings using pgvector. When you ask AI for an account brief, it runs a semantic search against those embeddings, then generates a response grounded in the actual prospect data -- not generic knowledge. The batch endpoint applies multiple node operations in a single request for speed.

## Next steps

<CardGroup cols={2}>
  <Card title="Research Pipeline" icon="magnifying-glass" href="/cookbooks/research-pipeline">
    Automate multi-source research and synthesis
  </Card>

  <Card title="Streaming Responses" icon="bolt" href="/cookbooks/streaming-responses">
    Stream AI responses for real-time deal room chat
  </Card>
</CardGroup>
