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

# Get Pipelines

> Retrieve pipelines based on the provided user.

## Overview

This endpoint retrieves all pipelines associated with your account. Pipelines are workflow structures that help organize and track contacts through different stages of your business process (e.g., sales funnel, customer support, onboarding).

## Use Cases

* **Display available pipelines**: Show all pipelines in your application's UI
* **Pipeline selection**: Allow users to select which pipeline to work with
* **Analytics setup**: Get pipeline data for reporting and analytics
* **Integration workflows**: Sync pipeline structures with external CRM or automation tools

## Authentication

This endpoint requires authentication using an API key. Include your API key in the request header:

```
x-api-key: your_api_key_here
```

## Response Structure

The endpoint returns an array of pipeline objects. Each pipeline contains:

| Field         | Type          | Description                                    |
| ------------- | ------------- | ---------------------------------------------- |
| `id`          | string (UUID) | Unique identifier for the pipeline             |
| `name`        | string        | Name of the pipeline                           |
| `description` | string        | Detailed description of the pipeline's purpose |
| `stages`      | array         | List of stages within the pipeline             |

### Stage Object

Each stage in the `stages` array contains:

| Field         | Type          | Description                               |
| ------------- | ------------- | ----------------------------------------- |
| `id`          | string (UUID) | Unique identifier for the stage           |
| `name`        | string        | Name of the stage                         |
| `description` | string        | Description of what this stage represents |

## Example Response

```json theme={null}
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Sales Pipeline",
    "description": "Track potential customers through the sales process",
    "stages": [
      {
        "id": "650e8400-e29b-41d4-a716-446655440001",
        "name": "Lead",
        "description": "Initial contact with potential customer"
      },
      {
        "id": "650e8400-e29b-41d4-a716-446655440002",
        "name": "Qualified",
        "description": "Lead has been qualified and shows interest"
      },
      {
        "id": "650e8400-e29b-41d4-a716-446655440003",
        "name": "Proposal",
        "description": "Proposal sent to customer"
      },
      {
        "id": "650e8400-e29b-41d4-a716-446655440004",
        "name": "Closed Won",
        "description": "Successfully closed the deal"
      }
    ]
  },
  {
    "id": "660e8400-e29b-41d4-a716-446655440010",
    "name": "Customer Support",
    "description": "Manage customer support tickets and inquiries",
    "stages": [
      {
        "id": "760e8400-e29b-41d4-a716-446655440011",
        "name": "Open",
        "description": "New support ticket received"
      },
      {
        "id": "760e8400-e29b-41d4-a716-446655440012",
        "name": "In Progress",
        "description": "Ticket is being actively worked on"
      },
      {
        "id": "760e8400-e29b-41d4-a716-446655440013",
        "name": "Resolved",
        "description": "Issue has been resolved"
      }
    ]
  }
]
```

## Common Use Cases

### 1. Display Pipelines in a Dropdown

```javascript theme={null}
const response = await fetch('https://api.vambe.me/api/public/pipeline', {
  headers: {
    'x-api-key': 'your_api_key_here',
  },
});

const pipelines = await response.json();

// Render in UI
const pipelineOptions = pipelines.map((pipeline) => ({
  value: pipeline.id,
  label: pipeline.name,
}));
```

### 2. Get All Stages from All Pipelines

```javascript theme={null}
const response = await fetch('https://api.vambe.me/api/public/pipeline', {
  headers: {
    'x-api-key': 'your_api_key_here',
  },
});

const pipelines = await response.json();

// Flatten all stages
const allStages = pipelines.flatMap((pipeline) =>
  pipeline.stages.map((stage) => ({
    ...stage,
    pipelineName: pipeline.name,
    pipelineId: pipeline.id,
  })),
);
```

### 3. Find a Specific Pipeline

```javascript theme={null}
const response = await fetch('https://api.vambe.me/api/public/pipeline', {
  headers: {
    'x-api-key': 'your_api_key_here',
  },
});

const pipelines = await response.json();

// Find by name
const salesPipeline = pipelines.find((p) => p.name === 'Sales Pipeline');

// Find stage within pipeline
const leadStage = salesPipeline?.stages.find((s) => s.name === 'Lead');
```

## Error Responses

| Status Code | Description                                             |
| ----------- | ------------------------------------------------------- |
| 400         | Bad Request - Invalid request format                    |
| 401         | Unauthorized - Invalid or missing API key               |
| 500         | Internal Server Error - Something went wrong on our end |

## Tips

* **Cache the response**: Pipeline structures typically don't change frequently, so consider caching this data
* **Use IDs, not names**: Always use pipeline and stage IDs for API calls, as names can be changed by users
* **Empty pipelines**: A new account might have default pipelines or no pipelines at all
* **Stage order**: Stages are returned in the order they appear in the pipeline workflow


## OpenAPI

````yaml get /api/public/pipeline
openapi: 3.0.0
info:
  title: Vambe AI API
  description: Vambe AI documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://api.vambe.me
    description: Production Server
security: []
tags:
  - name: Vambe AI
    description: ''
paths:
  /api/public/pipeline:
    get:
      tags:
        - public/pipeline
      summary: Get Pipelines
      description: Retrieve pipelines based on the provided user.
      operationId: PublicPipelineController_getPipelines
      parameters:
        - name: x-api-key
          in: header
          description: API key needed to authorize the request
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful retrieval of WhatsApp templates.
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.

````