---
updatedAt: 2026-09-09T03:53:19.000Z
agentTools:
  projectIndex: https://docs.vouchery.io/llms.txt
---

# Update a workflow

Update a Workflow

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "contact": {
      "email": "hello@vouchery.io"
    },
    "description": "Vouchery API",
    "license": {
      "name": "Commercial",
      "url": "https://www.vouchery.io"
    },
    "title": "Vouchery",
    "version": "dev-vouchery-go"
  },
  "paths": {
    "/api/v2.1/workflows/{workflow_id}": {
      "patch": {
        "description": "Update a Workflow",
        "operationId": "patchApiV21WorkflowsWorkflowid",
        "parameters": [
          {
            "description": "Workflow ID",
            "in": "path",
            "name": "workflow_id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/requestWorkflowPatchableData"
              }
            }
          },
          "description": "workflow payload",
          "required": true
        },
        "responses": {
          "200": {
            "description": "Created object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/responseWorkflowFull"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/responseError_Example_BadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/responseError_Example_Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/responseError_Example_Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "Not found error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/responseError_Example_NotFound"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity error. Validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/responseValidationError_Example"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. Try again in a few minutes or contact support.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/responseError_Example_InternalServerError"
                }
              }
            }
          }
        },
        "security": [
          {
            "app_auth": [
              "admin"
            ]
          }
        ],
        "summary": "Update a workflow",
        "tags": [
          "Workflows"
        ]
      }
    }
  },
  "tags": [
    {
      "description": "",
      "externalDocs": {
        "description": "",
        "url": "https://docs.vouchery.io"
      },
      "name": "Workflows"
    }
  ],
  "servers": [
    {
      "url": "https://admin.sandbox.vouchery.app"
    }
  ],
  "components": {
    "securitySchemes": {
      "app_auth": {
        "in": "header",
        "name": "Authorization",
        "type": "apiKey"
      }
    },
    "schemas": {
      "modelAction": {
        "properties": {
          "action_on_failure": {
            "type": "string"
          },
          "action_on_success": {
            "type": "string"
          },
          "action_on_timeout": {
            "type": "string"
          },
          "campaign_id": {
            "description": "Nullable. Integer or null",
            "example": "123",
            "format": "int64",
            "type": "integer"
          },
          "condition": {
            "$ref": "#/components/schemas/modelFilterDefinition"
          },
          "id": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "multiplier": {
            "description": "Nullable. Float64",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "notification": {
            "$ref": "#/components/schemas/modelEmailNotification"
          },
          "source": {
            "$ref": "#/components/schemas/modelFilterExtractor"
          },
          "stop_on_entry": {
            "type": "boolean"
          },
          "timeout": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "waits_for_events": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "type"
        ],
        "type": "object"
      },
      "modelEmailNotification": {
        "properties": {
          "body": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "subject",
          "body"
        ],
        "type": "object"
      },
      "modelFilterDefinition": {
        "properties": {
          "filters": {
            "items": {
              "$ref": "#/components/schemas/modelFilterDefinition"
            },
            "type": "array"
          },
          "left": {
            "$ref": "#/components/schemas/modelFilterExtractor"
          },
          "operator": {
            "type": "string"
          },
          "right": {
            "$ref": "#/components/schemas/modelFilterExtractor"
          }
        },
        "required": [
          "filters",
          "operator"
        ],
        "type": "object"
      },
      "modelFilterExtractor": {
        "properties": {
          "key": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "value": {}
        },
        "required": [
          "type",
          "key",
          "value"
        ],
        "type": "object"
      },
      "requestWorkflowPatchableData": {
        "properties": {
          "actions": {
            "description": "Nullable. ",
            "items": {
              "$ref": "#/components/schemas/modelAction"
            },
            "type": "array"
          },
          "before_birthday": {
            "description": "Nullable. Integer or null",
            "example": "123",
            "format": "int64",
            "type": "integer"
          },
          "expires_in": {
            "description": "Nullable. String or null.",
            "type": "string"
          },
          "first_action_id": {
            "description": "Nullable. String or null.",
            "type": "string"
          },
          "launch_criteria": {
            "$ref": "#/components/schemas/modelFilterDefinition"
          },
          "metadata": {
            "description": "Nullable. ",
            "items": {
              "format": "int32",
              "type": "integer"
            },
            "type": "object"
          },
          "name": {
            "description": "Nullable. String or null.",
            "type": "string"
          },
          "namespace": {
            "description": "Nullable. String or null.",
            "type": "string"
          },
          "type": {
            "description": "Nullable. String or null.",
            "enum": [
              "reactive",
              "birthday"
            ],
            "example": "reactive",
            "type": "string"
          },
          "valid_from": {
            "description": "Nullable. ",
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "valid_to": {
            "description": "Nullable. ",
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "responseAuthor": {
        "properties": {
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "email"
        ],
        "type": "object"
      },
      "responseError_Example_BadRequest": {
        "properties": {
          "code": {
            "example": "bad_request",
            "type": "string"
          },
          "error": {
            "example": "true",
            "type": "boolean"
          },
          "message": {
            "example": "Error message",
            "type": "string"
          },
          "type": {
            "example": "Error",
            "type": "string"
          }
        },
        "required": [
          "error",
          "message",
          "type",
          "code"
        ],
        "type": "object"
      },
      "responseError_Example_Forbidden": {
        "properties": {
          "code": {
            "example": "forbidden",
            "type": "string"
          },
          "error": {
            "example": "true",
            "type": "boolean"
          },
          "message": {
            "example": "You are not permitted to access this resource",
            "type": "string"
          },
          "type": {
            "example": "Error",
            "type": "string"
          }
        },
        "required": [
          "message",
          "type",
          "code",
          "error"
        ],
        "type": "object"
      },
      "responseError_Example_InternalServerError": {
        "properties": {
          "code": {
            "example": "unknown_error",
            "type": "string"
          },
          "error": {
            "example": "true",
            "type": "boolean"
          },
          "message": {
            "example": "Unknown error. Trace ID 1b477920d09147d9bce22cce8f405e98.",
            "type": "string"
          },
          "type": {
            "example": "Error",
            "type": "string"
          }
        },
        "required": [
          "message",
          "type",
          "code",
          "error"
        ],
        "type": "object"
      },
      "responseError_Example_NotFound": {
        "properties": {
          "code": {
            "example": "not_found",
            "type": "string"
          },
          "error": {
            "example": "true",
            "type": "boolean"
          },
          "message": {
            "example": "Object was not found",
            "type": "string"
          },
          "type": {
            "example": "Error",
            "type": "string"
          }
        },
        "required": [
          "type",
          "code",
          "error",
          "message"
        ],
        "type": "object"
      },
      "responseError_Example_Unauthorized": {
        "properties": {
          "code": {
            "example": "not_authorized",
            "type": "string"
          },
          "error": {
            "example": "true",
            "type": "boolean"
          },
          "message": {
            "example": "Not authorized",
            "type": "string"
          },
          "type": {
            "example": "Error",
            "type": "string"
          }
        },
        "required": [
          "code",
          "error",
          "message",
          "type"
        ],
        "type": "object"
      },
      "responseValidationError_Example": {
        "properties": {
          "code": {
            "example": "invalid",
            "type": "string"
          },
          "error": {
            "example": "true",
            "type": "boolean"
          },
          "errors": {
            "items": {
              "$ref": "#/components/schemas/responseValidationSubError_Example"
            },
            "type": "array"
          },
          "message": {
            "example": "Object is invalid",
            "type": "string"
          },
          "type": {
            "example": "Error",
            "type": "string"
          }
        },
        "required": [
          "code",
          "error",
          "message",
          "type",
          "errors"
        ],
        "type": "object"
      },
      "responseValidationSubError_Example": {
        "properties": {
          "attribute": {
            "description": "Name of the property which is invalid",
            "example": "name",
            "type": "string"
          },
          "code": {
            "example": "must_be_unique",
            "type": "string"
          },
          "message": {
            "example": "Name must be unique",
            "type": "string"
          }
        },
        "required": [
          "attribute",
          "code",
          "message"
        ],
        "type": "object"
      },
      "responseWorkflow": {
        "properties": {
          "activated_at": {
            "description": "Nullable. ",
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "before_birthday": {
            "description": "Nullable. Integer or null",
            "example": "123",
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "$ref": "#/components/schemas/responseAuthor"
          },
          "deactivated_at": {
            "description": "Nullable. ",
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "expires_in": {
            "type": "string"
          },
          "first_action_id": {
            "type": "string"
          },
          "id": {
            "format": "int32",
            "type": "integer"
          },
          "launch_criteria": {
            "$ref": "#/components/schemas/modelFilterDefinition"
          },
          "metadata": {
            "items": {
              "format": "int32",
              "type": "integer"
            },
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "namespace": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "updated_at": {
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "updated_by": {
            "$ref": "#/components/schemas/responseAuthor"
          },
          "valid_from": {
            "description": "Nullable. ",
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "valid_to": {
            "description": "Nullable. ",
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "name",
          "namespace",
          "id",
          "expires_in",
          "created_at",
          "first_action_id",
          "type",
          "updated_at",
          "metadata"
        ],
        "type": "object"
      },
      "responseWorkflowAction": {
        "properties": {
          "action_on_failure": {
            "type": "string"
          },
          "action_on_success": {
            "type": "string"
          },
          "action_on_timeout": {
            "type": "string"
          },
          "campaign_id": {
            "description": "Nullable. Integer or null",
            "example": "123",
            "format": "int64",
            "type": "integer"
          },
          "condition": {
            "$ref": "#/components/schemas/modelFilterDefinition"
          },
          "id": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "multiplier": {
            "description": "Nullable. Float64",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "notification": {
            "$ref": "#/components/schemas/modelEmailNotification"
          },
          "source": {
            "$ref": "#/components/schemas/modelFilterExtractor"
          },
          "stop_on_entry": {
            "type": "boolean"
          },
          "timeout": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "waits_for_events": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "action_on_success",
          "action_on_timeout",
          "value",
          "waits_for_events",
          "stop_on_entry",
          "key",
          "timeout",
          "type",
          "action_on_failure"
        ],
        "type": "object"
      },
      "responseWorkflowFull": {
        "properties": {
          "Workflow": {
            "$ref": "#/components/schemas/responseWorkflow"
          },
          "actions": {
            "items": {
              "$ref": "#/components/schemas/responseWorkflowAction"
            },
            "type": "array"
          }
        },
        "required": [
          "actions"
        ],
        "type": "object"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```