Vapi · Schema

CustomerCustomEndpointingRule

AIVoiceAgentsRealtimeCPaaS

Properties

Name Type Description
type string This endpointing rule is based on current customer message as they are speaking. Flow: - Assistant speaks - Customer starts speaking - Customer transcription comes in - This rule is evaluated on the c
regex string This is the regex pattern to match. Note: - This works by using the `RegExp.test` method in Node.JS. Eg. `/hello/.test("hello there")` will return `true`. Hot tip: - In JavaScript, escape `\` when sen
regexOptions array These are the options for the regex match. Defaults to all disabled. @default []
timeoutSeconds number This is the endpointing timeout in seconds, if the rule is matched.
View JSON Schema on GitHub

JSON Schema

vapi-customercustomendpointingrule-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/CustomerCustomEndpointingRule",
  "title": "CustomerCustomEndpointingRule",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "description": "This endpointing rule is based on current customer message as they are speaking.\n\nFlow:\n- Assistant speaks\n- Customer starts speaking\n- Customer transcription comes in\n- This rule is evaluated on the current customer transcription\n- If a match is found based on `regex`, the endpointing timeout is set to `timeoutSeconds`\n\nUsage:\n- If you want to wait longer while customer is speaking numbers, you can set a longer timeout.",
      "enum": [
        "customer"
      ]
    },
    "regex": {
      "type": "string",
      "description": "This is the regex pattern to match.\n\nNote:\n- This works by using the `RegExp.test` method in Node.JS. Eg. `/hello/.test(\"hello there\")` will return `true`.\n\nHot tip:\n- In JavaScript, escape `\\` when sending the regex pattern. Eg. `\"hello\\sthere\"` will be sent over the wire as `\"hellosthere\"`. Send `\"hello\\\\sthere\"` instead.\n- `RegExp.test` does substring matching, so `/cat/.test(\"I love cats\")` will return `true`. To do full string matching, send \"^cat$\"."
    },
    "regexOptions": {
      "description": "These are the options for the regex match. Defaults to all disabled.\n\n@default []",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/RegexOption"
      }
    },
    "timeoutSeconds": {
      "type": "number",
      "description": "This is the endpointing timeout in seconds, if the rule is matched.",
      "minimum": 0,
      "maximum": 15
    }
  },
  "required": [
    "type",
    "regex",
    "timeoutSeconds"
  ]
}