---
title: "Update state machine"
method: PATCH
path: "/api/v1/state-machines/{id}"
tags: ["state-machines"]
---

# Update state machine

`PATCH /api/v1/state-machines/{id}`

Partially updates a state machine by its identifier (name, transitions, active). The code and entity type are immutable. When transitions change, the resulting graph goes through the same structural save validations as creation.

## Path parameters

- `id` string, uuid, required

## Request body

- StateMachineUpdate
  - `name` string
  - `transitions` StateMachineTransition[]
    - `from` string, required
    - `to` string, required
  - `states` StateMachineStateConfig[]
    - `status` string, required
  - `active` boolean

## Response `200`

State machine updated.

- StateMachineUpdateResponse
  - `transitions` StateMachineTransitionResponse[], required
    - `from` string, required
    - `to` string, required
  - `states` StateMachineStateConfigResponse[], required
    - `actions` string[], required
    - `status` string, required
  - `id` string, required
  - `entity_type` 'ORDER' | 'FULFILLMENT_ORDER', required
  - `code` string, required
  - `name` string, required
  - `active` boolean, required
  - `created_at` string, required
  - `updated_at` string, required

## Other responses

- `400` — Request payload, query string, or path parameter failed validation.
- `401` — Authentication is missing, malformed, expired, or refers to a session that is no longer active.
- `403` — The caller is authenticated but lacks the required permission for this action.
- `404` — One of the referenced resources (StateMachine, Status) was not found in the caller account.
- `422` — The payload passed schema validation but breaks a structural save validation.
- `500` — Unexpected server error. The response body never leaks internal details.

---

[API](https://skmtc.dev/kruzer-corp/apis/oms-api.md) · [All operations](https://skmtc.dev/kruzer-corp/apis/oms-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kruzer-corp/oms-api/revisions/985f572bb039/schema)
