# Update MFA Workflow by ID
URL: /docs/api-reference/multi-factor-authentication-mfa/updateMfaWorkflow

## PUT `/api/v1/public/mfa/workflows/{id}`

**Summary:** Update MFA Workflow by ID
**Operation ID:** `updateMfaWorkflow`

Updates settings, expiry timers, or webhooks on an existing MFA workflow.

**Authentication:** `X-Api-Key: sk_live_...` or `Authorization: Bearer sk_live_...`

### Parameters

| Name | In | Required | Description |
| :--- | :--- | :--- | :--- |
| `id` | `path` | Yes |  |

### Request Body (`application/json`)

```json
{
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "example": "High Value Transactions"
    },
    "senderId": {
      "type": "string",
      "example": "AUTH"
    },
    "codeLength": {
      "type": "integer",
      "minimum": 4,
      "maximum": 8,
      "default": 6,
      "example": 6
    },
    "expiryMinutes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 60,
      "default": 5,
      "example": 5
    },
    "maxAttempts": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10,
      "default": 3,
      "example": 3
    },
    "resendCooldownSeconds": {
      "type": "integer",
      "minimum": 10,
      "maximum": 300,
      "default": 30,
      "example": 30
    },
    "channel": {
      "type": "string",
      "enum": [
        "SMS",
        "WHATSAPP",
        "AUTO_FAILOVER"
      ],
      "default": "AUTO_FAILOVER"
    },
    "messageTemplate": {
      "type": "string",
      "example": "Your security code is {code}."
    },
    "webhookUrl": {
      "type": "string",
      "format": "uri",
      "example": "https://myapp.com/webhooks/mfa"
    },
    "webhookSecret": {
      "type": "string",
      "example": "whsec_secret94812"
    },
    "isDefault": {
      "type": "boolean",
      "default": false
    },
    "isActive": {
      "type": "boolean",
      "default": true
    },
    "defaultProofMode": {
      "type": "string",
      "enum": [
        "CHALLENGE_RESPONSE",
        "PLAIN"
      ],
      "default": "CHALLENGE_RESPONSE",
      "example": "CHALLENGE_RESPONSE"
    }
  }
}
```

### Responses

- **`200`**: Workflow updated successfully

```json
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "example": "success"
    },
    "message": {
      "type": "string",
      "example": "MFA workflow updated successfully"
    },
    "data": {
      "$ref": "#/components/schemas/MfaWorkflowDto"
    }
  }
}
```
- **`401`**: Authentication failed or API key missing