# updatePipelineStage

Update one pipeline stage (by stageId from listPipelineStages): rename, change description, toggle isTerminal / terminalType (WON|LOST|NEUTRAL), or set winProbability (0-100). Only the fields you pass change. Owner-only: the stage's pipeline must be OWNED by your organization.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "updatePipelineStage", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `stageId`: `ID!` (required)
- `name`: `String`
- `description`: `String`
- `isTerminal`: `Boolean`
- `terminalType`: `PipelineStageTerminalType` (one of `WON`, `LOST`, `NEUTRAL`)
- `winProbability`: `Int`

## Response (data, an example)

```json
{
  "dealMutation": {
    "updateDealStage": {
      "id": "<ID>",
      "name": "…",
      "order": 0,
      "description": "…",
      "isTerminal": true,
      "terminalType": "WON",
      "winProbability": 0
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "updatePipelineStage",
    "variables": {
      "stageId": "<stageId>"
    }
  }'
```
