# Update Pipeline

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

Updates an existing pipeline. Send only the fields to change; omit `stages` to leave the stages as they are.

**Stages.** When sent, `stages` replaces the whole list: send an existing stage with its `id` to keep it, leave `id` out to add a new stage, and leave a stage out of the array to remove it. An existing stage sent without its `id` counts as removed and is replaced by a new stage with a new id. At least one existing stage must remain; otherwise the request fails with `PIPELINE_CANNOT_DELETE_ALL_STAGES`. A stage `id` that matches no existing stage is treated as a new stage.

Stages are written only through the pipeline's `stages` array; there are no stage-level endpoints.

**Removed stages.** Opportunities in removed stages move to the stage with the lowest `position`, and workflow triggers on removed stages are removed.

**Names.** Pipeline names must be unique within the location and stage names unique within the pipeline (both case-insensitive; stage names are trimmed).

**Win probability.** A `stageWinProbability` (0–100) is saved only when every stage in the request has one; if any stage leaves it out, all values are dropped and forecasting uses automatic probabilities based on stage position. `useOpportunityProbability` lets an opportunity's own `forecastProbability` take precedence over its stage's.

**Colors.** Stage `color` is a `#RRGGBB` hex code; `colorRenderMode` (`dot`, `bg-tint` or `none`) sets how stage colors are shown.

## Authentication

Send `Authorization: Bearer <token>` using:

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

## 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}": {
      "put": {
        "summary": "Update Pipeline",
        "operationId": "updatePipeline",
        "description": "Updates an existing pipeline. Send only the fields to change; omit `stages` to leave the stages as they are.\n\n**Stages.** When sent, `stages` replaces the whole list: send an existing stage with its `id` to keep it, leave `id` out to add a new stage, and leave a stage out of the array to remove it. An existing stage sent without its `id` counts as removed and is replaced by a new stage with a new id. At least one existing stage must remain; otherwise the request fails with `PIPELINE_CANNOT_DELETE_ALL_STAGES`. A stage `id` that matches no existing stage is treated as a new stage.\n\nStages are written only through the pipeline's `stages` array; there are no stage-level endpoints.\n\n**Removed stages.** Opportunities in removed stages move to the stage with the lowest `position`, and workflow triggers on removed stages are removed.\n\n**Names.** Pipeline names must be unique within the location and stage names unique within the pipeline (both case-insensitive; stage names are trimmed).\n\n**Win probability.** A `stageWinProbability` (0–100) is saved only when every stage in the request has one; if any stage leaves it out, all values are dropped and forecasting uses automatic probabilities based on stage position. `useOpportunityProbability` lets an opportunity's own `forecastProbability` take precedence over its stage's.\n\n**Colors.** Stage `color` is a `#RRGGBB` hex code; `colorRenderMode` (`dot`, `bg-tint` or `none`) sets how stage colors are shown.",
        "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"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePipelineDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PipelinesResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. `code` is `PIPELINE_DUPLICATE_NAME`, `PIPELINE_DUPLICATE_STAGE_NAMES`, or `PIPELINE_CANNOT_DELETE_ALL_STAGES`. Unexpected errors return `{ success: false, message }`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PipelineBadRequestDTO"
                }
              }
            }
          },
          "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.write"
            ]
          }
        ]
      }
    }
  },
  "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": {
      "UpdatePipelineDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the pipeline",
            "example": "pipeline"
          },
          "stages": {
            "description": "The full list of stages after the update; it replaces the current list. Keep a stage by sending its `id`, add one by leaving `id` out, and remove one by leaving it out of the array. Each stage needs a `name` and a unique `position`. Omit `stages` to leave the stages unchanged.",
            "example": [
              {
                "id": "38704eb0-6b4f-4c3e-8919-4835d51de0c8",
                "name": "Contacted",
                "position": 1
              },
              {
                "id": "a9f0c112-3b4d-4e2f-91ab-cd34ef567890",
                "name": "Qualified",
                "position": 2
              },
              {
                "name": "Proposal Sent",
                "position": 3
              }
            ],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Name of the stage",
                  "example": "stage"
                },
                "position": {
                  "type": "number",
                  "description": "Order of the stage in the pipeline. Required, and must be unique within the pipeline.",
                  "example": 1
                },
                "stageWinProbability": {
                  "type": "number",
                  "description": "Win probability (0–100) for opportunities in this stage, rounded to 2 decimals. Saved only when every stage in the request has a value; if any stage leaves it out, all values are dropped and forecasting uses an automatic probability spread evenly by position: 100 / (number of stages + 1) × the stage's rank.",
                  "example": 50,
                  "minimum": 0,
                  "maximum": 100
                },
                "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
                },
                "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"
                },
                "id": {
                  "type": "string",
                  "description": "Id of an existing stage, to keep it. Leave it out to add a new stage; an existing stage sent without its id is removed and replaced by a new one.",
                  "example": "adkjjkdfsdftkmvd"
                }
              },
              "required": [
                "name",
                "position"
              ],
              "title": "IStageUpdate"
            }
          },
          "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
          },
          "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"
          }
        },
        "title": "UpdatePipelineDto"
      },
      "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"
      },
      "PipelineBadRequestDTO": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Always `false`",
            "example": false
          },
          "message": {
            "type": "string",
            "description": "Error message describing why the request is invalid",
            "example": "Pipeline with the same name already exists."
          },
          "code": {
            "type": "string",
            "description": "Machine-readable error code. Unexpected errors on create and update have no `code`; on delete they use `COMMON_SOMETHING_WENT_WRONG`.",
            "enum": [
              "PIPELINE_DUPLICATE_NAME",
              "PIPELINE_DUPLICATE_STAGE_NAMES",
              "PIPELINE_DUPLICATE_EXTERNAL_OBJECT_ID",
              "PIPELINE_CANNOT_DELETE_ALL_STAGES",
              "COMMON_SOMETHING_WENT_WRONG"
            ],
            "example": "PIPELINE_DUPLICATE_NAME"
          },
          "meta": {
            "description": "Details for recovering from the error; which keys appear depends on `code`",
            "example": {
              "id": "aWdODOBVOlH1RUFKWQke"
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "With `PIPELINE_DUPLICATE_NAME` on create: id of the pipeline that already has the name",
                    "example": "aWdODOBVOlH1RUFKWQke"
                  },
                  "existingId": {
                    "type": "string",
                    "description": "With `PIPELINE_DUPLICATE_EXTERNAL_OBJECT_ID`: id of the pipeline that already has the `externalObjectId`",
                    "example": "aWdODOBVOlH1RUFKWQke"
                  },
                  "pipelineName": {
                    "type": "string",
                    "description": "With `PIPELINE_DUPLICATE_EXTERNAL_OBJECT_ID`: name of that pipeline",
                    "example": "Sales Pipeline"
                  },
                  "matchingField": {
                    "type": "string",
                    "description": "With `PIPELINE_DUPLICATE_EXTERNAL_OBJECT_ID`: the field that matched",
                    "example": "externalObjectId"
                  }
                },
                "title": "PipelineErrorMetaDTO"
              }
            ]
          }
        },
        "title": "PipelineBadRequestDTO"
      },
      "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 PUT 'https://services.leadconnectorhq.com/opportunities/pipelines/<pipelineId>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "name": "pipeline",
  "stages": [
    {
      "id": "38704eb0-6b4f-4c3e-8919-4835d51de0c8",
      "name": "Contacted",
      "position": 1
    },
    {
      "id": "a9f0c112-3b4d-4e2f-91ab-cd34ef567890",
      "name": "Qualified",
      "position": 2
    },
    {
      "name": "Proposal Sent",
      "position": 3
    }
  ],
  "showInFunnel": false,
  "showInPieChart": true,
  "useOpportunityProbability": true,
  "colorRenderMode": "dot"
}'
```

**Node.js**

```javascript
const options = {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "name": "pipeline",
      "stages": [
        {
          "id": "38704eb0-6b4f-4c3e-8919-4835d51de0c8",
          "name": "Contacted",
          "position": 1
        },
        {
          "id": "a9f0c112-3b4d-4e2f-91ab-cd34ef567890",
          "name": "Qualified",
          "position": 2
        },
        {
          "name": "Proposal Sent",
          "position": 3
        }
      ],
      "showInFunnel": false,
      "showInPieChart": true,
      "useOpportunityProbability": true,
      "colorRenderMode": "dot"
  })
};

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"
}

payload = {
    "name": "pipeline",
    "stages": [
        {
            "id": "38704eb0-6b4f-4c3e-8919-4835d51de0c8",
            "name": "Contacted",
            "position": 1
        },
        {
            "id": "a9f0c112-3b4d-4e2f-91ab-cd34ef567890",
            "name": "Qualified",
            "position": 2
        },
        {
            "name": "Proposal Sent",
            "position": 3
        }
    ],
    "showInFunnel": false,
    "showInPieChart": true,
    "useOpportunityProbability": true,
    "colorRenderMode": "dot"
}

response = requests.put(url, json=payload, 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 => 'PUT',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "name": "pipeline",
  "stages": [
    {
      "id": "38704eb0-6b4f-4c3e-8919-4835d51de0c8",
      "name": "Contacted",
      "position": 1
    },
    {
      "id": "a9f0c112-3b4d-4e2f-91ab-cd34ef567890",
      "name": "Qualified",
      "position": 2
    },
    {
      "name": "Proposal Sent",
      "position": 3
    }
  ],
  "showInFunnel": false,
  "showInPieChart": true,
  "useOpportunityProbability": true,
  "colorRenderMode": "dot"
}',
]);

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

**Java**

```java
HttpResponse<String> response = Unirest
  .put("https://services.leadconnectorhq.com/opportunities/pipelines/<pipelineId>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .header("Content-Type", "application/json")
  .body("{\"name\":\"pipeline\",\"stages\":[{\"id\":\"38704eb0-6b4f-4c3e-8919-4835d51de0c8\",\"name\":\"Contacted\",\"position\":1},{\"id\":\"a9f0c112-3b4d-4e2f-91ab-cd34ef567890\",\"name\":\"Qualified\",\"position\":2},{\"name\":\"Proposal Sent\",\"position\":3}],\"showInFunnel\":false,\"showInPieChart\":true,\"useOpportunityProbability\":true,\"colorRenderMode\":\"dot\"}")
  .asString();
```

**Go**

```go
package main

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

func main() {
  url := "https://services.leadconnectorhq.com/opportunities/pipelines/<pipelineId>"
  payload := strings.NewReader(`{
  "name": "pipeline",
  "stages": [
    {
      "id": "38704eb0-6b4f-4c3e-8919-4835d51de0c8",
      "name": "Contacted",
      "position": 1
    },
    {
      "id": "a9f0c112-3b4d-4e2f-91ab-cd34ef567890",
      "name": "Qualified",
      "position": 2
    },
    {
      "name": "Proposal Sent",
      "position": 3
    }
  ],
  "showInFunnel": false,
  "showInPieChart": true,
  "useOpportunityProbability": true,
  "colorRenderMode": "dot"
}`)
  req, _ := http.NewRequest("PUT", url, payload)
  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::Put.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"
request["Content-Type"] = "application/json"
request.body = '{
  "name": "pipeline",
  "stages": [
    {
      "id": "38704eb0-6b4f-4c3e-8919-4835d51de0c8",
      "name": "Contacted",
      "position": 1
    },
    {
      "id": "a9f0c112-3b4d-4e2f-91ab-cd34ef567890",
      "name": "Qualified",
      "position": 2
    },
    {
      "name": "Proposal Sent",
      "position": 3
    }
  ],
  "showInFunnel": false,
  "showInPieChart": true,
  "useOpportunityProbability": true,
  "colorRenderMode": "dot"
}'

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

**PowerShell**

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

$body = '{
  "name": "pipeline",
  "stages": [
    {
      "id": "38704eb0-6b4f-4c3e-8919-4835d51de0c8",
      "name": "Contacted",
      "position": 1
    },
    {
      "id": "a9f0c112-3b4d-4e2f-91ab-cd34ef567890",
      "name": "Qualified",
      "position": 2
    },
    {
      "name": "Proposal Sent",
      "position": 3
    }
  ],
  "showInFunnel": false,
  "showInPieChart": true,
  "useOpportunityProbability": true,
  "colorRenderMode": "dot"
}'

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/opportunities/pipelines/<pipelineId>' -Method 'PUT' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
