# Change a verification service

`PUT /verify/services/{id}` · Rivier · voice

Change a verification service. Existing verifications keep running under the rules they started with.

- Scope: voice:write
- Graphql: Mutation.voiceVerifyServiceUpdate
- Sdk: verify.services.update
- Cli: verify service-update

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 30,
      "description": "Shown to the person in the message: Your <name> verification code"
    },
    "enabled": {
      "type": "boolean"
    },
    "codeLength": {
      "type": "integer",
      "minimum": 4,
      "maximum": 10
    },
    "channels": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "sms",
          "whatsapp",
          "call",
          "email"
        ]
      },
      "minItems": 1,
      "maxItems": 4
    },
    "channelOrder": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "sms",
          "whatsapp",
          "call",
          "email"
        ]
      },
      "minItems": 1,
      "maxItems": 4,
      "description": "The order channel auto tries, and a fallback follows"
    },
    "autoFallback": {
      "type": "boolean",
      "description": "When a send fails or is not delivered, try the next channel by itself"
    },
    "codeTtlSeconds": {
      "type": "integer",
      "minimum": 60,
      "maximum": 600
    },
    "maxSends": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5
    },
    "maxChecks": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5
    },
    "resendCooldownSeconds": {
      "type": "integer",
      "minimum": 0,
      "maximum": 600
    },
    "defaultCountry": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[A-Za-z]{2}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "defaultLocale": {
      "type": "string",
      "minLength": 2,
      "maxLength": 10
    },
    "customCodeEnabled": {
      "type": "boolean"
    },
    "psd2Enabled": {
      "type": "boolean"
    },
    "dtmfInputRequired": {
      "type": "boolean"
    },
    "ttsName": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 60
        },
        {
          "type": "null"
        }
      ]
    },
    "doNotShareWarning": {
      "type": "boolean"
    },
    "lookupFirst": {
      "type": "boolean",
      "description": "Look the number up before sending: landlines get a call instead of a text and blocked line types are refused"
    },
    "skipSmsToLandlines": {
      "type": "boolean"
    },
    "rateLimits": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "to",
              "ip",
              "user",
              "device",
              "service"
            ],
            "description": "What the limit counts by: the destination, the caller's network address, a user id, a device id, or the whole service"
          },
          "max": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "intervalSeconds": {
            "type": "integer",
            "minimum": 10,
            "maximum": 86400
          }
        },
        "required": [
          "key",
          "max",
          "intervalSeconds"
        ],
        "additionalProperties": false
      },
      "maxItems": 10
    },
    "fraud": {
      "type": "object",
      "properties": {
        "allowCountries": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z]{2}$"
          },
          "maxItems": 250,
          "description": "Only these countries may receive a code; empty allows all"
        },
        "denyCountries": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z]{2}$"
          },
          "maxItems": 250
        },
        "blockPremium": {
          "type": "boolean"
        },
        "blockLineTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 2,
            "maxLength": 30
          },
          "maxItems": 20,
          "description": "Line types from a lookup to refuse, for example voip or nonFixedVoip"
        },
        "distinctPerIp": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "max": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 1000
                },
                "intervalSeconds": {
                  "type": "integer",
                  "minimum": 10,
                  "maximum": 86400
                }
              },
              "required": [
                "max",
                "intervalSeconds"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "sequentialGuard": {
          "type": "boolean"
        },
        "conversionGuard": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "minSends": {
                  "type": "integer",
                  "minimum": 5,
                  "maximum": 100000
                },
                "minConversion": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "windowSeconds": {
                  "type": "integer",
                  "minimum": 300,
                  "maximum": 604800
                }
              },
              "required": [
                "minSends",
                "minConversion",
                "windowSeconds"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "email": {
      "type": "object",
      "properties": {
        "from": {
          "anyOf": [
            {
              "type": "string",
              "format": "email",
              "maxLength": 320
            },
            {
              "type": "null"
            }
          ]
        },
        "fromName": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        },
        "transport": {
          "type": "string",
          "enum": [
            "auto",
            "resend",
            "furcate-mail",
            "own-mta"
          ]
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X PUT 'https://api.rivier.ai/verify/services/{id}' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "enabled": false,
  "codeLength": 0,
  "channels": [
    "sms"
  ],
  "channelOrder": [
    "sms"
  ],
  "autoFallback": false,
  "codeTtlSeconds": 0,
  "maxSends": 0
}'
```
