---
title: "Update pipeline stage"
method: PATCH
path: "/api/pipeline-stages/{sid}"
tags: ["pipeline_stages"]
---

# Update pipeline stage

`PATCH /api/pipeline-stages/{sid}`

## Request

- Base URL: `https://beta.getsales.io/playtables/v1`
- URL: `https://beta.getsales.io/playtables/v1/api/pipeline-stages/{sid}`
- Auth: HTTP bearer and API key in header `Team-SID`

Rename, recategorize or reposition ONE stage definition; it never moves people or companies between stages (that is move_pipeline_stage_objects). order is the 1..N position and siblings recontiguate around it, which on a person pipeline also rewrites the forward-only rank the auto-advance compares. A system stage (key != null) takes name and order only: another category is a 422, and object / key are refused everywhere. Rename collision: 409; no field at all: 422 nothing_to_update.

Contract:
- MCP tool `update_pipeline_stage`, registry package `mcp.playtables/pipeline_stages`, mount `playtables.pipeline`.
- Operation `update`, response envelope `update`.
- Flags: none.

## Path parameters

- `sid` string, required: Pipeline stage sid (cr_ps_…).

## Request body

- UpdatePipelineStageRequest: Request body of `update_pipeline_stage`.
  - `name` string: New label. A collision with another live stage of the same (team, object) is a 409 duplicate_rejected.
  - `category` 'cold' | 'approaching' | 'engaging' | 'positive' | 'nurture' | 'negative' | 'disqualified': New funnel bucket. LOCKED on a system stage (key != null): sending a different value there is a 422 validation_failed.
  - `order` integer: New position, 1..N within its (team, object) pipeline. Siblings recontiguate around it in the same transaction; out of range is a 422. Reordering a person pipeline changes the forward-only rank, so it changes which auto-transitions are allowed to fire.

## Response `200`

`update` success envelope.

- UpdatePipelineStageResponse
  - `success` true, required
  - `operation` 'update', required
  - `item` object, required
    - `sid` string, required: Pipeline stage sid (cr_ps_…) - the value people.pipeline_stage_sid / companies.pipeline_stage_sid store.
    - `team_sid` string, required: Owning team (ts_tm_…, external - gs.service.id).
    - `object` 'person' | 'company', required: Which pipeline this stage belongs to: person (leads) | company (accounts). Immutable after create.
    - `name` string, required: Stage label (1..255), unique per (team, object) among live rows, case-insensitively.
    - `category` 'cold' | 'approaching' | 'engaging' | 'positive' | 'nurture' | 'negative' | 'disqualified', required: Funnel bucket, one of seven: the grouping of the company card and the grid, the chip colour, the funnel analytics and the company derivation (positive > engaging > approaching > nurture > negative > cold; a person on a disqualified stage is not an active member of the account). negative = a real no (Not interested); disqualified = not a target, filtered out (Wrong Decision Maker, Disqualified). Locked on a system stage (key != null).
    - `created_by` object, required: Actor that created the stage (AccessIdentityValue); the seeded system stages carry the system identity.
      - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
      - `actor_sid` string, nullable, required
      - `team_sid` string, required
      - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
      - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
      - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
      - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
      - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
      - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
    - `key` string, nullable, required: Stable snake_case anchor on SYSTEM stages ('new_contact', 'company_opportunity', …), the target the auto-transition engine resolves; null = a custom stage. key != null is what makes a stage system: locked category, non-deletable. Read-only.
    - `order` integer, nullable, required: Position within its (team, object) pipeline, contiguous 1..N, and the forward-only rank for a person (a target stage is only auto-entered when its order >= the current one). 0 = pulled out of the ordering (a soft-deleted row).
    - `created_at` string, required: ISO 8601 UTC.
    - `updated_at` string, required: ISO 8601 UTC; bumped by rename / recategorize / reorder.
    - `deleted_at` string, nullable, required: ISO 8601 UTC; null = live (soft delete).
  - `updated_fields` string[], required
  - `previous_values` object, required
  - `kept_fields` string[]: The fields this write did not change because the person's own value stands on them (stamped person); read the item for what landed.
  - `meta` object, required
    - `trace_id` string, required: UUID v7; same 128-bit value as the X-Trace-Id header.
    - `span_id` string, required: 16 hex chars, root span of this request.
    - `timestamp` string, required: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
    - `duration_ms` integer, required: Server-side wall clock.
    - `team_sid` string, nullable: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
    - `actor_type` string, nullable: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.

## Other responses

- `4XX`: MCP error envelope. `error.code` is one of validation_failed, nothing_to_update, not_found, relation_not_found, invalid_transition, limit_exceeded, payment_required, duplicate_rejected, conflict, delete_blocked, unauthorized, forbidden, rate_limited, not_implemented.
- `5XX`: MCP error envelope with `error.code` internal_error or service_unavailable.

---

[API](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-playtables.md) - [All operations](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-playtables/llms.txt) - [OpenAPI document](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-playtables/revisions/aa394506515d?raw)
