# Get Pipeline

GET https://services.leadconnectorhq.com/opportunities/pipelines/{pipelineId}

Retrieves a single pipeline by its ID, including all its stages and configuration.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `pipelines.readonly`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version. Send `v3`. |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `pipelineId` | string | Yes | The unique identifier of the pipeline |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "LeadConnector API",
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/opportunities/pipelines/{pipelineId}": {
      "get": {
        "summary": "Get Pipeline",
        "operationId": "getPipeline",
        "description": "Retrieves a single pipeline by its ID, including all its stages and configuration.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version. Send `v3`.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          },
          {
            "name": "pipelineId",
            "required": true,
            "in": "path",
            "description": "The unique identifier of the pipeline",
            "schema": {
              "example": "aWdODOBVOlH1RUFKWQke",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PipelinesResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. Unexpected errors inside the handler can also be returned as 400 with a `traceId`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "404": {
            "description": "Pipeline not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceNotFoundDTO"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests: the rate limit for this app and location was exceeded. Retry after the burst window (`X-RateLimit-Interval-Milliseconds`) when `X-RateLimit-Remaining` is 0 or less, or after 00:00 UTC when `X-RateLimit-Daily-Remaining` is 0 or less.",
            "headers": {
              "X-RateLimit-Max": {
                "description": "Requests allowed in the burst window",
                "schema": {
                  "type": "integer",
                  "example": 100
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left in the current burst window; when 0 or less, retry after the window resets",
                "schema": {
                  "type": "integer",
                  "example": 0
                }
              },
              "X-RateLimit-Interval-Milliseconds": {
                "description": "Length of the burst window in milliseconds; wait this long before retrying a burst-limited request",
                "schema": {
                  "type": "integer",
                  "example": 10000
                }
              },
              "X-RateLimit-Limit-Daily": {
                "description": "Requests allowed per UTC calendar day; the count resets at 00:00 UTC",
                "schema": {
                  "type": "integer",
                  "example": 200000
                }
              },
              "X-RateLimit-Daily-Remaining": {
                "description": "Requests left today (UTC); when 0 or less, retry after 00:00 UTC",
                "schema": {
                  "type": "integer",
                  "example": 0
                }
              },
              "X-RateLimit-Daily-Reset": {
                "description": "Milliseconds until the current daily window ends and X-RateLimit-Daily-Remaining returns to the full X-RateLimit-Limit-Daily. A duration, not a timestamp: add it to the time the response was received to get the reset time. One-second precision, so always a multiple of 1000. When no daily window is running yet, reports the full window, 86400000 (24 hours), and the window starts with that request",
                "schema": {
                  "type": "integer",
                  "example": 86400000
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsDTO"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorDTO"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error"
          }
        },
        "security": [
          {
            "bearer": [
              "pipelines.readonly"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "PipelinesResponseSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the pipeline",
            "example": "aWdODOBVOlH1RUFKWQke"
          },
          "name": {
            "type": "string",
            "description": "Name of the pipeline",
            "example": "new pipeline"
          },
          "stages": {
            "description": "Stages belonging to this pipeline",
            "example": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique identifier of the stage",
                  "example": "38704eb0-6b4f-4c3e-8919-4835d51de0c8"
                },
                "name": {
                  "type": "string",
                  "description": "Name of the stage",
                  "example": "test"
                },
                "showInFunnel": {
                  "type": "boolean",
                  "description": "Whether the stage is shown in the funnel view",
                  "example": false
                },
                "showInPieChart": {
                  "type": "boolean",
                  "description": "Whether the stage is shown in the pie chart view",
                  "example": true
                },
                "position": {
                  "type": "number",
                  "description": "Order of the stage in the pipeline (unique within the pipeline)",
                  "example": 2
                },
                "stageWinProbability": {
                  "type": "number",
                  "description": "Win probability (0–100) for opportunities in this stage. Always present in responses: when the stages have no saved probabilities, it is the automatic value spread evenly by position (100 / (number of stages + 1) × the stage's rank), whatever `useOpportunityProbability` is set to.",
                  "example": 50
                },
                "originId": {
                  "type": "string",
                  "description": "Identifier of the stage this stage was copied from, if any",
                  "example": "aWdODOBVOlH1RUFKWQke"
                },
                "color": {
                  "type": "string",
                  "description": "Stage color as a 6-digit hex code (`#RRGGBB`), shown according to the pipeline's `colorRenderMode`. Any other format fails validation.",
                  "example": "#FF0000"
                }
              },
              "title": "StagesSchema"
            }
          },
          "showInFunnel": {
            "type": "boolean",
            "description": "Whether the pipeline is shown in the funnel view",
            "example": false
          },
          "showInPieChart": {
            "type": "boolean",
            "description": "Whether the pipeline is shown in the pie chart view",
            "example": true
          },
          "locationId": {
            "type": "string",
            "description": "Identifier of the location (sub-account) this pipeline belongs to",
            "example": "VeMHYX28Satp2p7XVKbb"
          },
          "useOpportunityProbability": {
            "type": "boolean",
            "description": "When `true`, forecasting uses an opportunity's own `forecastProbability` when it has one, and its stage's win probability otherwise. When `false` or unset, the stage probability is always used.",
            "example": true
          },
          "colorRenderMode": {
            "type": "string",
            "enum": [
              "dot",
              "bg-tint",
              "none"
            ],
            "description": "How stage colors are shown: `dot` shows a colored dot next to each stage, `bg-tint` tints the stage background and `none` shows no color, whatever the stage `color` values are.",
            "example": "dot"
          },
          "position": {
            "type": "string",
            "example": "a0V",
            "description": "Fractional-index key used to sort pipelines. Updated when the user reorders pipelines (via drag-and-drop or the reorder modal)."
          }
        },
        "title": "PipelinesResponseSchema"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "ResourceNotFoundDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "HTTP status code",
            "example": 404
          },
          "error": {
            "type": "string",
            "description": "HTTP error name",
            "example": "Not Found"
          },
          "message": {
            "type": "string",
            "description": "Error message describing which resource was not found",
            "example": "Opportunity not found"
          },
          "code": {
            "type": "string",
            "description": "Machine-readable error code naming the missing resource, such as `OPPORTUNITY_NOT_FOUND`, `PIPELINE_NOT_FOUND` or `OPPORTUNITY_CONTACT_NOT_FOUND`",
            "example": "OPPORTUNITY_NOT_FOUND"
          }
        },
        "title": "ResourceNotFoundDTO"
      },
      "TooManyRequestsDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "HTTP status code",
            "example": 429
          },
          "message": {
            "type": "string",
            "description": "Error message",
            "example": "Rate limit exceeded."
          },
          "error": {
            "type": "string",
            "description": "HTTP error name",
            "example": "Too Many Requests"
          }
        },
        "title": "TooManyRequestsDTO"
      },
      "InternalServerErrorDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "HTTP status code",
            "example": 500
          },
          "message": {
            "type": "string",
            "description": "Error message describing the internal server error",
            "example": "Internal Server Error"
          }
        },
        "title": "InternalServerErrorDTO"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/opportunities/pipelines/<pipelineId>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3'
```

**Node.js**

```javascript
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3'
  }
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/opportunities/pipelines/<pipelineId>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/opportunities/pipelines/{pipelineId}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v3"
}

response = requests.get(url, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/opportunities/pipelines/<pipelineId>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/opportunities/pipelines/<pipelineId>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {
  url := "https://services.leadconnectorhq.com/opportunities/pipelines/<pipelineId>"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v3")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/opportunities/pipelines/<pipelineId>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v3"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/opportunities/pipelines/<pipelineId>' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
