# reorderPipelineStages

Reorder a pipeline's stages (by pipelineId): pass every stage id in the desired order. Owner-only: the pipeline must be OWNED by your organization. Returns the pipeline with its stages in the new order.

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

## Variables

- `pipelineId`: `ID!` (required)
- `stageIds`: `[ID!]!` (required)

## Response (data, an example)

```json
{
  "dealMutation": {
    "reorderDealStages": {
      "id": "<ID>",
      "name": "…",
      "stages": [
        {
          "id": "<ID>",
          "name": "…",
          "order": 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": "reorderPipelineStages",
    "variables": {
      "pipelineId": "<pipelineId>",
      "stageIds": [
        "<stageIds>"
      ]
    }
  }'
```
