{
  "openapi": "3.1.0",
  "info": {
    "title": "Nairon Service API",
    "description": "Platform control-plane API (flows, config, usage) + MCP server.",
    "version": "1.3.5"
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Secret API key (nrn_sk_...) as a Bearer token"
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Secret API key (nrn_sk_...)"
      }
    },
    "schemas": {}
  },
  "paths": {
    "/healthz": {
      "get": {
        "tags": [
          "meta"
        ],
        "description": "Liveness probe — no auth required.",
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    },
                    "service": {
                      "type": "string",
                      "enum": [
                        "service-api"
                      ]
                    },
                    "version": {
                      "type": "string"
                    },
                    "gitSha": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "service",
                    "version",
                    "gitSha"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{projectId}/flows": {
      "get": {
        "tags": [
          "flows"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "flows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "projectId": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "simple",
                              "graph"
                            ]
                          },
                          "description": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "agentProfileId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "cuid",
                                "pattern": "^[cC][0-9a-z]{6,}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "projectId",
                          "name",
                          "type",
                          "description",
                          "agentProfileId",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "flows"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "flows"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 5000
                  },
                  "type": {
                    "default": "simple",
                    "type": "string",
                    "enum": [
                      "simple",
                      "graph"
                    ]
                  },
                  "flowSchema": {},
                  "agentProfileId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "cuid",
                        "pattern": "^[cC][0-9a-z]{6,}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "flowSchema"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "simple",
                        "graph"
                      ]
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentProfileId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "cuid",
                          "pattern": "^[cC][0-9a-z]{6,}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "type",
                    "description",
                    "agentProfileId",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/flows/{flowId}": {
      "get": {
        "tags": [
          "flows"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "flowId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "simple",
                        "graph"
                      ]
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentProfileId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "cuid",
                          "pattern": "^[cC][0-9a-z]{6,}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "type",
                    "description",
                    "agentProfileId",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "flows"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 5000
                  },
                  "agentProfileId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "cuid",
                        "pattern": "^[cC][0-9a-z]{6,}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "flowId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "simple",
                        "graph"
                      ]
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentProfileId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "cuid",
                          "pattern": "^[cC][0-9a-z]{6,}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "type",
                    "description",
                    "agentProfileId",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "flows"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "flowId",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/flows/{flowId}/versions": {
      "get": {
        "tags": [
          "flow-versions"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "flowId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "versions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "flowId": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "version": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "tag": {
                            "type": "string"
                          },
                          "flowSchema": {
                            "anyOf": [
                              {},
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "isActive": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "flowId",
                          "version",
                          "tag",
                          "flowSchema",
                          "isActive",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "versions"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "flow-versions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "flowSchema": {}
                },
                "required": [
                  "flowSchema"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "flowId",
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "flowId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "version": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "tag": {
                      "type": "string"
                    },
                    "flowSchema": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "flowId",
                    "version",
                    "tag",
                    "flowSchema",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/flow-versions/{versionId}": {
      "get": {
        "tags": [
          "flow-versions"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "versionId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "flowId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "version": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "tag": {
                      "type": "string"
                    },
                    "flowSchema": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "flowId",
                    "version",
                    "tag",
                    "flowSchema",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "flow-versions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tag": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "required": [
                  "tag"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "versionId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "flowId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "version": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "tag": {
                      "type": "string"
                    },
                    "flowSchema": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "flowId",
                    "version",
                    "tag",
                    "flowSchema",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "flow-versions"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "versionId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "cuid",
                          "pattern": "^[cC][0-9a-z]{6,}$"
                        },
                        "flowId": {
                          "type": "string",
                          "format": "cuid",
                          "pattern": "^[cC][0-9a-z]{6,}$"
                        },
                        "version": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "tag": {
                          "type": "string"
                        },
                        "flowSchema": {
                          "anyOf": [
                            {},
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "isActive": {
                          "type": "boolean"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "flowId",
                        "version",
                        "tag",
                        "flowSchema",
                        "isActive",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/flow-versions/{versionId}/activate": {
      "post": {
        "tags": [
          "flow-versions"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "versionId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "flowId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "version": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "tag": {
                      "type": "string"
                    },
                    "flowSchema": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "flowId",
                    "version",
                    "tag",
                    "flowSchema",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{projectId}/phone-numbers": {
      "get": {
        "tags": [
          "phone-numbers"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "phoneNumbers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "projectId": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "nairon",
                              "partner",
                              "external"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "number": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "enabled",
                              "disabled"
                            ]
                          },
                          "flowId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "cuid",
                                "pattern": "^[cC][0-9a-z]{6,}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "externalPhoneFields": {
                            "anyOf": [
                              {},
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "projectId",
                          "type",
                          "name",
                          "number",
                          "status",
                          "flowId",
                          "externalPhoneFields",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "phoneNumbers"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "phone-numbers"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "number": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "status": {
                    "default": "disabled",
                    "type": "string",
                    "enum": [
                      "enabled",
                      "disabled"
                    ]
                  },
                  "type": {
                    "default": "nairon",
                    "type": "string",
                    "enum": [
                      "nairon",
                      "partner",
                      "external"
                    ]
                  },
                  "flowId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "cuid",
                        "pattern": "^[cC][0-9a-z]{6,}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalPhoneFields": {
                    "anyOf": [
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "number"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "nairon",
                        "partner",
                        "external"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "number": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "enabled",
                        "disabled"
                      ]
                    },
                    "flowId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "cuid",
                          "pattern": "^[cC][0-9a-z]{6,}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "externalPhoneFields": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "type",
                    "name",
                    "number",
                    "status",
                    "flowId",
                    "externalPhoneFields",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/phone-numbers/{phoneNumberId}/flow": {
      "patch": {
        "tags": [
          "phone-numbers"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "flowId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "cuid",
                        "pattern": "^[cC][0-9a-z]{6,}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "flowId"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "phoneNumberId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "nairon",
                        "partner",
                        "external"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "number": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "enabled",
                        "disabled"
                      ]
                    },
                    "flowId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "cuid",
                          "pattern": "^[cC][0-9a-z]{6,}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "externalPhoneFields": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "type",
                    "name",
                    "number",
                    "status",
                    "flowId",
                    "externalPhoneFields",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{projectId}/agent-profiles": {
      "get": {
        "tags": [
          "agent-profiles"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agentProfiles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "projectId": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "isDefault": {
                            "type": "boolean"
                          },
                          "supportedInputLanguages": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "reasoningMode": {
                            "type": "string"
                          },
                          "outputVoiceId": {
                            "type": "string"
                          },
                          "flowIds": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "format": "cuid",
                              "pattern": "^[cC][0-9a-z]{6,}$"
                            }
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "projectId",
                          "name",
                          "isDefault",
                          "supportedInputLanguages",
                          "reasoningMode",
                          "outputVoiceId",
                          "flowIds",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "agentProfiles"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/agent-profiles/{agentProfileId}": {
      "get": {
        "tags": [
          "agent-profiles"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "agentProfileId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "isDefault": {
                      "type": "boolean"
                    },
                    "supportedInputLanguages": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "reasoningMode": {
                      "type": "string"
                    },
                    "outputVoiceId": {
                      "type": "string"
                    },
                    "flowIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "cuid",
                        "pattern": "^[cC][0-9a-z]{6,}$"
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "isDefault",
                    "supportedInputLanguages",
                    "reasoningMode",
                    "outputVoiceId",
                    "flowIds",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "agent-profiles"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "flowIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    }
                  },
                  "isDefault": {
                    "type": "boolean"
                  },
                  "supportedInputLanguages": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "de",
                        "el",
                        "en",
                        "es",
                        "fr",
                        "it",
                        "nl",
                        "pt"
                      ]
                    }
                  },
                  "reasoningMode": {
                    "type": "string",
                    "enum": [
                      "fast",
                      "balanced",
                      "smart",
                      "turbo"
                    ]
                  },
                  "outputVoiceId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "name",
                  "flowIds",
                  "isDefault",
                  "supportedInputLanguages",
                  "reasoningMode",
                  "outputVoiceId"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "agentProfileId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "isDefault": {
                      "type": "boolean"
                    },
                    "supportedInputLanguages": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "reasoningMode": {
                      "type": "string"
                    },
                    "outputVoiceId": {
                      "type": "string"
                    },
                    "flowIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "cuid",
                        "pattern": "^[cC][0-9a-z]{6,}$"
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "isDefault",
                    "supportedInputLanguages",
                    "reasoningMode",
                    "outputVoiceId",
                    "flowIds",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{projectId}/usage": {
      "get": {
        "tags": [
          "usage"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            "in": "query",
            "name": "from",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            "in": "query",
            "name": "to",
            "required": false
          },
          {
            "schema": {
              "default": "day",
              "type": "string",
              "enum": [
                "hour",
                "day"
              ]
            },
            "in": "query",
            "name": "granularity",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "granularity": {
                      "type": "string",
                      "enum": [
                        "hour",
                        "day"
                      ]
                    },
                    "points": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "windowStart": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          },
                          "windowEnd": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          },
                          "service": {
                            "type": "string",
                            "enum": [
                              "tts",
                              "stt",
                              "s2s",
                              "llm",
                              "kb",
                              "voice_minutes"
                            ]
                          },
                          "mode": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "realtime",
                                  "batch",
                                  "playground"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "metric": {
                            "type": "string",
                            "enum": [
                              "seconds",
                              "tokens_in",
                              "tokens_out",
                              "chars",
                              "minutes",
                              "requests"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "windowStart",
                          "windowEnd",
                          "service",
                          "mode",
                          "metric",
                          "quantity"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "projectId",
                    "granularity",
                    "points"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/orgs/{orgId}/usage": {
      "get": {
        "tags": [
          "usage"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            "in": "query",
            "name": "from",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            "in": "query",
            "name": "to",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "orgId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "organizationId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "totals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "service": {
                            "type": "string",
                            "enum": [
                              "tts",
                              "stt",
                              "s2s",
                              "llm",
                              "kb",
                              "voice_minutes"
                            ]
                          },
                          "mode": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "realtime",
                                  "batch",
                                  "playground"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "metric": {
                            "type": "string",
                            "enum": [
                              "seconds",
                              "tokens_in",
                              "tokens_out",
                              "chars",
                              "minutes",
                              "requests"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "service",
                          "mode",
                          "metric",
                          "quantity"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "organizationId",
                    "totals"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/organization/usage": {
      "get": {
        "tags": [
          "usage"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            "in": "query",
            "name": "from",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            "in": "query",
            "name": "to",
            "required": false
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "organizationId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "totals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "service": {
                            "type": "string",
                            "enum": [
                              "tts",
                              "stt",
                              "s2s",
                              "llm",
                              "kb",
                              "voice_minutes"
                            ]
                          },
                          "mode": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "realtime",
                                  "batch",
                                  "playground"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "metric": {
                            "type": "string",
                            "enum": [
                              "seconds",
                              "tokens_in",
                              "tokens_out",
                              "chars",
                              "minutes",
                              "requests"
                            ]
                          },
                          "quantity": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "service",
                          "mode",
                          "metric",
                          "quantity"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "organizationId",
                    "totals"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/organization": {
      "get": {
        "tags": [
          "organization"
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "standard",
                        "partner"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "type"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{projectId}": {
      "get": {
        "tags": [
          "project"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "organizationId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "archived",
                        "paused"
                      ]
                    },
                    "plan": {
                      "type": "string",
                      "enum": [
                        "free",
                        "starter",
                        "growth",
                        "pro",
                        "enterprise"
                      ]
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "hotline",
                        "platform"
                      ]
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "simple",
                        "advanced"
                      ]
                    },
                    "channels": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "phone",
                          "website"
                        ]
                      }
                    },
                    "industry": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "organizationId",
                    "name",
                    "description",
                    "status",
                    "plan",
                    "type",
                    "mode",
                    "channels",
                    "industry",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{projectId}/agent": {
      "get": {
        "tags": [
          "agent"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "languages": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "profile": {
                      "type": "string",
                      "enum": [
                        "fast",
                        "standard",
                        "smart",
                        "openai"
                      ]
                    },
                    "voice": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "transcriptionDictionary": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "languages",
                    "profile",
                    "voice",
                    "transcriptionDictionary"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "agent"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "profile": {
                    "type": "string",
                    "enum": [
                      "fast",
                      "standard",
                      "smart"
                    ]
                  },
                  "voiceId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "transcriptionDictionary": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "languages": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "profile": {
                      "type": "string",
                      "enum": [
                        "fast",
                        "standard",
                        "smart",
                        "openai"
                      ]
                    },
                    "voice": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "transcriptionDictionary": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "languages",
                    "profile",
                    "voice",
                    "transcriptionDictionary"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{projectId}/conversations": {
      "get": {
        "tags": [
          "conversation"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "conversations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "projectId": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "design": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "simple",
                                  "graph"
                                ]
                              }
                            },
                            "required": [
                              "kind"
                            ],
                            "additionalProperties": false
                          },
                          "activeVersion": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "n": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "tag": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "n",
                                  "tag",
                                  "createdAt"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "projectId",
                          "name",
                          "description",
                          "design",
                          "activeVersion"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "conversations"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "conversation"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 5000
                  },
                  "design": {
                    "type": "object",
                    "properties": {
                      "schemaVersion": {
                        "type": "string",
                        "enum": [
                          "cd/1"
                        ]
                      },
                      "entry": {
                        "type": "object",
                        "properties": {
                          "stepId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "alternates": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1
                            }
                          }
                        },
                        "required": [
                          "stepId"
                        ],
                        "additionalProperties": false
                      },
                      "steps": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "minLength": 1
                        },
                        "additionalProperties": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "greeting"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "introLine": {
                                  "type": "string"
                                },
                                "persona": {
                                  "type": "object",
                                  "properties": {
                                    "whoAmI": {
                                      "type": "string"
                                    },
                                    "purpose": {
                                      "type": "string"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "on": {
                                  "type": "object",
                                  "properties": {
                                    "next": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "kind",
                                "on"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "talk"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "topic": {
                                  "type": "string"
                                },
                                "knowledgeRefs": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "strict": {
                                  "type": "boolean"
                                },
                                "on": {
                                  "type": "object",
                                  "properties": {
                                    "done": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "offTopic": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "kind",
                                "topic",
                                "on"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "route"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "ask": {
                                  "type": "boolean"
                                },
                                "question": {
                                  "type": "string"
                                },
                                "options": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "description": {
                                        "type": "string"
                                      },
                                      "target": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "id"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "on": {
                                  "type": "object",
                                  "properties": {
                                    "default": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "kind",
                                "on"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "collect"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "format": {
                                  "type": "string",
                                  "enum": [
                                    "text",
                                    "number",
                                    "object"
                                  ]
                                },
                                "prompt": {
                                  "type": "string"
                                },
                                "variable": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "on": {
                                  "type": "object",
                                  "properties": {
                                    "answered": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "fallback": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "kind",
                                "format",
                                "prompt",
                                "on"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "keypad"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "prompt": {
                                  "type": "string"
                                },
                                "variable": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "timeoutSeconds": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "on": {
                                  "type": "object",
                                  "properties": {
                                    "completed": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeout": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "kind",
                                "prompt",
                                "on"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "confirm"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "prompt": {
                                  "type": "string"
                                },
                                "on": {
                                  "type": "object",
                                  "properties": {
                                    "yes": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "no": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "kind",
                                "prompt",
                                "on"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "recordingConsent"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "prompt": {
                                  "type": "string"
                                },
                                "on": {
                                  "type": "object",
                                  "properties": {
                                    "consent": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "decline": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "kind",
                                "prompt",
                                "on"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "end"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "summarize": {
                                  "type": "boolean"
                                },
                                "allowCancel": {
                                  "type": "boolean"
                                },
                                "on": {
                                  "type": "object",
                                  "properties": {
                                    "cancel": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "kind",
                                "on"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "transfer"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "target": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "internal",
                                        "phone"
                                      ]
                                    },
                                    "phoneNumber": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "type"
                                  ],
                                  "additionalProperties": false
                                },
                                "timeoutSeconds": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "on": {
                                  "type": "object",
                                  "properties": {
                                    "timeout": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "kind",
                                "target",
                                "on"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "callback"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "schedule": {
                                  "type": "string",
                                  "enum": [
                                    "slots",
                                    "asap"
                                  ]
                                },
                                "timeFrames": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "day": {
                                        "type": "string",
                                        "enum": [
                                          "monday",
                                          "tuesday",
                                          "wednesday",
                                          "thursday",
                                          "friday",
                                          "saturday",
                                          "sunday"
                                        ]
                                      },
                                      "startTime": {
                                        "type": "string"
                                      },
                                      "endTime": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "day",
                                      "startTime",
                                      "endTime"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "askForName": {
                                  "type": "boolean"
                                },
                                "integrationRef": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "on": {
                                  "type": "object",
                                  "properties": {
                                    "success": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "failure": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "kind",
                                "on"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "knowledge": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "knowledgeBase"
                                  ]
                                },
                                "knowledgeBaseId": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "id",
                                "kind",
                                "knowledgeBaseId"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "text"
                                  ]
                                },
                                "text": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "kind",
                                "text"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "variables": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "text",
                                "number",
                                "object"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "type"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "integrations": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "crm",
                                "calendar",
                                "knowledge"
                              ]
                            },
                            "integrationId": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "id",
                            "kind",
                            "integrationId"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "hooks": {
                        "type": "object",
                        "properties": {
                          "before": {
                            "type": "object",
                            "properties": {
                              "rootNodeId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "entryPoints": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "additionalProperties": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "nodes": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "additionalProperties": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "next": {
                                      "type": "object",
                                      "properties": {
                                        "hookNode": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "step": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "end": {
                                          "type": "boolean",
                                          "enum": [
                                            true
                                          ]
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "webhook": {
                                      "type": "object",
                                      "properties": {
                                        "url": {
                                          "type": "string"
                                        },
                                        "headers": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string"
                                          },
                                          "additionalProperties": {
                                            "type": "string"
                                          }
                                        },
                                        "secretHint": {
                                          "type": "string"
                                        },
                                        "signatureHeader": {
                                          "type": "string"
                                        },
                                        "payload": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "key": {
                                                "type": "string"
                                              },
                                              "source": {
                                                "type": "string",
                                                "enum": [
                                                  "variable",
                                                  "custom",
                                                  "ai"
                                                ]
                                              },
                                              "systemVariable": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "value": {
                                                "type": "string"
                                              },
                                              "aiPrompt": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "key",
                                              "source"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "timeoutSeconds": {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        },
                                        "responseVariableId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "responsePath": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "url",
                                        "payload"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "fetch": {
                                      "type": "object",
                                      "properties": {
                                        "url": {
                                          "type": "string"
                                        },
                                        "method": {
                                          "type": "string",
                                          "enum": [
                                            "GET",
                                            "POST"
                                          ]
                                        },
                                        "query": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string"
                                          },
                                          "additionalProperties": {
                                            "type": "string"
                                          }
                                        },
                                        "headers": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string"
                                          },
                                          "additionalProperties": {
                                            "type": "string"
                                          }
                                        },
                                        "body": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "key": {
                                                "type": "string"
                                              },
                                              "source": {
                                                "type": "string",
                                                "enum": [
                                                  "variable",
                                                  "custom",
                                                  "ai"
                                                ]
                                              },
                                              "systemVariable": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "value": {
                                                "type": "string"
                                              },
                                              "aiPrompt": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "key",
                                              "source"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "responseFormat": {
                                          "type": "string",
                                          "enum": [
                                            "json",
                                            "text"
                                          ]
                                        },
                                        "responseMappings": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "path": {
                                                "type": "string"
                                              },
                                              "transform": {
                                                "type": "string",
                                                "enum": [
                                                  "auto",
                                                  "text",
                                                  "number",
                                                  "boolean",
                                                  "json"
                                                ]
                                              },
                                              "defaultValue": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "variableId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "url",
                                        "method",
                                        "responseMappings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "condition": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "enum": [
                                                "logic"
                                              ]
                                            },
                                            "branches": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "label": {
                                                    "type": "string"
                                                  },
                                                  "predicate": {
                                                    "type": "object",
                                                    "properties": {
                                                      "variable": {
                                                        "type": "object",
                                                        "properties": {
                                                          "systemVariable": {
                                                            "type": "string"
                                                          },
                                                          "variableId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "additionalProperties": false
                                                      },
                                                      "operator": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "exists",
                                                          "not_exists",
                                                          "gt",
                                                          "lt",
                                                          "contains"
                                                        ]
                                                      },
                                                      "value": {
                                                        "type": "string"
                                                      }
                                                    },
                                                    "required": [
                                                      "variable",
                                                      "operator"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  "next": {
                                                    "type": "object",
                                                    "properties": {
                                                      "hookNode": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "step": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "end": {
                                                        "type": "boolean",
                                                        "enum": [
                                                          true
                                                        ]
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "label",
                                                  "predicate",
                                                  "next"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "else": {
                                              "type": "object",
                                              "properties": {
                                                "hookNode": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "step": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "end": {
                                                  "type": "boolean",
                                                  "enum": [
                                                    true
                                                  ]
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "mode",
                                            "branches",
                                            "else"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "enum": [
                                                "ai"
                                              ]
                                            },
                                            "prompt": {
                                              "type": "string"
                                            },
                                            "branches": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "label": {
                                                    "type": "string"
                                                  },
                                                  "description": {
                                                    "type": "string"
                                                  },
                                                  "next": {
                                                    "type": "object",
                                                    "properties": {
                                                      "hookNode": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "step": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "end": {
                                                        "type": "boolean",
                                                        "enum": [
                                                          true
                                                        ]
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "label",
                                                  "description",
                                                  "next"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "else": {
                                              "type": "object",
                                              "properties": {
                                                "hookNode": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "step": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "end": {
                                                  "type": "boolean",
                                                  "enum": [
                                                    true
                                                  ]
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "mode",
                                            "prompt",
                                            "branches",
                                            "else"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    },
                                    "setVariable": {
                                      "type": "object",
                                      "properties": {
                                        "variableId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "value": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "variableId",
                                        "value"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "sendSms": {
                                      "type": "object",
                                      "properties": {
                                        "to": {
                                          "type": "object",
                                          "properties": {
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "literalString": {
                                              "type": "string"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "message": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "to",
                                        "message"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "crmLookup": {
                                      "type": "object",
                                      "properties": {
                                        "integrationRef": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "matchBy": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "enum": [
                                              "phone",
                                              "email"
                                            ]
                                          }
                                        },
                                        "phoneSource": {
                                          "type": "object",
                                          "properties": {
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "emailSource": {
                                          "type": "object",
                                          "properties": {
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "fieldMappings": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "field": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "defaultValue": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "field",
                                              "variableId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "includePrimaryDeal": {
                                          "type": "boolean"
                                        },
                                        "onNotFound": {
                                          "type": "object",
                                          "properties": {
                                            "hookNode": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "step": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "end": {
                                              "type": "boolean",
                                              "enum": [
                                                true
                                              ]
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "integrationRef",
                                        "matchBy",
                                        "fieldMappings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "crmWrite": {
                                      "type": "object",
                                      "properties": {
                                        "integrationRef": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "contactIdSource": {
                                          "type": "object",
                                          "properties": {
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "createContactIfMissing": {
                                          "type": "boolean"
                                        },
                                        "operations": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "enum": [
                                              "log_call",
                                              "create_note",
                                              "update_contact"
                                            ]
                                          }
                                        },
                                        "logCall": {
                                          "type": "object",
                                          "properties": {
                                            "subjectTemplate": {
                                              "type": "string"
                                            },
                                            "includeTranscript": {
                                              "type": "boolean"
                                            },
                                            "includeSummary": {
                                              "type": "boolean"
                                            },
                                            "includeRecordingUrl": {
                                              "type": "boolean"
                                            }
                                          },
                                          "required": [
                                            "includeTranscript",
                                            "includeSummary",
                                            "includeRecordingUrl"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "createNote": {
                                          "type": "object",
                                          "properties": {
                                            "bodyTemplate": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "bodyTemplate"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "updateContact": {
                                          "type": "object",
                                          "properties": {
                                            "propertyMappings": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "property": {
                                                    "type": "string"
                                                  },
                                                  "propertyLabel": {
                                                    "type": "string"
                                                  },
                                                  "source": {
                                                    "type": "string",
                                                    "enum": [
                                                      "variable",
                                                      "custom",
                                                      "ai"
                                                    ]
                                                  },
                                                  "systemVariable": {
                                                    "type": "string"
                                                  },
                                                  "variableId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "value": {
                                                    "type": "string"
                                                  },
                                                  "aiPrompt": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "property",
                                                  "source"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "propertyMappings"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "integrationRef",
                                        "contactIdSource",
                                        "operations"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "id"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "nodes"
                            ],
                            "additionalProperties": false
                          },
                          "after": {
                            "type": "object",
                            "properties": {
                              "entryPoints": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "additionalProperties": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "prematureHangupNodeId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "nodes": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "additionalProperties": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "next": {
                                      "type": "object",
                                      "properties": {
                                        "hookNode": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "step": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "end": {
                                          "type": "boolean",
                                          "enum": [
                                            true
                                          ]
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "webhook": {
                                      "type": "object",
                                      "properties": {
                                        "url": {
                                          "type": "string"
                                        },
                                        "headers": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string"
                                          },
                                          "additionalProperties": {
                                            "type": "string"
                                          }
                                        },
                                        "secretHint": {
                                          "type": "string"
                                        },
                                        "signatureHeader": {
                                          "type": "string"
                                        },
                                        "payload": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "key": {
                                                "type": "string"
                                              },
                                              "source": {
                                                "type": "string",
                                                "enum": [
                                                  "variable",
                                                  "custom",
                                                  "ai"
                                                ]
                                              },
                                              "systemVariable": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "value": {
                                                "type": "string"
                                              },
                                              "aiPrompt": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "key",
                                              "source"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "timeoutSeconds": {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        },
                                        "responseVariableId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "responsePath": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "url",
                                        "payload"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "fetch": {
                                      "type": "object",
                                      "properties": {
                                        "url": {
                                          "type": "string"
                                        },
                                        "method": {
                                          "type": "string",
                                          "enum": [
                                            "GET",
                                            "POST"
                                          ]
                                        },
                                        "query": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string"
                                          },
                                          "additionalProperties": {
                                            "type": "string"
                                          }
                                        },
                                        "headers": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string"
                                          },
                                          "additionalProperties": {
                                            "type": "string"
                                          }
                                        },
                                        "body": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "key": {
                                                "type": "string"
                                              },
                                              "source": {
                                                "type": "string",
                                                "enum": [
                                                  "variable",
                                                  "custom",
                                                  "ai"
                                                ]
                                              },
                                              "systemVariable": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "value": {
                                                "type": "string"
                                              },
                                              "aiPrompt": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "key",
                                              "source"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "responseFormat": {
                                          "type": "string",
                                          "enum": [
                                            "json",
                                            "text"
                                          ]
                                        },
                                        "responseMappings": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "path": {
                                                "type": "string"
                                              },
                                              "transform": {
                                                "type": "string",
                                                "enum": [
                                                  "auto",
                                                  "text",
                                                  "number",
                                                  "boolean",
                                                  "json"
                                                ]
                                              },
                                              "defaultValue": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "variableId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "url",
                                        "method",
                                        "responseMappings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "condition": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "enum": [
                                                "logic"
                                              ]
                                            },
                                            "branches": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "label": {
                                                    "type": "string"
                                                  },
                                                  "predicate": {
                                                    "type": "object",
                                                    "properties": {
                                                      "variable": {
                                                        "type": "object",
                                                        "properties": {
                                                          "systemVariable": {
                                                            "type": "string"
                                                          },
                                                          "variableId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "additionalProperties": false
                                                      },
                                                      "operator": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "exists",
                                                          "not_exists",
                                                          "gt",
                                                          "lt",
                                                          "contains"
                                                        ]
                                                      },
                                                      "value": {
                                                        "type": "string"
                                                      }
                                                    },
                                                    "required": [
                                                      "variable",
                                                      "operator"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  "next": {
                                                    "type": "object",
                                                    "properties": {
                                                      "hookNode": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "step": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "end": {
                                                        "type": "boolean",
                                                        "enum": [
                                                          true
                                                        ]
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "label",
                                                  "predicate",
                                                  "next"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "else": {
                                              "type": "object",
                                              "properties": {
                                                "hookNode": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "step": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "end": {
                                                  "type": "boolean",
                                                  "enum": [
                                                    true
                                                  ]
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "mode",
                                            "branches",
                                            "else"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "enum": [
                                                "ai"
                                              ]
                                            },
                                            "prompt": {
                                              "type": "string"
                                            },
                                            "branches": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "label": {
                                                    "type": "string"
                                                  },
                                                  "description": {
                                                    "type": "string"
                                                  },
                                                  "next": {
                                                    "type": "object",
                                                    "properties": {
                                                      "hookNode": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "step": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "end": {
                                                        "type": "boolean",
                                                        "enum": [
                                                          true
                                                        ]
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "label",
                                                  "description",
                                                  "next"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "else": {
                                              "type": "object",
                                              "properties": {
                                                "hookNode": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "step": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "end": {
                                                  "type": "boolean",
                                                  "enum": [
                                                    true
                                                  ]
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "mode",
                                            "prompt",
                                            "branches",
                                            "else"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    },
                                    "setVariable": {
                                      "type": "object",
                                      "properties": {
                                        "variableId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "value": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "variableId",
                                        "value"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "sendSms": {
                                      "type": "object",
                                      "properties": {
                                        "to": {
                                          "type": "object",
                                          "properties": {
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "literalString": {
                                              "type": "string"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "message": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "to",
                                        "message"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "crmLookup": {
                                      "type": "object",
                                      "properties": {
                                        "integrationRef": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "matchBy": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "enum": [
                                              "phone",
                                              "email"
                                            ]
                                          }
                                        },
                                        "phoneSource": {
                                          "type": "object",
                                          "properties": {
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "emailSource": {
                                          "type": "object",
                                          "properties": {
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "fieldMappings": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "field": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "defaultValue": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "field",
                                              "variableId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "includePrimaryDeal": {
                                          "type": "boolean"
                                        },
                                        "onNotFound": {
                                          "type": "object",
                                          "properties": {
                                            "hookNode": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "step": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "end": {
                                              "type": "boolean",
                                              "enum": [
                                                true
                                              ]
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "integrationRef",
                                        "matchBy",
                                        "fieldMappings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "crmWrite": {
                                      "type": "object",
                                      "properties": {
                                        "integrationRef": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "contactIdSource": {
                                          "type": "object",
                                          "properties": {
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "createContactIfMissing": {
                                          "type": "boolean"
                                        },
                                        "operations": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "enum": [
                                              "log_call",
                                              "create_note",
                                              "update_contact"
                                            ]
                                          }
                                        },
                                        "logCall": {
                                          "type": "object",
                                          "properties": {
                                            "subjectTemplate": {
                                              "type": "string"
                                            },
                                            "includeTranscript": {
                                              "type": "boolean"
                                            },
                                            "includeSummary": {
                                              "type": "boolean"
                                            },
                                            "includeRecordingUrl": {
                                              "type": "boolean"
                                            }
                                          },
                                          "required": [
                                            "includeTranscript",
                                            "includeSummary",
                                            "includeRecordingUrl"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "createNote": {
                                          "type": "object",
                                          "properties": {
                                            "bodyTemplate": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "bodyTemplate"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "updateContact": {
                                          "type": "object",
                                          "properties": {
                                            "propertyMappings": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "property": {
                                                    "type": "string"
                                                  },
                                                  "propertyLabel": {
                                                    "type": "string"
                                                  },
                                                  "source": {
                                                    "type": "string",
                                                    "enum": [
                                                      "variable",
                                                      "custom",
                                                      "ai"
                                                    ]
                                                  },
                                                  "systemVariable": {
                                                    "type": "string"
                                                  },
                                                  "variableId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "value": {
                                                    "type": "string"
                                                  },
                                                  "aiPrompt": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "property",
                                                  "source"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "propertyMappings"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "integrationRef",
                                        "contactIdSource",
                                        "operations"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "id"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "nodes"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "additionalProperties": false
                      },
                      "compliance": {
                        "type": "object",
                        "properties": {
                          "aiDisclosure": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "minLength": 1
                            },
                            "additionalProperties": {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "approved",
                                    "rejected"
                                  ]
                                },
                                "checkedText": {
                                  "type": "string"
                                },
                                "reason": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "status",
                                "checkedText"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "additionalProperties": false
                      },
                      "layout": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "minLength": 1
                        },
                        "additionalProperties": {
                          "type": "object",
                          "properties": {
                            "x": {
                              "type": "number"
                            },
                            "y": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "x",
                            "y"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "schemaVersion",
                      "entry",
                      "steps"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "design": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "simple",
                            "graph"
                          ]
                        }
                      },
                      "required": [
                        "kind"
                      ],
                      "additionalProperties": false
                    },
                    "activeVersion": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "n": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "tag": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "n",
                            "tag",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "description",
                    "design",
                    "activeVersion"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/conversations/{id}": {
      "get": {
        "tags": [
          "conversation"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "design": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "simple",
                            "graph"
                          ]
                        }
                      },
                      "required": [
                        "kind"
                      ],
                      "additionalProperties": false
                    },
                    "activeVersion": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "n": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "tag": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "n",
                            "tag",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "description",
                    "design",
                    "activeVersion"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "conversation"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 5000
                  },
                  "agentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "cuid",
                        "pattern": "^[cC][0-9a-z]{6,}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "design": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "simple",
                            "graph"
                          ]
                        }
                      },
                      "required": [
                        "kind"
                      ],
                      "additionalProperties": false
                    },
                    "activeVersion": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "n": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "tag": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "n",
                            "tag",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "description",
                    "design",
                    "activeVersion"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "conversation"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "204": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/conversations/{id}/versions/{n}/activate": {
      "post": {
        "tags": [
          "conversation-design"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "id",
            "required": true
          },
          {
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            "in": "path",
            "name": "n",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "design": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "simple",
                            "graph"
                          ]
                        }
                      },
                      "required": [
                        "kind"
                      ],
                      "additionalProperties": false
                    },
                    "activeVersion": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "n": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "tag": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "n",
                            "tag",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "description",
                    "design",
                    "activeVersion"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/conversations/{id}/design": {
      "get": {
        "tags": [
          "conversation-design"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "schemaVersion": {
                          "type": "string",
                          "enum": [
                            "cd/1"
                          ]
                        },
                        "entry": {
                          "type": "object",
                          "properties": {
                            "stepId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "alternates": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            }
                          },
                          "required": [
                            "stepId"
                          ],
                          "additionalProperties": false
                        },
                        "steps": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "minLength": 1
                          },
                          "additionalProperties": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "greeting"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "introLine": {
                                    "type": "string"
                                  },
                                  "persona": {
                                    "type": "object",
                                    "properties": {
                                      "whoAmI": {
                                        "type": "string"
                                      },
                                      "purpose": {
                                        "type": "string"
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "on": {
                                    "type": "object",
                                    "properties": {
                                      "next": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "on"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "talk"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "topic": {
                                    "type": "string"
                                  },
                                  "knowledgeRefs": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "strict": {
                                    "type": "boolean"
                                  },
                                  "on": {
                                    "type": "object",
                                    "properties": {
                                      "done": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "offTopic": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "topic",
                                  "on"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "route"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "ask": {
                                    "type": "boolean"
                                  },
                                  "question": {
                                    "type": "string"
                                  },
                                  "options": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "title": {
                                          "type": "string"
                                        },
                                        "description": {
                                          "type": "string"
                                        },
                                        "target": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "id"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "on": {
                                    "type": "object",
                                    "properties": {
                                      "default": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "on"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "collect"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "format": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "number",
                                      "object"
                                    ]
                                  },
                                  "prompt": {
                                    "type": "string"
                                  },
                                  "variable": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "on": {
                                    "type": "object",
                                    "properties": {
                                      "answered": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "fallback": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "format",
                                  "prompt",
                                  "on"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "keypad"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "prompt": {
                                    "type": "string"
                                  },
                                  "variable": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "timeoutSeconds": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "on": {
                                    "type": "object",
                                    "properties": {
                                      "completed": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeout": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "prompt",
                                  "on"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "confirm"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "prompt": {
                                    "type": "string"
                                  },
                                  "on": {
                                    "type": "object",
                                    "properties": {
                                      "yes": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "no": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "prompt",
                                  "on"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "recordingConsent"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "prompt": {
                                    "type": "string"
                                  },
                                  "on": {
                                    "type": "object",
                                    "properties": {
                                      "consent": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "decline": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "prompt",
                                  "on"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "end"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "summarize": {
                                    "type": "boolean"
                                  },
                                  "allowCancel": {
                                    "type": "boolean"
                                  },
                                  "on": {
                                    "type": "object",
                                    "properties": {
                                      "cancel": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "on"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "transfer"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "target": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "internal",
                                          "phone"
                                        ]
                                      },
                                      "phoneNumber": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "timeoutSeconds": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "on": {
                                    "type": "object",
                                    "properties": {
                                      "timeout": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "target",
                                  "on"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "callback"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "schedule": {
                                    "type": "string",
                                    "enum": [
                                      "slots",
                                      "asap"
                                    ]
                                  },
                                  "timeFrames": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "day": {
                                          "type": "string",
                                          "enum": [
                                            "monday",
                                            "tuesday",
                                            "wednesday",
                                            "thursday",
                                            "friday",
                                            "saturday",
                                            "sunday"
                                          ]
                                        },
                                        "startTime": {
                                          "type": "string"
                                        },
                                        "endTime": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "day",
                                        "startTime",
                                        "endTime"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "askForName": {
                                    "type": "boolean"
                                  },
                                  "integrationRef": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "on": {
                                    "type": "object",
                                    "properties": {
                                      "success": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "failure": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "on"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "knowledge": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "knowledgeBase"
                                    ]
                                  },
                                  "knowledgeBaseId": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "id",
                                  "kind",
                                  "knowledgeBaseId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "text"
                                    ]
                                  },
                                  "text": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "kind",
                                  "text"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "variables": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "number",
                                  "object"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "type"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "integrations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "crm",
                                  "calendar",
                                  "knowledge"
                                ]
                              },
                              "integrationId": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "integrationId"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "hooks": {
                          "type": "object",
                          "properties": {
                            "before": {
                              "type": "object",
                              "properties": {
                                "rootNodeId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "entryPoints": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "additionalProperties": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "nodes": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "additionalProperties": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "name": {
                                        "type": "string"
                                      },
                                      "next": {
                                        "type": "object",
                                        "properties": {
                                          "hookNode": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "step": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "end": {
                                            "type": "boolean",
                                            "enum": [
                                              true
                                            ]
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "webhook": {
                                        "type": "object",
                                        "properties": {
                                          "url": {
                                            "type": "string"
                                          },
                                          "headers": {
                                            "type": "object",
                                            "propertyNames": {
                                              "type": "string"
                                            },
                                            "additionalProperties": {
                                              "type": "string"
                                            }
                                          },
                                          "secretHint": {
                                            "type": "string"
                                          },
                                          "signatureHeader": {
                                            "type": "string"
                                          },
                                          "payload": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "key": {
                                                  "type": "string"
                                                },
                                                "source": {
                                                  "type": "string",
                                                  "enum": [
                                                    "variable",
                                                    "custom",
                                                    "ai"
                                                  ]
                                                },
                                                "systemVariable": {
                                                  "type": "string"
                                                },
                                                "variableId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "value": {
                                                  "type": "string"
                                                },
                                                "aiPrompt": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "key",
                                                "source"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "timeoutSeconds": {
                                            "type": "integer",
                                            "minimum": -9007199254740991,
                                            "maximum": 9007199254740991
                                          },
                                          "responseVariableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "responsePath": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "url",
                                          "payload"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "fetch": {
                                        "type": "object",
                                        "properties": {
                                          "url": {
                                            "type": "string"
                                          },
                                          "method": {
                                            "type": "string",
                                            "enum": [
                                              "GET",
                                              "POST"
                                            ]
                                          },
                                          "query": {
                                            "type": "object",
                                            "propertyNames": {
                                              "type": "string"
                                            },
                                            "additionalProperties": {
                                              "type": "string"
                                            }
                                          },
                                          "headers": {
                                            "type": "object",
                                            "propertyNames": {
                                              "type": "string"
                                            },
                                            "additionalProperties": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "key": {
                                                  "type": "string"
                                                },
                                                "source": {
                                                  "type": "string",
                                                  "enum": [
                                                    "variable",
                                                    "custom",
                                                    "ai"
                                                  ]
                                                },
                                                "systemVariable": {
                                                  "type": "string"
                                                },
                                                "variableId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "value": {
                                                  "type": "string"
                                                },
                                                "aiPrompt": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "key",
                                                "source"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "responseFormat": {
                                            "type": "string",
                                            "enum": [
                                              "json",
                                              "text"
                                            ]
                                          },
                                          "responseMappings": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "variableId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "path": {
                                                  "type": "string"
                                                },
                                                "transform": {
                                                  "type": "string",
                                                  "enum": [
                                                    "auto",
                                                    "text",
                                                    "number",
                                                    "boolean",
                                                    "json"
                                                  ]
                                                },
                                                "defaultValue": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "variableId"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "url",
                                          "method",
                                          "responseMappings"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "condition": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "enum": [
                                                  "logic"
                                                ]
                                              },
                                              "branches": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "label": {
                                                      "type": "string"
                                                    },
                                                    "predicate": {
                                                      "type": "object",
                                                      "properties": {
                                                        "variable": {
                                                          "type": "object",
                                                          "properties": {
                                                            "systemVariable": {
                                                              "type": "string"
                                                            },
                                                            "variableId": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "operator": {
                                                          "type": "string",
                                                          "enum": [
                                                            "eq",
                                                            "neq",
                                                            "exists",
                                                            "not_exists",
                                                            "gt",
                                                            "lt",
                                                            "contains"
                                                          ]
                                                        },
                                                        "value": {
                                                          "type": "string"
                                                        }
                                                      },
                                                      "required": [
                                                        "variable",
                                                        "operator"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "next": {
                                                      "type": "object",
                                                      "properties": {
                                                        "hookNode": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "step": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "end": {
                                                          "type": "boolean",
                                                          "enum": [
                                                            true
                                                          ]
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "label",
                                                    "predicate",
                                                    "next"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "else": {
                                                "type": "object",
                                                "properties": {
                                                  "hookNode": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "step": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "end": {
                                                    "type": "boolean",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "mode",
                                              "branches",
                                              "else"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "enum": [
                                                  "ai"
                                                ]
                                              },
                                              "prompt": {
                                                "type": "string"
                                              },
                                              "branches": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "label": {
                                                      "type": "string"
                                                    },
                                                    "description": {
                                                      "type": "string"
                                                    },
                                                    "next": {
                                                      "type": "object",
                                                      "properties": {
                                                        "hookNode": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "step": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "end": {
                                                          "type": "boolean",
                                                          "enum": [
                                                            true
                                                          ]
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "label",
                                                    "description",
                                                    "next"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "else": {
                                                "type": "object",
                                                "properties": {
                                                  "hookNode": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "step": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "end": {
                                                    "type": "boolean",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "mode",
                                              "prompt",
                                              "branches",
                                              "else"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      },
                                      "setVariable": {
                                        "type": "object",
                                        "properties": {
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "value": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "variableId",
                                          "value"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "sendSms": {
                                        "type": "object",
                                        "properties": {
                                          "to": {
                                            "type": "object",
                                            "properties": {
                                              "systemVariable": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "literalString": {
                                                "type": "string"
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "message": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "to",
                                          "message"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "crmLookup": {
                                        "type": "object",
                                        "properties": {
                                          "integrationRef": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchBy": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "enum": [
                                                "phone",
                                                "email"
                                              ]
                                            }
                                          },
                                          "phoneSource": {
                                            "type": "object",
                                            "properties": {
                                              "systemVariable": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "emailSource": {
                                            "type": "object",
                                            "properties": {
                                              "systemVariable": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "fieldMappings": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "field": {
                                                  "type": "string"
                                                },
                                                "variableId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "defaultValue": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "field",
                                                "variableId"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "includePrimaryDeal": {
                                            "type": "boolean"
                                          },
                                          "onNotFound": {
                                            "type": "object",
                                            "properties": {
                                              "hookNode": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "step": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "end": {
                                                "type": "boolean",
                                                "enum": [
                                                  true
                                                ]
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "integrationRef",
                                          "matchBy",
                                          "fieldMappings"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "crmWrite": {
                                        "type": "object",
                                        "properties": {
                                          "integrationRef": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "contactIdSource": {
                                            "type": "object",
                                            "properties": {
                                              "systemVariable": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "createContactIfMissing": {
                                            "type": "boolean"
                                          },
                                          "operations": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "enum": [
                                                "log_call",
                                                "create_note",
                                                "update_contact"
                                              ]
                                            }
                                          },
                                          "logCall": {
                                            "type": "object",
                                            "properties": {
                                              "subjectTemplate": {
                                                "type": "string"
                                              },
                                              "includeTranscript": {
                                                "type": "boolean"
                                              },
                                              "includeSummary": {
                                                "type": "boolean"
                                              },
                                              "includeRecordingUrl": {
                                                "type": "boolean"
                                              }
                                            },
                                            "required": [
                                              "includeTranscript",
                                              "includeSummary",
                                              "includeRecordingUrl"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "createNote": {
                                            "type": "object",
                                            "properties": {
                                              "bodyTemplate": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "bodyTemplate"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "updateContact": {
                                            "type": "object",
                                            "properties": {
                                              "propertyMappings": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "property": {
                                                      "type": "string"
                                                    },
                                                    "propertyLabel": {
                                                      "type": "string"
                                                    },
                                                    "source": {
                                                      "type": "string",
                                                      "enum": [
                                                        "variable",
                                                        "custom",
                                                        "ai"
                                                      ]
                                                    },
                                                    "systemVariable": {
                                                      "type": "string"
                                                    },
                                                    "variableId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "value": {
                                                      "type": "string"
                                                    },
                                                    "aiPrompt": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "property",
                                                    "source"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "required": [
                                              "propertyMappings"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "integrationRef",
                                          "contactIdSource",
                                          "operations"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "id"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "nodes"
                              ],
                              "additionalProperties": false
                            },
                            "after": {
                              "type": "object",
                              "properties": {
                                "entryPoints": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "additionalProperties": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "prematureHangupNodeId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "nodes": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "additionalProperties": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "name": {
                                        "type": "string"
                                      },
                                      "next": {
                                        "type": "object",
                                        "properties": {
                                          "hookNode": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "step": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "end": {
                                            "type": "boolean",
                                            "enum": [
                                              true
                                            ]
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "webhook": {
                                        "type": "object",
                                        "properties": {
                                          "url": {
                                            "type": "string"
                                          },
                                          "headers": {
                                            "type": "object",
                                            "propertyNames": {
                                              "type": "string"
                                            },
                                            "additionalProperties": {
                                              "type": "string"
                                            }
                                          },
                                          "secretHint": {
                                            "type": "string"
                                          },
                                          "signatureHeader": {
                                            "type": "string"
                                          },
                                          "payload": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "key": {
                                                  "type": "string"
                                                },
                                                "source": {
                                                  "type": "string",
                                                  "enum": [
                                                    "variable",
                                                    "custom",
                                                    "ai"
                                                  ]
                                                },
                                                "systemVariable": {
                                                  "type": "string"
                                                },
                                                "variableId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "value": {
                                                  "type": "string"
                                                },
                                                "aiPrompt": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "key",
                                                "source"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "timeoutSeconds": {
                                            "type": "integer",
                                            "minimum": -9007199254740991,
                                            "maximum": 9007199254740991
                                          },
                                          "responseVariableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "responsePath": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "url",
                                          "payload"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "fetch": {
                                        "type": "object",
                                        "properties": {
                                          "url": {
                                            "type": "string"
                                          },
                                          "method": {
                                            "type": "string",
                                            "enum": [
                                              "GET",
                                              "POST"
                                            ]
                                          },
                                          "query": {
                                            "type": "object",
                                            "propertyNames": {
                                              "type": "string"
                                            },
                                            "additionalProperties": {
                                              "type": "string"
                                            }
                                          },
                                          "headers": {
                                            "type": "object",
                                            "propertyNames": {
                                              "type": "string"
                                            },
                                            "additionalProperties": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "key": {
                                                  "type": "string"
                                                },
                                                "source": {
                                                  "type": "string",
                                                  "enum": [
                                                    "variable",
                                                    "custom",
                                                    "ai"
                                                  ]
                                                },
                                                "systemVariable": {
                                                  "type": "string"
                                                },
                                                "variableId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "value": {
                                                  "type": "string"
                                                },
                                                "aiPrompt": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "key",
                                                "source"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "responseFormat": {
                                            "type": "string",
                                            "enum": [
                                              "json",
                                              "text"
                                            ]
                                          },
                                          "responseMappings": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "variableId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "path": {
                                                  "type": "string"
                                                },
                                                "transform": {
                                                  "type": "string",
                                                  "enum": [
                                                    "auto",
                                                    "text",
                                                    "number",
                                                    "boolean",
                                                    "json"
                                                  ]
                                                },
                                                "defaultValue": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "variableId"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "url",
                                          "method",
                                          "responseMappings"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "condition": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "enum": [
                                                  "logic"
                                                ]
                                              },
                                              "branches": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "label": {
                                                      "type": "string"
                                                    },
                                                    "predicate": {
                                                      "type": "object",
                                                      "properties": {
                                                        "variable": {
                                                          "type": "object",
                                                          "properties": {
                                                            "systemVariable": {
                                                              "type": "string"
                                                            },
                                                            "variableId": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "operator": {
                                                          "type": "string",
                                                          "enum": [
                                                            "eq",
                                                            "neq",
                                                            "exists",
                                                            "not_exists",
                                                            "gt",
                                                            "lt",
                                                            "contains"
                                                          ]
                                                        },
                                                        "value": {
                                                          "type": "string"
                                                        }
                                                      },
                                                      "required": [
                                                        "variable",
                                                        "operator"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "next": {
                                                      "type": "object",
                                                      "properties": {
                                                        "hookNode": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "step": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "end": {
                                                          "type": "boolean",
                                                          "enum": [
                                                            true
                                                          ]
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "label",
                                                    "predicate",
                                                    "next"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "else": {
                                                "type": "object",
                                                "properties": {
                                                  "hookNode": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "step": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "end": {
                                                    "type": "boolean",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "mode",
                                              "branches",
                                              "else"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "enum": [
                                                  "ai"
                                                ]
                                              },
                                              "prompt": {
                                                "type": "string"
                                              },
                                              "branches": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "label": {
                                                      "type": "string"
                                                    },
                                                    "description": {
                                                      "type": "string"
                                                    },
                                                    "next": {
                                                      "type": "object",
                                                      "properties": {
                                                        "hookNode": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "step": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "end": {
                                                          "type": "boolean",
                                                          "enum": [
                                                            true
                                                          ]
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "label",
                                                    "description",
                                                    "next"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "else": {
                                                "type": "object",
                                                "properties": {
                                                  "hookNode": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "step": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "end": {
                                                    "type": "boolean",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "mode",
                                              "prompt",
                                              "branches",
                                              "else"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      },
                                      "setVariable": {
                                        "type": "object",
                                        "properties": {
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "value": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "variableId",
                                          "value"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "sendSms": {
                                        "type": "object",
                                        "properties": {
                                          "to": {
                                            "type": "object",
                                            "properties": {
                                              "systemVariable": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "literalString": {
                                                "type": "string"
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "message": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "to",
                                          "message"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "crmLookup": {
                                        "type": "object",
                                        "properties": {
                                          "integrationRef": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchBy": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "enum": [
                                                "phone",
                                                "email"
                                              ]
                                            }
                                          },
                                          "phoneSource": {
                                            "type": "object",
                                            "properties": {
                                              "systemVariable": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "emailSource": {
                                            "type": "object",
                                            "properties": {
                                              "systemVariable": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "fieldMappings": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "field": {
                                                  "type": "string"
                                                },
                                                "variableId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "defaultValue": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "field",
                                                "variableId"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "includePrimaryDeal": {
                                            "type": "boolean"
                                          },
                                          "onNotFound": {
                                            "type": "object",
                                            "properties": {
                                              "hookNode": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "step": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "end": {
                                                "type": "boolean",
                                                "enum": [
                                                  true
                                                ]
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "integrationRef",
                                          "matchBy",
                                          "fieldMappings"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "crmWrite": {
                                        "type": "object",
                                        "properties": {
                                          "integrationRef": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "contactIdSource": {
                                            "type": "object",
                                            "properties": {
                                              "systemVariable": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "createContactIfMissing": {
                                            "type": "boolean"
                                          },
                                          "operations": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "enum": [
                                                "log_call",
                                                "create_note",
                                                "update_contact"
                                              ]
                                            }
                                          },
                                          "logCall": {
                                            "type": "object",
                                            "properties": {
                                              "subjectTemplate": {
                                                "type": "string"
                                              },
                                              "includeTranscript": {
                                                "type": "boolean"
                                              },
                                              "includeSummary": {
                                                "type": "boolean"
                                              },
                                              "includeRecordingUrl": {
                                                "type": "boolean"
                                              }
                                            },
                                            "required": [
                                              "includeTranscript",
                                              "includeSummary",
                                              "includeRecordingUrl"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "createNote": {
                                            "type": "object",
                                            "properties": {
                                              "bodyTemplate": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "bodyTemplate"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "updateContact": {
                                            "type": "object",
                                            "properties": {
                                              "propertyMappings": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "property": {
                                                      "type": "string"
                                                    },
                                                    "propertyLabel": {
                                                      "type": "string"
                                                    },
                                                    "source": {
                                                      "type": "string",
                                                      "enum": [
                                                        "variable",
                                                        "custom",
                                                        "ai"
                                                      ]
                                                    },
                                                    "systemVariable": {
                                                      "type": "string"
                                                    },
                                                    "variableId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "value": {
                                                      "type": "string"
                                                    },
                                                    "aiPrompt": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "property",
                                                    "source"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "required": [
                                              "propertyMappings"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "integrationRef",
                                          "contactIdSource",
                                          "operations"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "id"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "nodes"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "additionalProperties": false
                        },
                        "compliance": {
                          "type": "object",
                          "properties": {
                            "aiDisclosure": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "minLength": 1
                              },
                              "additionalProperties": {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "approved",
                                      "rejected"
                                    ]
                                  },
                                  "checkedText": {
                                    "type": "string"
                                  },
                                  "reason": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "status",
                                  "checkedText"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "additionalProperties": false
                        },
                        "layout": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "minLength": 1
                          },
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "x": {
                                "type": "number"
                              },
                              "y": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "x",
                              "y"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "schemaVersion",
                        "entry",
                        "steps"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "design": {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "simple"
                              ]
                            }
                          },
                          "required": [
                            "kind"
                          ],
                          "additionalProperties": false
                        },
                        "agentSimpleUrl": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "design",
                        "agentSimpleUrl"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "conversation-design"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "schemaVersion": {
                    "type": "string",
                    "enum": [
                      "cd/1"
                    ]
                  },
                  "entry": {
                    "type": "object",
                    "properties": {
                      "stepId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "alternates": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1
                        }
                      }
                    },
                    "required": [
                      "stepId"
                    ],
                    "additionalProperties": false
                  },
                  "steps": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "minLength": 1
                    },
                    "additionalProperties": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "greeting"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "introLine": {
                              "type": "string"
                            },
                            "persona": {
                              "type": "object",
                              "properties": {
                                "whoAmI": {
                                  "type": "string"
                                },
                                "purpose": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            },
                            "on": {
                              "type": "object",
                              "properties": {
                                "next": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "kind",
                            "on"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "talk"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "topic": {
                              "type": "string"
                            },
                            "knowledgeRefs": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "strict": {
                              "type": "boolean"
                            },
                            "on": {
                              "type": "object",
                              "properties": {
                                "done": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "offTopic": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "kind",
                            "topic",
                            "on"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "route"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "ask": {
                              "type": "boolean"
                            },
                            "question": {
                              "type": "string"
                            },
                            "options": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "id"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "on": {
                              "type": "object",
                              "properties": {
                                "default": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "kind",
                            "on"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "collect"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "format": {
                              "type": "string",
                              "enum": [
                                "text",
                                "number",
                                "object"
                              ]
                            },
                            "prompt": {
                              "type": "string"
                            },
                            "variable": {
                              "type": "string",
                              "minLength": 1
                            },
                            "on": {
                              "type": "object",
                              "properties": {
                                "answered": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "fallback": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "kind",
                            "format",
                            "prompt",
                            "on"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "keypad"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "prompt": {
                              "type": "string"
                            },
                            "variable": {
                              "type": "string",
                              "minLength": 1
                            },
                            "timeoutSeconds": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "on": {
                              "type": "object",
                              "properties": {
                                "completed": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "timeout": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "kind",
                            "prompt",
                            "on"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "confirm"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "prompt": {
                              "type": "string"
                            },
                            "on": {
                              "type": "object",
                              "properties": {
                                "yes": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "no": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "kind",
                            "prompt",
                            "on"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "recordingConsent"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "prompt": {
                              "type": "string"
                            },
                            "on": {
                              "type": "object",
                              "properties": {
                                "consent": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "decline": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "kind",
                            "prompt",
                            "on"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "end"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "summarize": {
                              "type": "boolean"
                            },
                            "allowCancel": {
                              "type": "boolean"
                            },
                            "on": {
                              "type": "object",
                              "properties": {
                                "cancel": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "kind",
                            "on"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "transfer"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "target": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "internal",
                                    "phone"
                                  ]
                                },
                                "phoneNumber": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "additionalProperties": false
                            },
                            "timeoutSeconds": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "on": {
                              "type": "object",
                              "properties": {
                                "timeout": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "kind",
                            "target",
                            "on"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "callback"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "schedule": {
                              "type": "string",
                              "enum": [
                                "slots",
                                "asap"
                              ]
                            },
                            "timeFrames": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "day": {
                                    "type": "string",
                                    "enum": [
                                      "monday",
                                      "tuesday",
                                      "wednesday",
                                      "thursday",
                                      "friday",
                                      "saturday",
                                      "sunday"
                                    ]
                                  },
                                  "startTime": {
                                    "type": "string"
                                  },
                                  "endTime": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "day",
                                  "startTime",
                                  "endTime"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "askForName": {
                              "type": "boolean"
                            },
                            "integrationRef": {
                              "type": "string",
                              "minLength": 1
                            },
                            "on": {
                              "type": "object",
                              "properties": {
                                "success": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "failure": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "kind",
                            "on"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "knowledge": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "knowledgeBase"
                              ]
                            },
                            "knowledgeBaseId": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "id",
                            "kind",
                            "knowledgeBaseId"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "text"
                              ]
                            },
                            "text": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "kind",
                            "text"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "variables": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1
                        },
                        "name": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "text",
                            "number",
                            "object"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "integrations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "crm",
                            "calendar",
                            "knowledge"
                          ]
                        },
                        "integrationId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "id",
                        "kind",
                        "integrationId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "hooks": {
                    "type": "object",
                    "properties": {
                      "before": {
                        "type": "object",
                        "properties": {
                          "rootNodeId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "entryPoints": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "minLength": 1
                            },
                            "additionalProperties": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "nodes": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "minLength": 1
                            },
                            "additionalProperties": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "name": {
                                  "type": "string"
                                },
                                "next": {
                                  "type": "object",
                                  "properties": {
                                    "hookNode": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "step": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "end": {
                                      "type": "boolean",
                                      "enum": [
                                        true
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "webhook": {
                                  "type": "object",
                                  "properties": {
                                    "url": {
                                      "type": "string"
                                    },
                                    "headers": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "secretHint": {
                                      "type": "string"
                                    },
                                    "signatureHeader": {
                                      "type": "string"
                                    },
                                    "payload": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "key": {
                                            "type": "string"
                                          },
                                          "source": {
                                            "type": "string",
                                            "enum": [
                                              "variable",
                                              "custom",
                                              "ai"
                                            ]
                                          },
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "value": {
                                            "type": "string"
                                          },
                                          "aiPrompt": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "key",
                                          "source"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "timeoutSeconds": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "responseVariableId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "responsePath": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "url",
                                    "payload"
                                  ],
                                  "additionalProperties": false
                                },
                                "fetch": {
                                  "type": "object",
                                  "properties": {
                                    "url": {
                                      "type": "string"
                                    },
                                    "method": {
                                      "type": "string",
                                      "enum": [
                                        "GET",
                                        "POST"
                                      ]
                                    },
                                    "query": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "headers": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "body": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "key": {
                                            "type": "string"
                                          },
                                          "source": {
                                            "type": "string",
                                            "enum": [
                                              "variable",
                                              "custom",
                                              "ai"
                                            ]
                                          },
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "value": {
                                            "type": "string"
                                          },
                                          "aiPrompt": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "key",
                                          "source"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "responseFormat": {
                                      "type": "string",
                                      "enum": [
                                        "json",
                                        "text"
                                      ]
                                    },
                                    "responseMappings": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "path": {
                                            "type": "string"
                                          },
                                          "transform": {
                                            "type": "string",
                                            "enum": [
                                              "auto",
                                              "text",
                                              "number",
                                              "boolean",
                                              "json"
                                            ]
                                          },
                                          "defaultValue": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "variableId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "url",
                                    "method",
                                    "responseMappings"
                                  ],
                                  "additionalProperties": false
                                },
                                "condition": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "mode": {
                                          "type": "string",
                                          "enum": [
                                            "logic"
                                          ]
                                        },
                                        "branches": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "label": {
                                                "type": "string"
                                              },
                                              "predicate": {
                                                "type": "object",
                                                "properties": {
                                                  "variable": {
                                                    "type": "object",
                                                    "properties": {
                                                      "systemVariable": {
                                                        "type": "string"
                                                      },
                                                      "variableId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  },
                                                  "operator": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "neq",
                                                      "exists",
                                                      "not_exists",
                                                      "gt",
                                                      "lt",
                                                      "contains"
                                                    ]
                                                  },
                                                  "value": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "variable",
                                                  "operator"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "next": {
                                                "type": "object",
                                                "properties": {
                                                  "hookNode": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "step": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "end": {
                                                    "type": "boolean",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "label",
                                              "predicate",
                                              "next"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "else": {
                                          "type": "object",
                                          "properties": {
                                            "hookNode": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "step": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "end": {
                                              "type": "boolean",
                                              "enum": [
                                                true
                                              ]
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "mode",
                                        "branches",
                                        "else"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "mode": {
                                          "type": "string",
                                          "enum": [
                                            "ai"
                                          ]
                                        },
                                        "prompt": {
                                          "type": "string"
                                        },
                                        "branches": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "label": {
                                                "type": "string"
                                              },
                                              "description": {
                                                "type": "string"
                                              },
                                              "next": {
                                                "type": "object",
                                                "properties": {
                                                  "hookNode": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "step": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "end": {
                                                    "type": "boolean",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "label",
                                              "description",
                                              "next"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "else": {
                                          "type": "object",
                                          "properties": {
                                            "hookNode": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "step": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "end": {
                                              "type": "boolean",
                                              "enum": [
                                                true
                                              ]
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "mode",
                                        "prompt",
                                        "branches",
                                        "else"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                "setVariable": {
                                  "type": "object",
                                  "properties": {
                                    "variableId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "value": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "variableId",
                                    "value"
                                  ],
                                  "additionalProperties": false
                                },
                                "sendSms": {
                                  "type": "object",
                                  "properties": {
                                    "to": {
                                      "type": "object",
                                      "properties": {
                                        "systemVariable": {
                                          "type": "string"
                                        },
                                        "variableId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "literalString": {
                                          "type": "string"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "message": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "to",
                                    "message"
                                  ],
                                  "additionalProperties": false
                                },
                                "crmLookup": {
                                  "type": "object",
                                  "properties": {
                                    "integrationRef": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "matchBy": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "phone",
                                          "email"
                                        ]
                                      }
                                    },
                                    "phoneSource": {
                                      "type": "object",
                                      "properties": {
                                        "systemVariable": {
                                          "type": "string"
                                        },
                                        "variableId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "emailSource": {
                                      "type": "object",
                                      "properties": {
                                        "systemVariable": {
                                          "type": "string"
                                        },
                                        "variableId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "fieldMappings": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "field": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "defaultValue": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "field",
                                          "variableId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "includePrimaryDeal": {
                                      "type": "boolean"
                                    },
                                    "onNotFound": {
                                      "type": "object",
                                      "properties": {
                                        "hookNode": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "step": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "end": {
                                          "type": "boolean",
                                          "enum": [
                                            true
                                          ]
                                        }
                                      },
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "integrationRef",
                                    "matchBy",
                                    "fieldMappings"
                                  ],
                                  "additionalProperties": false
                                },
                                "crmWrite": {
                                  "type": "object",
                                  "properties": {
                                    "integrationRef": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "contactIdSource": {
                                      "type": "object",
                                      "properties": {
                                        "systemVariable": {
                                          "type": "string"
                                        },
                                        "variableId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "createContactIfMissing": {
                                      "type": "boolean"
                                    },
                                    "operations": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "log_call",
                                          "create_note",
                                          "update_contact"
                                        ]
                                      }
                                    },
                                    "logCall": {
                                      "type": "object",
                                      "properties": {
                                        "subjectTemplate": {
                                          "type": "string"
                                        },
                                        "includeTranscript": {
                                          "type": "boolean"
                                        },
                                        "includeSummary": {
                                          "type": "boolean"
                                        },
                                        "includeRecordingUrl": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "includeTranscript",
                                        "includeSummary",
                                        "includeRecordingUrl"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "createNote": {
                                      "type": "object",
                                      "properties": {
                                        "bodyTemplate": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "bodyTemplate"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "updateContact": {
                                      "type": "object",
                                      "properties": {
                                        "propertyMappings": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "property": {
                                                "type": "string"
                                              },
                                              "propertyLabel": {
                                                "type": "string"
                                              },
                                              "source": {
                                                "type": "string",
                                                "enum": [
                                                  "variable",
                                                  "custom",
                                                  "ai"
                                                ]
                                              },
                                              "systemVariable": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "value": {
                                                "type": "string"
                                              },
                                              "aiPrompt": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "property",
                                              "source"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "propertyMappings"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "integrationRef",
                                    "contactIdSource",
                                    "operations"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "nodes"
                        ],
                        "additionalProperties": false
                      },
                      "after": {
                        "type": "object",
                        "properties": {
                          "entryPoints": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "minLength": 1
                            },
                            "additionalProperties": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "prematureHangupNodeId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "nodes": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "minLength": 1
                            },
                            "additionalProperties": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "name": {
                                  "type": "string"
                                },
                                "next": {
                                  "type": "object",
                                  "properties": {
                                    "hookNode": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "step": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "end": {
                                      "type": "boolean",
                                      "enum": [
                                        true
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "webhook": {
                                  "type": "object",
                                  "properties": {
                                    "url": {
                                      "type": "string"
                                    },
                                    "headers": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "secretHint": {
                                      "type": "string"
                                    },
                                    "signatureHeader": {
                                      "type": "string"
                                    },
                                    "payload": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "key": {
                                            "type": "string"
                                          },
                                          "source": {
                                            "type": "string",
                                            "enum": [
                                              "variable",
                                              "custom",
                                              "ai"
                                            ]
                                          },
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "value": {
                                            "type": "string"
                                          },
                                          "aiPrompt": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "key",
                                          "source"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "timeoutSeconds": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "responseVariableId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "responsePath": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "url",
                                    "payload"
                                  ],
                                  "additionalProperties": false
                                },
                                "fetch": {
                                  "type": "object",
                                  "properties": {
                                    "url": {
                                      "type": "string"
                                    },
                                    "method": {
                                      "type": "string",
                                      "enum": [
                                        "GET",
                                        "POST"
                                      ]
                                    },
                                    "query": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "headers": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "body": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "key": {
                                            "type": "string"
                                          },
                                          "source": {
                                            "type": "string",
                                            "enum": [
                                              "variable",
                                              "custom",
                                              "ai"
                                            ]
                                          },
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "value": {
                                            "type": "string"
                                          },
                                          "aiPrompt": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "key",
                                          "source"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "responseFormat": {
                                      "type": "string",
                                      "enum": [
                                        "json",
                                        "text"
                                      ]
                                    },
                                    "responseMappings": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "path": {
                                            "type": "string"
                                          },
                                          "transform": {
                                            "type": "string",
                                            "enum": [
                                              "auto",
                                              "text",
                                              "number",
                                              "boolean",
                                              "json"
                                            ]
                                          },
                                          "defaultValue": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "variableId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "url",
                                    "method",
                                    "responseMappings"
                                  ],
                                  "additionalProperties": false
                                },
                                "condition": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "mode": {
                                          "type": "string",
                                          "enum": [
                                            "logic"
                                          ]
                                        },
                                        "branches": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "label": {
                                                "type": "string"
                                              },
                                              "predicate": {
                                                "type": "object",
                                                "properties": {
                                                  "variable": {
                                                    "type": "object",
                                                    "properties": {
                                                      "systemVariable": {
                                                        "type": "string"
                                                      },
                                                      "variableId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  },
                                                  "operator": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "neq",
                                                      "exists",
                                                      "not_exists",
                                                      "gt",
                                                      "lt",
                                                      "contains"
                                                    ]
                                                  },
                                                  "value": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "variable",
                                                  "operator"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "next": {
                                                "type": "object",
                                                "properties": {
                                                  "hookNode": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "step": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "end": {
                                                    "type": "boolean",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "label",
                                              "predicate",
                                              "next"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "else": {
                                          "type": "object",
                                          "properties": {
                                            "hookNode": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "step": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "end": {
                                              "type": "boolean",
                                              "enum": [
                                                true
                                              ]
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "mode",
                                        "branches",
                                        "else"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "mode": {
                                          "type": "string",
                                          "enum": [
                                            "ai"
                                          ]
                                        },
                                        "prompt": {
                                          "type": "string"
                                        },
                                        "branches": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "label": {
                                                "type": "string"
                                              },
                                              "description": {
                                                "type": "string"
                                              },
                                              "next": {
                                                "type": "object",
                                                "properties": {
                                                  "hookNode": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "step": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "end": {
                                                    "type": "boolean",
                                                    "enum": [
                                                      true
                                                    ]
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "label",
                                              "description",
                                              "next"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "else": {
                                          "type": "object",
                                          "properties": {
                                            "hookNode": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "step": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "end": {
                                              "type": "boolean",
                                              "enum": [
                                                true
                                              ]
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "mode",
                                        "prompt",
                                        "branches",
                                        "else"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                "setVariable": {
                                  "type": "object",
                                  "properties": {
                                    "variableId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "value": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "variableId",
                                    "value"
                                  ],
                                  "additionalProperties": false
                                },
                                "sendSms": {
                                  "type": "object",
                                  "properties": {
                                    "to": {
                                      "type": "object",
                                      "properties": {
                                        "systemVariable": {
                                          "type": "string"
                                        },
                                        "variableId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "literalString": {
                                          "type": "string"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "message": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "to",
                                    "message"
                                  ],
                                  "additionalProperties": false
                                },
                                "crmLookup": {
                                  "type": "object",
                                  "properties": {
                                    "integrationRef": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "matchBy": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "phone",
                                          "email"
                                        ]
                                      }
                                    },
                                    "phoneSource": {
                                      "type": "object",
                                      "properties": {
                                        "systemVariable": {
                                          "type": "string"
                                        },
                                        "variableId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "emailSource": {
                                      "type": "object",
                                      "properties": {
                                        "systemVariable": {
                                          "type": "string"
                                        },
                                        "variableId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "fieldMappings": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "field": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "defaultValue": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "field",
                                          "variableId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "includePrimaryDeal": {
                                      "type": "boolean"
                                    },
                                    "onNotFound": {
                                      "type": "object",
                                      "properties": {
                                        "hookNode": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "step": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "end": {
                                          "type": "boolean",
                                          "enum": [
                                            true
                                          ]
                                        }
                                      },
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "integrationRef",
                                    "matchBy",
                                    "fieldMappings"
                                  ],
                                  "additionalProperties": false
                                },
                                "crmWrite": {
                                  "type": "object",
                                  "properties": {
                                    "integrationRef": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "contactIdSource": {
                                      "type": "object",
                                      "properties": {
                                        "systemVariable": {
                                          "type": "string"
                                        },
                                        "variableId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "createContactIfMissing": {
                                      "type": "boolean"
                                    },
                                    "operations": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "log_call",
                                          "create_note",
                                          "update_contact"
                                        ]
                                      }
                                    },
                                    "logCall": {
                                      "type": "object",
                                      "properties": {
                                        "subjectTemplate": {
                                          "type": "string"
                                        },
                                        "includeTranscript": {
                                          "type": "boolean"
                                        },
                                        "includeSummary": {
                                          "type": "boolean"
                                        },
                                        "includeRecordingUrl": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "includeTranscript",
                                        "includeSummary",
                                        "includeRecordingUrl"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "createNote": {
                                      "type": "object",
                                      "properties": {
                                        "bodyTemplate": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "bodyTemplate"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "updateContact": {
                                      "type": "object",
                                      "properties": {
                                        "propertyMappings": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "property": {
                                                "type": "string"
                                              },
                                              "propertyLabel": {
                                                "type": "string"
                                              },
                                              "source": {
                                                "type": "string",
                                                "enum": [
                                                  "variable",
                                                  "custom",
                                                  "ai"
                                                ]
                                              },
                                              "systemVariable": {
                                                "type": "string"
                                              },
                                              "variableId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "value": {
                                                "type": "string"
                                              },
                                              "aiPrompt": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "property",
                                              "source"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "propertyMappings"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "integrationRef",
                                    "contactIdSource",
                                    "operations"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "nodes"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  },
                  "compliance": {
                    "type": "object",
                    "properties": {
                      "aiDisclosure": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "minLength": 1
                        },
                        "additionalProperties": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "enum": [
                                "approved",
                                "rejected"
                              ]
                            },
                            "checkedText": {
                              "type": "string"
                            },
                            "reason": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "status",
                            "checkedText"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "additionalProperties": false
                  },
                  "layout": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "minLength": 1
                    },
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "x": {
                          "type": "number"
                        },
                        "y": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "x",
                        "y"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "schemaVersion",
                  "entry",
                  "steps"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schemaVersion": {
                      "type": "string",
                      "enum": [
                        "cd/1"
                      ]
                    },
                    "entry": {
                      "type": "object",
                      "properties": {
                        "stepId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "alternates": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          }
                        }
                      },
                      "required": [
                        "stepId"
                      ],
                      "additionalProperties": false
                    },
                    "steps": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "minLength": 1
                      },
                      "additionalProperties": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "greeting"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "introLine": {
                                "type": "string"
                              },
                              "persona": {
                                "type": "object",
                                "properties": {
                                  "whoAmI": {
                                    "type": "string"
                                  },
                                  "purpose": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "next": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "talk"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "topic": {
                                "type": "string"
                              },
                              "knowledgeRefs": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "strict": {
                                "type": "boolean"
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "done": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "offTopic": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "topic",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "route"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "ask": {
                                "type": "boolean"
                              },
                              "question": {
                                "type": "string"
                              },
                              "options": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "description": {
                                      "type": "string"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "id"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "default": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "collect"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "format": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "number",
                                  "object"
                                ]
                              },
                              "prompt": {
                                "type": "string"
                              },
                              "variable": {
                                "type": "string",
                                "minLength": 1
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "answered": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "fallback": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "format",
                              "prompt",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "keypad"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "prompt": {
                                "type": "string"
                              },
                              "variable": {
                                "type": "string",
                                "minLength": 1
                              },
                              "timeoutSeconds": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "completed": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "timeout": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "prompt",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "confirm"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "prompt": {
                                "type": "string"
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "yes": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "no": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "prompt",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "recordingConsent"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "prompt": {
                                "type": "string"
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "consent": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "decline": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "prompt",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "end"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "summarize": {
                                "type": "boolean"
                              },
                              "allowCancel": {
                                "type": "boolean"
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "cancel": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "transfer"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "target": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "internal",
                                      "phone"
                                    ]
                                  },
                                  "phoneNumber": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              "timeoutSeconds": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "timeout": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "target",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "callback"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "schedule": {
                                "type": "string",
                                "enum": [
                                  "slots",
                                  "asap"
                                ]
                              },
                              "timeFrames": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "day": {
                                      "type": "string",
                                      "enum": [
                                        "monday",
                                        "tuesday",
                                        "wednesday",
                                        "thursday",
                                        "friday",
                                        "saturday",
                                        "sunday"
                                      ]
                                    },
                                    "startTime": {
                                      "type": "string"
                                    },
                                    "endTime": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "day",
                                    "startTime",
                                    "endTime"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "askForName": {
                                "type": "boolean"
                              },
                              "integrationRef": {
                                "type": "string",
                                "minLength": 1
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "success": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "failure": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "on"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "knowledge": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "knowledgeBase"
                                ]
                              },
                              "knowledgeBaseId": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "knowledgeBaseId"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "text"
                                ]
                              },
                              "text": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "text"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "text",
                              "number",
                              "object"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "integrations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "crm",
                              "calendar",
                              "knowledge"
                            ]
                          },
                          "integrationId": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "integrationId"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "hooks": {
                      "type": "object",
                      "properties": {
                        "before": {
                          "type": "object",
                          "properties": {
                            "rootNodeId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "entryPoints": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "minLength": 1
                              },
                              "additionalProperties": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "nodes": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "minLength": 1
                              },
                              "additionalProperties": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "next": {
                                    "type": "object",
                                    "properties": {
                                      "hookNode": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "step": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "end": {
                                        "type": "boolean",
                                        "enum": [
                                          true
                                        ]
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "webhook": {
                                    "type": "object",
                                    "properties": {
                                      "url": {
                                        "type": "string"
                                      },
                                      "headers": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "secretHint": {
                                        "type": "string"
                                      },
                                      "signatureHeader": {
                                        "type": "string"
                                      },
                                      "payload": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "key": {
                                              "type": "string"
                                            },
                                            "source": {
                                              "type": "string",
                                              "enum": [
                                                "variable",
                                                "custom",
                                                "ai"
                                              ]
                                            },
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "value": {
                                              "type": "string"
                                            },
                                            "aiPrompt": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "key",
                                            "source"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "timeoutSeconds": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "responseVariableId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "responsePath": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "url",
                                      "payload"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "fetch": {
                                    "type": "object",
                                    "properties": {
                                      "url": {
                                        "type": "string"
                                      },
                                      "method": {
                                        "type": "string",
                                        "enum": [
                                          "GET",
                                          "POST"
                                        ]
                                      },
                                      "query": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "headers": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "body": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "key": {
                                              "type": "string"
                                            },
                                            "source": {
                                              "type": "string",
                                              "enum": [
                                                "variable",
                                                "custom",
                                                "ai"
                                              ]
                                            },
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "value": {
                                              "type": "string"
                                            },
                                            "aiPrompt": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "key",
                                            "source"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "responseFormat": {
                                        "type": "string",
                                        "enum": [
                                          "json",
                                          "text"
                                        ]
                                      },
                                      "responseMappings": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "path": {
                                              "type": "string"
                                            },
                                            "transform": {
                                              "type": "string",
                                              "enum": [
                                                "auto",
                                                "text",
                                                "number",
                                                "boolean",
                                                "json"
                                              ]
                                            },
                                            "defaultValue": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "variableId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "url",
                                      "method",
                                      "responseMappings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "condition": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "mode": {
                                            "type": "string",
                                            "enum": [
                                              "logic"
                                            ]
                                          },
                                          "branches": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "label": {
                                                  "type": "string"
                                                },
                                                "predicate": {
                                                  "type": "object",
                                                  "properties": {
                                                    "variable": {
                                                      "type": "object",
                                                      "properties": {
                                                        "systemVariable": {
                                                          "type": "string"
                                                        },
                                                        "variableId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "operator": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "exists",
                                                        "not_exists",
                                                        "gt",
                                                        "lt",
                                                        "contains"
                                                      ]
                                                    },
                                                    "value": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "variable",
                                                    "operator"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "next": {
                                                  "type": "object",
                                                  "properties": {
                                                    "hookNode": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "step": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "end": {
                                                      "type": "boolean",
                                                      "enum": [
                                                        true
                                                      ]
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "label",
                                                "predicate",
                                                "next"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "else": {
                                            "type": "object",
                                            "properties": {
                                              "hookNode": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "step": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "end": {
                                                "type": "boolean",
                                                "enum": [
                                                  true
                                                ]
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "mode",
                                          "branches",
                                          "else"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "mode": {
                                            "type": "string",
                                            "enum": [
                                              "ai"
                                            ]
                                          },
                                          "prompt": {
                                            "type": "string"
                                          },
                                          "branches": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "label": {
                                                  "type": "string"
                                                },
                                                "description": {
                                                  "type": "string"
                                                },
                                                "next": {
                                                  "type": "object",
                                                  "properties": {
                                                    "hookNode": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "step": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "end": {
                                                      "type": "boolean",
                                                      "enum": [
                                                        true
                                                      ]
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "label",
                                                "description",
                                                "next"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "else": {
                                            "type": "object",
                                            "properties": {
                                              "hookNode": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "step": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "end": {
                                                "type": "boolean",
                                                "enum": [
                                                  true
                                                ]
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "mode",
                                          "prompt",
                                          "branches",
                                          "else"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "setVariable": {
                                    "type": "object",
                                    "properties": {
                                      "variableId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "value": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "variableId",
                                      "value"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "sendSms": {
                                    "type": "object",
                                    "properties": {
                                      "to": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "literalString": {
                                            "type": "string"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "message": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "to",
                                      "message"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "crmLookup": {
                                    "type": "object",
                                    "properties": {
                                      "integrationRef": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "matchBy": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "enum": [
                                            "phone",
                                            "email"
                                          ]
                                        }
                                      },
                                      "phoneSource": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "emailSource": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "fieldMappings": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "field": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "defaultValue": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "field",
                                            "variableId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "includePrimaryDeal": {
                                        "type": "boolean"
                                      },
                                      "onNotFound": {
                                        "type": "object",
                                        "properties": {
                                          "hookNode": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "step": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "end": {
                                            "type": "boolean",
                                            "enum": [
                                              true
                                            ]
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "integrationRef",
                                      "matchBy",
                                      "fieldMappings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "crmWrite": {
                                    "type": "object",
                                    "properties": {
                                      "integrationRef": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "contactIdSource": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "createContactIfMissing": {
                                        "type": "boolean"
                                      },
                                      "operations": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "enum": [
                                            "log_call",
                                            "create_note",
                                            "update_contact"
                                          ]
                                        }
                                      },
                                      "logCall": {
                                        "type": "object",
                                        "properties": {
                                          "subjectTemplate": {
                                            "type": "string"
                                          },
                                          "includeTranscript": {
                                            "type": "boolean"
                                          },
                                          "includeSummary": {
                                            "type": "boolean"
                                          },
                                          "includeRecordingUrl": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "includeTranscript",
                                          "includeSummary",
                                          "includeRecordingUrl"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "createNote": {
                                        "type": "object",
                                        "properties": {
                                          "bodyTemplate": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "bodyTemplate"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "updateContact": {
                                        "type": "object",
                                        "properties": {
                                          "propertyMappings": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "property": {
                                                  "type": "string"
                                                },
                                                "propertyLabel": {
                                                  "type": "string"
                                                },
                                                "source": {
                                                  "type": "string",
                                                  "enum": [
                                                    "variable",
                                                    "custom",
                                                    "ai"
                                                  ]
                                                },
                                                "systemVariable": {
                                                  "type": "string"
                                                },
                                                "variableId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "value": {
                                                  "type": "string"
                                                },
                                                "aiPrompt": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "property",
                                                "source"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "propertyMappings"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "integrationRef",
                                      "contactIdSource",
                                      "operations"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "id"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "nodes"
                          ],
                          "additionalProperties": false
                        },
                        "after": {
                          "type": "object",
                          "properties": {
                            "entryPoints": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "minLength": 1
                              },
                              "additionalProperties": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "prematureHangupNodeId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "nodes": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "minLength": 1
                              },
                              "additionalProperties": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "next": {
                                    "type": "object",
                                    "properties": {
                                      "hookNode": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "step": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "end": {
                                        "type": "boolean",
                                        "enum": [
                                          true
                                        ]
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "webhook": {
                                    "type": "object",
                                    "properties": {
                                      "url": {
                                        "type": "string"
                                      },
                                      "headers": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "secretHint": {
                                        "type": "string"
                                      },
                                      "signatureHeader": {
                                        "type": "string"
                                      },
                                      "payload": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "key": {
                                              "type": "string"
                                            },
                                            "source": {
                                              "type": "string",
                                              "enum": [
                                                "variable",
                                                "custom",
                                                "ai"
                                              ]
                                            },
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "value": {
                                              "type": "string"
                                            },
                                            "aiPrompt": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "key",
                                            "source"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "timeoutSeconds": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "responseVariableId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "responsePath": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "url",
                                      "payload"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "fetch": {
                                    "type": "object",
                                    "properties": {
                                      "url": {
                                        "type": "string"
                                      },
                                      "method": {
                                        "type": "string",
                                        "enum": [
                                          "GET",
                                          "POST"
                                        ]
                                      },
                                      "query": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "headers": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "body": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "key": {
                                              "type": "string"
                                            },
                                            "source": {
                                              "type": "string",
                                              "enum": [
                                                "variable",
                                                "custom",
                                                "ai"
                                              ]
                                            },
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "value": {
                                              "type": "string"
                                            },
                                            "aiPrompt": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "key",
                                            "source"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "responseFormat": {
                                        "type": "string",
                                        "enum": [
                                          "json",
                                          "text"
                                        ]
                                      },
                                      "responseMappings": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "path": {
                                              "type": "string"
                                            },
                                            "transform": {
                                              "type": "string",
                                              "enum": [
                                                "auto",
                                                "text",
                                                "number",
                                                "boolean",
                                                "json"
                                              ]
                                            },
                                            "defaultValue": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "variableId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "url",
                                      "method",
                                      "responseMappings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "condition": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "mode": {
                                            "type": "string",
                                            "enum": [
                                              "logic"
                                            ]
                                          },
                                          "branches": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "label": {
                                                  "type": "string"
                                                },
                                                "predicate": {
                                                  "type": "object",
                                                  "properties": {
                                                    "variable": {
                                                      "type": "object",
                                                      "properties": {
                                                        "systemVariable": {
                                                          "type": "string"
                                                        },
                                                        "variableId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "operator": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "exists",
                                                        "not_exists",
                                                        "gt",
                                                        "lt",
                                                        "contains"
                                                      ]
                                                    },
                                                    "value": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "variable",
                                                    "operator"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "next": {
                                                  "type": "object",
                                                  "properties": {
                                                    "hookNode": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "step": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "end": {
                                                      "type": "boolean",
                                                      "enum": [
                                                        true
                                                      ]
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "label",
                                                "predicate",
                                                "next"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "else": {
                                            "type": "object",
                                            "properties": {
                                              "hookNode": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "step": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "end": {
                                                "type": "boolean",
                                                "enum": [
                                                  true
                                                ]
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "mode",
                                          "branches",
                                          "else"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "mode": {
                                            "type": "string",
                                            "enum": [
                                              "ai"
                                            ]
                                          },
                                          "prompt": {
                                            "type": "string"
                                          },
                                          "branches": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "label": {
                                                  "type": "string"
                                                },
                                                "description": {
                                                  "type": "string"
                                                },
                                                "next": {
                                                  "type": "object",
                                                  "properties": {
                                                    "hookNode": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "step": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "end": {
                                                      "type": "boolean",
                                                      "enum": [
                                                        true
                                                      ]
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "label",
                                                "description",
                                                "next"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "else": {
                                            "type": "object",
                                            "properties": {
                                              "hookNode": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "step": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "end": {
                                                "type": "boolean",
                                                "enum": [
                                                  true
                                                ]
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "mode",
                                          "prompt",
                                          "branches",
                                          "else"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "setVariable": {
                                    "type": "object",
                                    "properties": {
                                      "variableId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "value": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "variableId",
                                      "value"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "sendSms": {
                                    "type": "object",
                                    "properties": {
                                      "to": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "literalString": {
                                            "type": "string"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "message": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "to",
                                      "message"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "crmLookup": {
                                    "type": "object",
                                    "properties": {
                                      "integrationRef": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "matchBy": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "enum": [
                                            "phone",
                                            "email"
                                          ]
                                        }
                                      },
                                      "phoneSource": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "emailSource": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "fieldMappings": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "field": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "defaultValue": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "field",
                                            "variableId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "includePrimaryDeal": {
                                        "type": "boolean"
                                      },
                                      "onNotFound": {
                                        "type": "object",
                                        "properties": {
                                          "hookNode": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "step": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "end": {
                                            "type": "boolean",
                                            "enum": [
                                              true
                                            ]
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "integrationRef",
                                      "matchBy",
                                      "fieldMappings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "crmWrite": {
                                    "type": "object",
                                    "properties": {
                                      "integrationRef": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "contactIdSource": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "createContactIfMissing": {
                                        "type": "boolean"
                                      },
                                      "operations": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "enum": [
                                            "log_call",
                                            "create_note",
                                            "update_contact"
                                          ]
                                        }
                                      },
                                      "logCall": {
                                        "type": "object",
                                        "properties": {
                                          "subjectTemplate": {
                                            "type": "string"
                                          },
                                          "includeTranscript": {
                                            "type": "boolean"
                                          },
                                          "includeSummary": {
                                            "type": "boolean"
                                          },
                                          "includeRecordingUrl": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "includeTranscript",
                                          "includeSummary",
                                          "includeRecordingUrl"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "createNote": {
                                        "type": "object",
                                        "properties": {
                                          "bodyTemplate": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "bodyTemplate"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "updateContact": {
                                        "type": "object",
                                        "properties": {
                                          "propertyMappings": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "property": {
                                                  "type": "string"
                                                },
                                                "propertyLabel": {
                                                  "type": "string"
                                                },
                                                "source": {
                                                  "type": "string",
                                                  "enum": [
                                                    "variable",
                                                    "custom",
                                                    "ai"
                                                  ]
                                                },
                                                "systemVariable": {
                                                  "type": "string"
                                                },
                                                "variableId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "value": {
                                                  "type": "string"
                                                },
                                                "aiPrompt": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "property",
                                                "source"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "propertyMappings"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "integrationRef",
                                      "contactIdSource",
                                      "operations"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "id"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "nodes"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "compliance": {
                      "type": "object",
                      "properties": {
                        "aiDisclosure": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "minLength": 1
                          },
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "enum": [
                                  "approved",
                                  "rejected"
                                ]
                              },
                              "checkedText": {
                                "type": "string"
                              },
                              "reason": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "status",
                              "checkedText"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    "layout": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "minLength": 1
                      },
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "x": {
                            "type": "number"
                          },
                          "y": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "x",
                          "y"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "schemaVersion",
                    "entry",
                    "steps"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/conversations/{id}/versions": {
      "get": {
        "tags": [
          "conversation-design"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "versions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "n": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "tag": {
                            "type": "string"
                          },
                          "isActive": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "n",
                          "tag",
                          "isActive",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "versions"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/conversations/{id}/versions/{n}/design": {
      "get": {
        "tags": [
          "conversation-design"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "id",
            "required": true
          },
          {
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            "in": "path",
            "name": "n",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schemaVersion": {
                      "type": "string",
                      "enum": [
                        "cd/1"
                      ]
                    },
                    "entry": {
                      "type": "object",
                      "properties": {
                        "stepId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "alternates": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          }
                        }
                      },
                      "required": [
                        "stepId"
                      ],
                      "additionalProperties": false
                    },
                    "steps": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "minLength": 1
                      },
                      "additionalProperties": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "greeting"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "introLine": {
                                "type": "string"
                              },
                              "persona": {
                                "type": "object",
                                "properties": {
                                  "whoAmI": {
                                    "type": "string"
                                  },
                                  "purpose": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "next": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "talk"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "topic": {
                                "type": "string"
                              },
                              "knowledgeRefs": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "strict": {
                                "type": "boolean"
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "done": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "offTopic": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "topic",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "route"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "ask": {
                                "type": "boolean"
                              },
                              "question": {
                                "type": "string"
                              },
                              "options": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "description": {
                                      "type": "string"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "id"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "default": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "collect"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "format": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "number",
                                  "object"
                                ]
                              },
                              "prompt": {
                                "type": "string"
                              },
                              "variable": {
                                "type": "string",
                                "minLength": 1
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "answered": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "fallback": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "format",
                              "prompt",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "keypad"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "prompt": {
                                "type": "string"
                              },
                              "variable": {
                                "type": "string",
                                "minLength": 1
                              },
                              "timeoutSeconds": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "completed": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "timeout": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "prompt",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "confirm"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "prompt": {
                                "type": "string"
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "yes": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "no": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "prompt",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "recordingConsent"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "prompt": {
                                "type": "string"
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "consent": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "decline": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "prompt",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "end"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "summarize": {
                                "type": "boolean"
                              },
                              "allowCancel": {
                                "type": "boolean"
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "cancel": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "transfer"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "target": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "internal",
                                      "phone"
                                    ]
                                  },
                                  "phoneNumber": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              "timeoutSeconds": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "timeout": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "target",
                              "on"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "callback"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "schedule": {
                                "type": "string",
                                "enum": [
                                  "slots",
                                  "asap"
                                ]
                              },
                              "timeFrames": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "day": {
                                      "type": "string",
                                      "enum": [
                                        "monday",
                                        "tuesday",
                                        "wednesday",
                                        "thursday",
                                        "friday",
                                        "saturday",
                                        "sunday"
                                      ]
                                    },
                                    "startTime": {
                                      "type": "string"
                                    },
                                    "endTime": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "day",
                                    "startTime",
                                    "endTime"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "askForName": {
                                "type": "boolean"
                              },
                              "integrationRef": {
                                "type": "string",
                                "minLength": 1
                              },
                              "on": {
                                "type": "object",
                                "properties": {
                                  "success": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "failure": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "on"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "knowledge": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "knowledgeBase"
                                ]
                              },
                              "knowledgeBaseId": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "knowledgeBaseId"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "text"
                                ]
                              },
                              "text": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "text"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "text",
                              "number",
                              "object"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "integrations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "crm",
                              "calendar",
                              "knowledge"
                            ]
                          },
                          "integrationId": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "integrationId"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "hooks": {
                      "type": "object",
                      "properties": {
                        "before": {
                          "type": "object",
                          "properties": {
                            "rootNodeId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "entryPoints": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "minLength": 1
                              },
                              "additionalProperties": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "nodes": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "minLength": 1
                              },
                              "additionalProperties": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "next": {
                                    "type": "object",
                                    "properties": {
                                      "hookNode": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "step": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "end": {
                                        "type": "boolean",
                                        "enum": [
                                          true
                                        ]
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "webhook": {
                                    "type": "object",
                                    "properties": {
                                      "url": {
                                        "type": "string"
                                      },
                                      "headers": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "secretHint": {
                                        "type": "string"
                                      },
                                      "signatureHeader": {
                                        "type": "string"
                                      },
                                      "payload": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "key": {
                                              "type": "string"
                                            },
                                            "source": {
                                              "type": "string",
                                              "enum": [
                                                "variable",
                                                "custom",
                                                "ai"
                                              ]
                                            },
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "value": {
                                              "type": "string"
                                            },
                                            "aiPrompt": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "key",
                                            "source"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "timeoutSeconds": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "responseVariableId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "responsePath": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "url",
                                      "payload"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "fetch": {
                                    "type": "object",
                                    "properties": {
                                      "url": {
                                        "type": "string"
                                      },
                                      "method": {
                                        "type": "string",
                                        "enum": [
                                          "GET",
                                          "POST"
                                        ]
                                      },
                                      "query": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "headers": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "body": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "key": {
                                              "type": "string"
                                            },
                                            "source": {
                                              "type": "string",
                                              "enum": [
                                                "variable",
                                                "custom",
                                                "ai"
                                              ]
                                            },
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "value": {
                                              "type": "string"
                                            },
                                            "aiPrompt": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "key",
                                            "source"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "responseFormat": {
                                        "type": "string",
                                        "enum": [
                                          "json",
                                          "text"
                                        ]
                                      },
                                      "responseMappings": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "path": {
                                              "type": "string"
                                            },
                                            "transform": {
                                              "type": "string",
                                              "enum": [
                                                "auto",
                                                "text",
                                                "number",
                                                "boolean",
                                                "json"
                                              ]
                                            },
                                            "defaultValue": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "variableId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "url",
                                      "method",
                                      "responseMappings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "condition": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "mode": {
                                            "type": "string",
                                            "enum": [
                                              "logic"
                                            ]
                                          },
                                          "branches": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "label": {
                                                  "type": "string"
                                                },
                                                "predicate": {
                                                  "type": "object",
                                                  "properties": {
                                                    "variable": {
                                                      "type": "object",
                                                      "properties": {
                                                        "systemVariable": {
                                                          "type": "string"
                                                        },
                                                        "variableId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "operator": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "exists",
                                                        "not_exists",
                                                        "gt",
                                                        "lt",
                                                        "contains"
                                                      ]
                                                    },
                                                    "value": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "variable",
                                                    "operator"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "next": {
                                                  "type": "object",
                                                  "properties": {
                                                    "hookNode": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "step": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "end": {
                                                      "type": "boolean",
                                                      "enum": [
                                                        true
                                                      ]
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "label",
                                                "predicate",
                                                "next"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "else": {
                                            "type": "object",
                                            "properties": {
                                              "hookNode": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "step": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "end": {
                                                "type": "boolean",
                                                "enum": [
                                                  true
                                                ]
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "mode",
                                          "branches",
                                          "else"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "mode": {
                                            "type": "string",
                                            "enum": [
                                              "ai"
                                            ]
                                          },
                                          "prompt": {
                                            "type": "string"
                                          },
                                          "branches": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "label": {
                                                  "type": "string"
                                                },
                                                "description": {
                                                  "type": "string"
                                                },
                                                "next": {
                                                  "type": "object",
                                                  "properties": {
                                                    "hookNode": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "step": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "end": {
                                                      "type": "boolean",
                                                      "enum": [
                                                        true
                                                      ]
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "label",
                                                "description",
                                                "next"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "else": {
                                            "type": "object",
                                            "properties": {
                                              "hookNode": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "step": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "end": {
                                                "type": "boolean",
                                                "enum": [
                                                  true
                                                ]
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "mode",
                                          "prompt",
                                          "branches",
                                          "else"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "setVariable": {
                                    "type": "object",
                                    "properties": {
                                      "variableId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "value": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "variableId",
                                      "value"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "sendSms": {
                                    "type": "object",
                                    "properties": {
                                      "to": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "literalString": {
                                            "type": "string"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "message": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "to",
                                      "message"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "crmLookup": {
                                    "type": "object",
                                    "properties": {
                                      "integrationRef": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "matchBy": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "enum": [
                                            "phone",
                                            "email"
                                          ]
                                        }
                                      },
                                      "phoneSource": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "emailSource": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "fieldMappings": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "field": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "defaultValue": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "field",
                                            "variableId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "includePrimaryDeal": {
                                        "type": "boolean"
                                      },
                                      "onNotFound": {
                                        "type": "object",
                                        "properties": {
                                          "hookNode": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "step": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "end": {
                                            "type": "boolean",
                                            "enum": [
                                              true
                                            ]
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "integrationRef",
                                      "matchBy",
                                      "fieldMappings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "crmWrite": {
                                    "type": "object",
                                    "properties": {
                                      "integrationRef": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "contactIdSource": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "createContactIfMissing": {
                                        "type": "boolean"
                                      },
                                      "operations": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "enum": [
                                            "log_call",
                                            "create_note",
                                            "update_contact"
                                          ]
                                        }
                                      },
                                      "logCall": {
                                        "type": "object",
                                        "properties": {
                                          "subjectTemplate": {
                                            "type": "string"
                                          },
                                          "includeTranscript": {
                                            "type": "boolean"
                                          },
                                          "includeSummary": {
                                            "type": "boolean"
                                          },
                                          "includeRecordingUrl": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "includeTranscript",
                                          "includeSummary",
                                          "includeRecordingUrl"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "createNote": {
                                        "type": "object",
                                        "properties": {
                                          "bodyTemplate": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "bodyTemplate"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "updateContact": {
                                        "type": "object",
                                        "properties": {
                                          "propertyMappings": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "property": {
                                                  "type": "string"
                                                },
                                                "propertyLabel": {
                                                  "type": "string"
                                                },
                                                "source": {
                                                  "type": "string",
                                                  "enum": [
                                                    "variable",
                                                    "custom",
                                                    "ai"
                                                  ]
                                                },
                                                "systemVariable": {
                                                  "type": "string"
                                                },
                                                "variableId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "value": {
                                                  "type": "string"
                                                },
                                                "aiPrompt": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "property",
                                                "source"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "propertyMappings"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "integrationRef",
                                      "contactIdSource",
                                      "operations"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "id"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "nodes"
                          ],
                          "additionalProperties": false
                        },
                        "after": {
                          "type": "object",
                          "properties": {
                            "entryPoints": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "minLength": 1
                              },
                              "additionalProperties": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "prematureHangupNodeId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "nodes": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "minLength": 1
                              },
                              "additionalProperties": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "next": {
                                    "type": "object",
                                    "properties": {
                                      "hookNode": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "step": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "end": {
                                        "type": "boolean",
                                        "enum": [
                                          true
                                        ]
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "webhook": {
                                    "type": "object",
                                    "properties": {
                                      "url": {
                                        "type": "string"
                                      },
                                      "headers": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "secretHint": {
                                        "type": "string"
                                      },
                                      "signatureHeader": {
                                        "type": "string"
                                      },
                                      "payload": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "key": {
                                              "type": "string"
                                            },
                                            "source": {
                                              "type": "string",
                                              "enum": [
                                                "variable",
                                                "custom",
                                                "ai"
                                              ]
                                            },
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "value": {
                                              "type": "string"
                                            },
                                            "aiPrompt": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "key",
                                            "source"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "timeoutSeconds": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "responseVariableId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "responsePath": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "url",
                                      "payload"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "fetch": {
                                    "type": "object",
                                    "properties": {
                                      "url": {
                                        "type": "string"
                                      },
                                      "method": {
                                        "type": "string",
                                        "enum": [
                                          "GET",
                                          "POST"
                                        ]
                                      },
                                      "query": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "headers": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "body": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "key": {
                                              "type": "string"
                                            },
                                            "source": {
                                              "type": "string",
                                              "enum": [
                                                "variable",
                                                "custom",
                                                "ai"
                                              ]
                                            },
                                            "systemVariable": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "value": {
                                              "type": "string"
                                            },
                                            "aiPrompt": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "key",
                                            "source"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "responseFormat": {
                                        "type": "string",
                                        "enum": [
                                          "json",
                                          "text"
                                        ]
                                      },
                                      "responseMappings": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "path": {
                                              "type": "string"
                                            },
                                            "transform": {
                                              "type": "string",
                                              "enum": [
                                                "auto",
                                                "text",
                                                "number",
                                                "boolean",
                                                "json"
                                              ]
                                            },
                                            "defaultValue": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "variableId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "url",
                                      "method",
                                      "responseMappings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "condition": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "mode": {
                                            "type": "string",
                                            "enum": [
                                              "logic"
                                            ]
                                          },
                                          "branches": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "label": {
                                                  "type": "string"
                                                },
                                                "predicate": {
                                                  "type": "object",
                                                  "properties": {
                                                    "variable": {
                                                      "type": "object",
                                                      "properties": {
                                                        "systemVariable": {
                                                          "type": "string"
                                                        },
                                                        "variableId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "operator": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "exists",
                                                        "not_exists",
                                                        "gt",
                                                        "lt",
                                                        "contains"
                                                      ]
                                                    },
                                                    "value": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "variable",
                                                    "operator"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "next": {
                                                  "type": "object",
                                                  "properties": {
                                                    "hookNode": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "step": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "end": {
                                                      "type": "boolean",
                                                      "enum": [
                                                        true
                                                      ]
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "label",
                                                "predicate",
                                                "next"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "else": {
                                            "type": "object",
                                            "properties": {
                                              "hookNode": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "step": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "end": {
                                                "type": "boolean",
                                                "enum": [
                                                  true
                                                ]
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "mode",
                                          "branches",
                                          "else"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "mode": {
                                            "type": "string",
                                            "enum": [
                                              "ai"
                                            ]
                                          },
                                          "prompt": {
                                            "type": "string"
                                          },
                                          "branches": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "label": {
                                                  "type": "string"
                                                },
                                                "description": {
                                                  "type": "string"
                                                },
                                                "next": {
                                                  "type": "object",
                                                  "properties": {
                                                    "hookNode": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "step": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "end": {
                                                      "type": "boolean",
                                                      "enum": [
                                                        true
                                                      ]
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "label",
                                                "description",
                                                "next"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "else": {
                                            "type": "object",
                                            "properties": {
                                              "hookNode": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "step": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "end": {
                                                "type": "boolean",
                                                "enum": [
                                                  true
                                                ]
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "mode",
                                          "prompt",
                                          "branches",
                                          "else"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "setVariable": {
                                    "type": "object",
                                    "properties": {
                                      "variableId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "value": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "variableId",
                                      "value"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "sendSms": {
                                    "type": "object",
                                    "properties": {
                                      "to": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "literalString": {
                                            "type": "string"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "message": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "to",
                                      "message"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "crmLookup": {
                                    "type": "object",
                                    "properties": {
                                      "integrationRef": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "matchBy": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "enum": [
                                            "phone",
                                            "email"
                                          ]
                                        }
                                      },
                                      "phoneSource": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "emailSource": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "fieldMappings": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "field": {
                                              "type": "string"
                                            },
                                            "variableId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "defaultValue": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "field",
                                            "variableId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "includePrimaryDeal": {
                                        "type": "boolean"
                                      },
                                      "onNotFound": {
                                        "type": "object",
                                        "properties": {
                                          "hookNode": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "step": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "end": {
                                            "type": "boolean",
                                            "enum": [
                                              true
                                            ]
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "integrationRef",
                                      "matchBy",
                                      "fieldMappings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "crmWrite": {
                                    "type": "object",
                                    "properties": {
                                      "integrationRef": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "contactIdSource": {
                                        "type": "object",
                                        "properties": {
                                          "systemVariable": {
                                            "type": "string"
                                          },
                                          "variableId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "createContactIfMissing": {
                                        "type": "boolean"
                                      },
                                      "operations": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "enum": [
                                            "log_call",
                                            "create_note",
                                            "update_contact"
                                          ]
                                        }
                                      },
                                      "logCall": {
                                        "type": "object",
                                        "properties": {
                                          "subjectTemplate": {
                                            "type": "string"
                                          },
                                          "includeTranscript": {
                                            "type": "boolean"
                                          },
                                          "includeSummary": {
                                            "type": "boolean"
                                          },
                                          "includeRecordingUrl": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "includeTranscript",
                                          "includeSummary",
                                          "includeRecordingUrl"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "createNote": {
                                        "type": "object",
                                        "properties": {
                                          "bodyTemplate": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "bodyTemplate"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "updateContact": {
                                        "type": "object",
                                        "properties": {
                                          "propertyMappings": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "property": {
                                                  "type": "string"
                                                },
                                                "propertyLabel": {
                                                  "type": "string"
                                                },
                                                "source": {
                                                  "type": "string",
                                                  "enum": [
                                                    "variable",
                                                    "custom",
                                                    "ai"
                                                  ]
                                                },
                                                "systemVariable": {
                                                  "type": "string"
                                                },
                                                "variableId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "value": {
                                                  "type": "string"
                                                },
                                                "aiPrompt": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "property",
                                                "source"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "propertyMappings"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "integrationRef",
                                      "contactIdSource",
                                      "operations"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "id"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "nodes"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "compliance": {
                      "type": "object",
                      "properties": {
                        "aiDisclosure": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "minLength": 1
                          },
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "enum": [
                                  "approved",
                                  "rejected"
                                ]
                              },
                              "checkedText": {
                                "type": "string"
                              },
                              "reason": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "status",
                              "checkedText"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    "layout": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "minLength": 1
                      },
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "x": {
                            "type": "number"
                          },
                          "y": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "x",
                          "y"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "schemaVersion",
                    "entry",
                    "steps"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{projectId}/agent/simple": {
      "get": {
        "tags": [
          "simple-agent"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "projectId": {
                      "type": "string"
                    },
                    "agentId": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "simple"
                      ]
                    },
                    "template": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "version": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "key",
                        "name",
                        "version"
                      ],
                      "additionalProperties": false
                    },
                    "greeting": {
                      "type": "string"
                    },
                    "hangupAfterSeconds": {
                      "type": "number"
                    },
                    "facts": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "kind",
                          "label",
                          "value"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "skills": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "locked": {
                            "type": "boolean"
                          },
                          "integrationId": {
                            "type": "string"
                          },
                          "knowledgeBaseId": {
                            "type": "string"
                          },
                          "config": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "needs": {
                            "type": "string",
                            "enum": [
                              "integration:calendar",
                              "integration:crm",
                              "knowledge_base"
                            ]
                          }
                        },
                        "required": [
                          "key",
                          "name",
                          "enabled",
                          "locked",
                          "config"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "afterCall": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "enabled"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "status": {
                      "type": "object",
                      "properties": {
                        "runtimeReady": {
                          "type": "boolean"
                        },
                        "skipped": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "skill": {
                                "type": "string"
                              },
                              "reason": {
                                "type": "string",
                                "enum": [
                                  "integration:calendar",
                                  "integration:crm",
                                  "knowledge_base",
                                  "upcoming"
                                ]
                              }
                            },
                            "required": [
                              "skill",
                              "reason"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "runtimeReady",
                        "skipped"
                      ],
                      "additionalProperties": false
                    },
                    "upgradedToAgentId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "projectId",
                    "agentId",
                    "kind",
                    "template",
                    "greeting",
                    "facts",
                    "skills",
                    "afterCall",
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "simple-agent"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "greeting": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "hangupAfterSeconds": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 3600
                  },
                  "facts": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "skills": {
                    "maxItems": 64,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "config": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "integrationId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        }
                      },
                      "required": [
                        "key"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "afterCall": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        },
                        "enabled": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "enabled"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "projectId": {
                      "type": "string"
                    },
                    "agentId": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "simple"
                      ]
                    },
                    "template": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "version": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "key",
                        "name",
                        "version"
                      ],
                      "additionalProperties": false
                    },
                    "greeting": {
                      "type": "string"
                    },
                    "hangupAfterSeconds": {
                      "type": "number"
                    },
                    "facts": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "value": {}
                        },
                        "required": [
                          "kind",
                          "label",
                          "value"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "skills": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "locked": {
                            "type": "boolean"
                          },
                          "integrationId": {
                            "type": "string"
                          },
                          "knowledgeBaseId": {
                            "type": "string"
                          },
                          "config": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "needs": {
                            "type": "string",
                            "enum": [
                              "integration:calendar",
                              "integration:crm",
                              "knowledge_base"
                            ]
                          }
                        },
                        "required": [
                          "key",
                          "name",
                          "enabled",
                          "locked",
                          "config"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "afterCall": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "enabled"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "status": {
                      "type": "object",
                      "properties": {
                        "runtimeReady": {
                          "type": "boolean"
                        },
                        "skipped": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "skill": {
                                "type": "string"
                              },
                              "reason": {
                                "type": "string",
                                "enum": [
                                  "integration:calendar",
                                  "integration:crm",
                                  "knowledge_base",
                                  "upcoming"
                                ]
                              }
                            },
                            "required": [
                              "skill",
                              "reason"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "runtimeReady",
                        "skipped"
                      ],
                      "additionalProperties": false
                    },
                    "upgradedToAgentId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "projectId",
                    "agentId",
                    "kind",
                    "template",
                    "greeting",
                    "facts",
                    "skills",
                    "afterCall",
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/catalogue/skills": {
      "get": {
        "tags": [
          "simple-agent"
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "skills": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "requiredIntegration": {
                            "type": "string",
                            "enum": [
                              "none",
                              "calendar",
                              "crm",
                              "knowledge"
                            ]
                          },
                          "configFields": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "key": {
                                  "type": "string"
                                },
                                "label": {
                                  "type": "string"
                                },
                                "kind": {
                                  "type": "string"
                                },
                                "required": {
                                  "type": "boolean"
                                },
                                "options": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "key",
                                "label",
                                "kind",
                                "required"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "version": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "runtimeStatus": {
                            "type": "string",
                            "enum": [
                              "available",
                              "upcoming"
                            ]
                          }
                        },
                        "required": [
                          "key",
                          "name",
                          "description",
                          "requiredIntegration",
                          "configFields",
                          "version",
                          "runtimeStatus"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "skills"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/catalogue/templates": {
      "get": {
        "tags": [
          "simple-agent"
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "templates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "icon": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "skills": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "key": {
                                  "type": "string"
                                },
                                "availability": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "key",
                                "availability"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "fields": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "key": {
                                  "type": "string"
                                },
                                "label": {
                                  "type": "string"
                                },
                                "kind": {
                                  "type": "string"
                                },
                                "required": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "key",
                                "label",
                                "kind",
                                "required"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "key",
                          "name",
                          "description",
                          "icon",
                          "skills",
                          "fields"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "templates"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{projectId}/knowledge": {
      "get": {
        "tags": [
          "knowledge"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "knowledge": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "projectId": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "archived",
                              "indexing"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "projectId",
                          "name",
                          "description",
                          "status"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "knowledge"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "knowledge"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 5000
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "archived",
                        "indexing"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "description",
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/knowledge/{kbId}": {
      "get": {
        "tags": [
          "knowledge"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "kbId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "archived",
                        "indexing"
                      ]
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "website",
                              "file"
                            ]
                          },
                          "indexingStatus": {
                            "type": "string",
                            "enum": [
                              "idle",
                              "completed",
                              "inProgress"
                            ]
                          },
                          "progress": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "indexingStatus",
                          "progress"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "description",
                    "status",
                    "sources"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "knowledge"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "kbId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "204": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/knowledge/{kbId}/sources": {
      "post": {
        "tags": [
          "knowledge"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "website"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "url": {
                        "type": "string",
                        "format": "uri"
                      }
                    },
                    "required": [
                      "type",
                      "name",
                      "url"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "file"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "url": {
                        "type": "string",
                        "format": "uri"
                      }
                    },
                    "required": [
                      "type",
                      "name",
                      "url"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "text"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "text": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "type",
                      "name",
                      "text"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "kbId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "website",
                        "file"
                      ]
                    },
                    "indexingStatus": {
                      "type": "string",
                      "enum": [
                        "idle",
                        "completed",
                        "inProgress"
                      ]
                    },
                    "progress": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "indexing": {
                      "type": "string",
                      "enum": [
                        "deferred",
                        "triggered"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "type",
                    "indexingStatus",
                    "progress",
                    "indexing"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/knowledge/{kbId}/sources/{id}": {
      "delete": {
        "tags": [
          "knowledge"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "kbId",
            "required": true
          },
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "204": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/projects/{projectId}/integrations": {
      "get": {
        "tags": [
          "integration"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "integrations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "provider": {
                            "type": "string"
                          },
                          "name": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "connected": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "provider",
                          "name",
                          "connected"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "integrations"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{projectId}/numbers": {
      "get": {
        "tags": [
          "numbers"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "numbers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "projectId": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "e164": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "nairon",
                              "partner",
                              "external"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "enabled",
                              "disabled"
                            ]
                          },
                          "conversationId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "cuid",
                                "pattern": "^[cC][0-9a-z]{6,}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "projectId",
                          "e164",
                          "type",
                          "status",
                          "conversationId"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "numbers"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/numbers/{id}": {
      "patch": {
        "tags": [
          "numbers"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "conversationId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "cuid",
                        "pattern": "^[cC][0-9a-z]{6,}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "conversationId"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "e164": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "nairon",
                        "partner",
                        "external"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "enabled",
                        "disabled"
                      ]
                    },
                    "conversationId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "cuid",
                          "pattern": "^[cC][0-9a-z]{6,}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "e164",
                    "type",
                    "status",
                    "conversationId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{projectId}/web-sessions/agents": {
      "get": {
        "tags": [
          "web-sessions"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webAgents": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "projectId": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "channel": {
                            "type": "string",
                            "enum": [
                              "widget",
                              "api"
                            ]
                          },
                          "scopes": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "voice",
                                "chat"
                              ]
                            }
                          },
                          "allowedOrigins": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "conversationId": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "disabled"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "projectId",
                          "name",
                          "channel",
                          "scopes",
                          "allowedOrigins",
                          "conversationId",
                          "status"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "webAgents"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "web-sessions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "conversationId": {
                    "type": "string",
                    "format": "cuid",
                    "pattern": "^[cC][0-9a-z]{6,}$"
                  },
                  "channel": {
                    "default": "widget",
                    "type": "string",
                    "enum": [
                      "widget",
                      "api"
                    ]
                  },
                  "scopes": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "voice",
                        "chat"
                      ]
                    }
                  },
                  "allowedOrigins": {
                    "default": [],
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                },
                "required": [
                  "name",
                  "conversationId",
                  "scopes"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "widget",
                        "api"
                      ]
                    },
                    "scopes": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "voice",
                          "chat"
                        ]
                      }
                    },
                    "allowedOrigins": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "conversationId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "disabled"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "channel",
                    "scopes",
                    "allowedOrigins",
                    "conversationId",
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{projectId}/web-sessions/agents/{id}": {
      "patch": {
        "tags": [
          "web-sessions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "conversationId": {
                    "type": "string",
                    "format": "cuid",
                    "pattern": "^[cC][0-9a-z]{6,}$"
                  },
                  "scopes": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "voice",
                        "chat"
                      ]
                    }
                  },
                  "allowedOrigins": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "disabled"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "id",
            "required": true
          },
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "widget",
                        "api"
                      ]
                    },
                    "scopes": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "voice",
                          "chat"
                        ]
                      }
                    },
                    "allowedOrigins": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "conversationId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "disabled"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "channel",
                    "scopes",
                    "allowedOrigins",
                    "conversationId",
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "web-sessions"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "id",
            "required": true
          },
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "204": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/web-sessions": {
      "post": {
        "tags": [
          "web-sessions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "webAgentId": {
                    "type": "string",
                    "format": "cuid",
                    "pattern": "^[cC][0-9a-z]{6,}$"
                  },
                  "mode": {
                    "default": "WEB_FULL",
                    "type": "string",
                    "enum": [
                      "WEB_FULL",
                      "WEB_TEXT",
                      "voice",
                      "voice_text",
                      "text"
                    ]
                  }
                },
                "required": [
                  "webAgentId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "x-beta": true,
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "roomUrl": {
                      "type": "string"
                    },
                    "token": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "roomUrl",
                    "token",
                    "expiresAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{projectId}/keys": {
      "get": {
        "tags": [
          "keys"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "keys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "projectId": {
                            "type": "string",
                            "format": "cuid",
                            "pattern": "^[cC][0-9a-z]{6,}$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "keyType": {
                            "type": "string",
                            "enum": [
                              "publishable",
                              "secret"
                            ]
                          },
                          "scope": {
                            "type": "string",
                            "enum": [
                              "service_app",
                              "service_platform",
                              "platform"
                            ]
                          },
                          "keyPrefix": {
                            "type": "string"
                          },
                          "last4": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "revoked"
                            ]
                          },
                          "lastUsedAt": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "projectId",
                          "name",
                          "keyType",
                          "scope",
                          "keyPrefix",
                          "last4",
                          "status",
                          "lastUsedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "keys"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "keys"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "keyType": {
                    "default": "publishable",
                    "type": "string",
                    "enum": [
                      "publishable",
                      "secret"
                    ]
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "keyType": {
                      "type": "string",
                      "enum": [
                        "publishable",
                        "secret"
                      ]
                    },
                    "scope": {
                      "type": "string",
                      "enum": [
                        "service_app",
                        "service_platform",
                        "platform"
                      ]
                    },
                    "keyPrefix": {
                      "type": "string"
                    },
                    "last4": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "revoked"
                      ]
                    },
                    "lastUsedAt": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "plaintext": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "keyType",
                    "scope",
                    "keyPrefix",
                    "last4",
                    "status",
                    "lastUsedAt",
                    "plaintext"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/keys/{id}/revoke": {
      "post": {
        "tags": [
          "keys"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "cuid",
              "pattern": "^[cC][0-9a-z]{6,}$"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "x-beta": true,
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "projectId": {
                      "type": "string",
                      "format": "cuid",
                      "pattern": "^[cC][0-9a-z]{6,}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "keyType": {
                      "type": "string",
                      "enum": [
                        "publishable",
                        "secret"
                      ]
                    },
                    "scope": {
                      "type": "string",
                      "enum": [
                        "service_app",
                        "service_platform",
                        "platform"
                      ]
                    },
                    "keyPrefix": {
                      "type": "string"
                    },
                    "last4": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "revoked"
                      ]
                    },
                    "lastUsedAt": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "projectId",
                    "name",
                    "keyType",
                    "scope",
                    "keyPrefix",
                    "last4",
                    "status",
                    "lastUsedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "responses": {
          "200": {
            "description": "Default Response"
          }
        }
      },
      "get": {
        "responses": {
          "200": {
            "description": "Default Response"
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "description": "Default Response"
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://service.testing.nairon.cloud",
      "description": "Service API"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "apiKeyHeader": []
    }
  ]
}
