---
title: "Update a workflow"
method: PUT
path: "/v1/workflows/{id}"
tags: ["Workflows"]
---

# Update a workflow

`PUT /v1/workflows/{id}`

## Request

- Base URL: `https://api.paymongo.com`
- URL: `https://api.paymongo.com/v1/workflows/{id}`
- Auth: HTTP basic

Replaces the mutable fields of an existing workflow. Superuser only. Requires the current version in the If-Match header (optimistic lock). Body is the workflow YAML definition.

## Path parameters

- `id` string, required

## Headers

- `If-Match` integer, required
- `Organization-Id` string, required

## Request body `application/x-yaml`

- string

## Response `200`

Updated workflow

- WorkflowParserResponseDTO
  - `created_at` string
  - `definition` object
  - `description` string
  - `id` string
  - `internal` boolean
  - `livemode` boolean
  - `name` string
  - `organization_id` string
  - `updated_at` string
  - `version` integer

## Other responses

- `400`: Bad Request
- `401`: authentication_failed, missing_authorization_header, unsupported_auth_method or jwt_signature_invalid when the credential is missing, malformed or rejected; accountid_identity_required when a superuser or service-to-service caller sends the Account-ID header
- `403`: superuser_required
- `404`: workflow_not_found, the workflow is not found in this account and mode
- `409`: active_instances_exist
- `412`: stale_version, the If-Match version is not the current one
- `428`: If-Match header required
- `429`: rate_limited when the organization has submitted too many workflow definitions in the current window
- `500`: Internal Server Error
- `502`: accountid_relationship_lookup_failed or accountid_account_lookup_failed when an upstream service does not answer
- `503`: upstream_unavailable when an upstream service does not answer
- `504`: service_timeout when the request exceeds its deadline

---

[API](https://skmtc.dev/paymongo/apis/workflow.md) - [All operations](https://skmtc.dev/paymongo/apis/workflow/llms.txt) - [OpenAPI document](https://skmtc.dev/paymongo/apis/workflow/revisions/859719cfffa2?raw)
