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

# Build a sales pipeline

> Create a deals pipeline with stages, add deals, and view them on a board.

This walkthrough creates a Deals object type, sets up a pipeline with stages, adds deals, and queries the board. Everything here works against a live workspace.

<Steps>
  <Step title="Create the Deals object type">
    Define the object type with the fields you need: deal name, value, and company.

    <CodeGroup>
      ```bash CLI theme={null}
      npx supersonic-cli objects create \
        --name "Deals" \
        --slug "deals" \
        --fields '[
          {"name": "Deal Name", "field_type": "text", "required": true},
          {"name": "Value", "field_type": "number"},
          {"name": "Company", "field_type": "text"}
        ]'
      ```

      ```bash REST theme={null}
      curl -X POST https://mcp.supersonic.cv/api/developers/mcp/call/ \
        -H "Authorization: Bearer supersonic_live_YOUR_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "tool": "objects.create",
          "params": {
            "name": "Deals",
            "slug": "deals",
            "fields": [
              {"name": "Deal Name", "field_type": "text", "required": true},
              {"name": "Value", "field_type": "number"},
              {"name": "Company", "field_type": "text"}
            ]
          }
        }'
      ```
    </CodeGroup>

    The response includes the object type ID and slug. You'll use `"deals"` as the `object_type_slug` in subsequent calls.
  </Step>

  <Step title="Create the pipeline list">
    A pipeline in Supersonic is a list with a stage field. Create it with the stages you want.

    <CodeGroup>
      ```bash CLI theme={null}
      npx supersonic-cli lists create \
        --name "Sales Pipeline" \
        --object-type-slug "deals" \
        --fields '[
          {"name": "Stage", "field_type": "select", "options": ["Lead", "Qualified", "Proposal", "Closed Won", "Closed Lost"]}
        ]'
      ```

      ```bash REST theme={null}
      curl -X POST https://mcp.supersonic.cv/api/developers/mcp/call/ \
        -H "Authorization: Bearer supersonic_live_YOUR_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "tool": "lists.create",
          "params": {
            "name": "Sales Pipeline",
            "object_type_slug": "deals",
            "fields": [
              {
                "name": "Stage",
                "field_type": "select",
                "options": ["Lead", "Qualified", "Proposal", "Closed Won", "Closed Lost"]
              }
            ]
          }
        }'
      ```
    </CodeGroup>

    Save the `list_id` from the response. You'll need it to add entries.
  </Step>

  <Step title="Create some deals">
    Add a few deal records to the Deals object type.

    <CodeGroup>
      ```bash CLI theme={null}
      npx supersonic-cli records create \
        --object-type-slug "deals" \
        --data '{"Deal Name": "Acme Corp renewal", "Value": 48000, "Company": "Acme Corp"}'

      npx supersonic-cli records create \
        --object-type-slug "deals" \
        --data '{"Deal Name": "Globex expansion", "Value": 120000, "Company": "Globex Inc"}'

      npx supersonic-cli records create \
        --object-type-slug "deals" \
        --data '{"Deal Name": "Initech pilot", "Value": 15000, "Company": "Initech"}'
      ```

      ```bash REST theme={null}
      curl -X POST https://mcp.supersonic.cv/api/developers/mcp/call/ \
        -H "Authorization: Bearer supersonic_live_YOUR_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "tool": "records.create",
          "params": {
            "object_type_slug": "deals",
            "data": {
              "Deal Name": "Acme Corp renewal",
              "Value": 48000,
              "Company": "Acme Corp"
            }
          }
        }'
      ```
    </CodeGroup>

    Each call returns the record with its `id`. Note those IDs for the next step.
  </Step>

  <Step title="Add deals to the pipeline">
    Place each deal into the pipeline at a specific stage.

    <CodeGroup>
      ```bash CLI theme={null}
      npx supersonic-cli lists add-entry \
        --list-id "LIST_ID" \
        --record-id "RECORD_ID_1" \
        --data '{"Stage": "Lead"}'

      npx supersonic-cli lists add-entry \
        --list-id "LIST_ID" \
        --record-id "RECORD_ID_2" \
        --data '{"Stage": "Proposal"}'

      npx supersonic-cli lists add-entry \
        --list-id "LIST_ID" \
        --record-id "RECORD_ID_3" \
        --data '{"Stage": "Qualified"}'
      ```

      ```bash REST theme={null}
      curl -X POST https://mcp.supersonic.cv/api/developers/mcp/call/ \
        -H "Authorization: Bearer supersonic_live_YOUR_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "tool": "lists.add_entry",
          "params": {
            "list_id": "LIST_ID",
            "record_id": "RECORD_ID_1",
            "data": {"Stage": "Lead"}
          }
        }'
      ```
    </CodeGroup>

    Replace `LIST_ID` and `RECORD_ID_*` with the actual IDs from previous steps.
  </Step>

  <Step title="View the pipeline">
    Fetch all entries grouped by stage.

    <CodeGroup>
      ```bash CLI theme={null}
      npx supersonic-cli lists entries --list-id "LIST_ID"
      ```

      ```bash REST theme={null}
      curl -X POST https://mcp.supersonic.cv/api/developers/mcp/call/ \
        -H "Authorization: Bearer supersonic_live_YOUR_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "tool": "lists.entries",
          "params": {
            "list_id": "LIST_ID"
          }
        }'
      ```
    </CodeGroup>

    The response returns every entry with its record data and stage value. In the Supersonic UI, this renders as a Kanban board.
  </Step>

  <Step title="Move a deal to a new stage">
    When a deal progresses, update its entry.

    <CodeGroup>
      ```bash CLI theme={null}
      npx supersonic-cli lists update-entry \
        --list-id "LIST_ID" \
        --entry-id "ENTRY_ID" \
        --data '{"Stage": "Closed Won"}'
      ```

      ```bash REST theme={null}
      curl -X POST https://mcp.supersonic.cv/api/developers/mcp/call/ \
        -H "Authorization: Bearer supersonic_live_YOUR_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "tool": "lists.update_entry",
          "params": {
            "list_id": "LIST_ID",
            "entry_id": "ENTRY_ID",
            "data": {"Stage": "Closed Won"}
          }
        }'
      ```
    </CodeGroup>
  </Step>

  <Step title="Get pipeline analytics">
    Pull aggregate numbers: deal count and total value per stage.

    <CodeGroup>
      ```bash CLI theme={null}
      npx supersonic-cli analytics pipeline --list-id "LIST_ID"
      ```

      ```bash REST theme={null}
      curl -X POST https://mcp.supersonic.cv/api/developers/mcp/call/ \
        -H "Authorization: Bearer supersonic_live_YOUR_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "tool": "analytics.pipeline",
          "params": {
            "list_id": "LIST_ID"
          }
        }'
      ```
    </CodeGroup>

    Returns stage-by-stage breakdown with counts and summed values.
  </Step>
</Steps>

<Note>
  Rate limit is 1,000 API calls per minute. For bulk operations, see [Import contacts from CSV](/examples/import-contacts).
</Note>
