{
  "openapi": "3.1.0",
  "info": {
    "title": "Sarj.ai Developer API",
    "description": "Create calls, schedule retries, and retrieve outcomes.\n\n[Quickstart](https://platform-docs.sarj.ai/getting-started) ·\n[Authentication and errors](https://platform-docs.sarj.ai/api-reference/overview) ·\n[MCP guide](https://platform-docs.sarj.ai/mcp-server)\n",
    "license": {
      "name": "Apache 2.0",
      "identifier": "Apache-2.0"
    },
    "version": "1.1.0"
  },
  "servers": [
    {
      "url": "https://platform-api.sarj.ai/api/v1",
      "description": "Production"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Check health",
        "description": "No authentication required.",
        "operationId": "getHealth",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_HealthStatus_"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [],
        "x-mint": {
          "href": "/api-reference/system/health-check",
          "metadata": {
            "title": "Check health",
            "sidebarTitle": "Check health"
          }
        },
        "x-codeSamples": [
          {
            "label": "Python (SDK)",
            "lang": "Python",
            "source": "from sarj_platform_sdk import SDK\n\nwith SDK(timeout_ms=10_000) as sdk:\n    print(sdk.system.get_health().data.status)  # \"ok\""
          },
          {
            "label": "Python (requests)",
            "lang": "Python",
            "source": "import requests\n\nresponse = requests.get(\n    \"https://platform-api.sarj.ai/api/v1/health\", timeout=10\n)\nresponse.raise_for_status()\nprint(response.json())"
          },
          {
            "label": "TypeScript",
            "lang": "TypeScript",
            "source": "const response = await fetch(\n  \"https://platform-api.sarj.ai/api/v1/health\",\n  { signal: AbortSignal.timeout(10_000) },\n);\nif (!response.ok) throw new Error(`HTTP ${response.status}`);\nconst data = await response.json();\nconsole.log(data);"
          }
        ]
      }
    },
    "/calls": {
      "post": {
        "tags": [
          "Calls"
        ],
        "summary": "Create a call",
        "description": "Start or schedule an outbound call.",
        "operationId": "createCall",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCallRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Call accepted. Use the returned ID to track its outcome.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_PublicCall_"
                },
                "example": {
                  "data": {
                    "id": "8f9b2c1e-4a5d-4f6e-8b1a-2c3d4e5f6a7b",
                    "status": "queued",
                    "phone_number": "+966512345678",
                    "scenario_id": "550e8400-e29b-41d4-a716-446655440000",
                    "created_at": "2026-04-12T10:30:00Z"
                  },
                  "meta": {
                    "request_id": "550e8400-e29b-41d4-a716-446655440000"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Outbound call failed.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "type": "outbound_call_failed",
                    "message": "Outbound call could not be initiated.",
                    "reason": "telephony_provider_unavailable"
                  },
                  "meta": {
                    "request_id": "550e8400-e29b-41d4-a716-446655440000"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "type": "unauthorized",
                    "message": "Authentication required."
                  },
                  "meta": {}
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — phone number blocked, scenario access denied, or scheduling (scheduled_at or schedule_config_id) is disabled on this environment.",
            "content": {
              "application/json": {
                "examples": {
                  "phone_number_blocked": {
                    "summary": "Phone number is blocked",
                    "value": {
                      "error": {
                        "type": "phone_number_blocked",
                        "message": "Phone number +966512345678 is blocked.",
                        "phone_number": "+966512345678"
                      },
                      "meta": {
                        "request_id": "550e8400-e29b-41d4-a716-446655440000"
                      }
                    }
                  },
                  "scenario_forbidden": {
                    "summary": "Scenario belongs to a different organization",
                    "value": {
                      "error": {
                        "type": "scenario_forbidden",
                        "message": "Access denied to scenario 550e8400-e29b-41d4-a716-446655440000.",
                        "scenario_id": "550e8400-e29b-41d4-a716-446655440000"
                      },
                      "meta": {
                        "request_id": "550e8400-e29b-41d4-a716-446655440000"
                      }
                    }
                  },
                  "scheduling_disabled": {
                    "summary": "Call scheduling is not enabled on this environment",
                    "value": {
                      "error": {
                        "type": "scheduling_disabled",
                        "message": "Call scheduling is not enabled on this environment."
                      },
                      "meta": {
                        "request_id": "550e8400-e29b-41d4-a716-446655440000"
                      }
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Scenario not found, or the requested schedule_config_id does not exist.",
            "content": {
              "application/json": {
                "examples": {
                  "scenario_not_found": {
                    "summary": "Scenario does not exist",
                    "value": {
                      "error": {
                        "type": "scenario_not_found",
                        "message": "Scenario 550e8400-e29b-41d4-a716-446655440000 was not found.",
                        "scenario_id": "550e8400-e29b-41d4-a716-446655440000"
                      },
                      "meta": {
                        "request_id": "550e8400-e29b-41d4-a716-446655440000"
                      }
                    }
                  },
                  "schedule_config_not_found": {
                    "summary": "Requested schedule_config_id does not exist",
                    "value": {
                      "error": {
                        "type": "schedule_config_not_found",
                        "message": "Schedule config 01890000-0000-7000-8000-000000000000 was not found.",
                        "schedule_config_id": "01890000-0000-7000-8000-000000000000"
                      },
                      "meta": {
                        "request_id": "550e8400-e29b-41d4-a716-446655440000"
                      }
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "type": "validation_error",
                    "message": "Request validation failed.",
                    "field_violations": [
                      {
                        "field": "body.phone_number",
                        "message": "Saudi numbers must drop the 0 after +966 (e.g., +966512345678, not +9660512345678)"
                      }
                    ]
                  },
                  "meta": {
                    "request_id": "550e8400-e29b-41d4-a716-446655440000"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Call limit exceeded.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "type": "call_limit_exceeded",
                    "message": "Call limit of 10 reached for phone number +966512345678.",
                    "phone_number": "+966512345678",
                    "call_limit": 10
                  },
                  "meta": {
                    "request_id": "550e8400-e29b-41d4-a716-446655440000"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/calls/place-an-outbound-sarjai-voice-call",
          "metadata": {
            "title": "Create a call",
            "sidebarTitle": "Create a call"
          }
        },
        "x-codeSamples": [
          {
            "label": "Python (SDK)",
            "lang": "Python",
            "source": "import os\nfrom sarj_platform_sdk import SDK\n\nwith SDK(api_key_auth=os.environ[\"SARJ_API_KEY\"], timeout_ms=10_000) as sdk:\n    res = sdk.calls.create_call(\n        phone_number=os.environ[\"TEST_PHONE_NUMBER\"],\n        scenario_id=os.environ[\"SARJ_SCENARIO_ID\"],\n        language=\"ar\",\n    )\n    print(f\"Call queued: {res.data.id}\")"
          },
          {
            "label": "curl",
            "lang": "bash",
            "source": "curl --fail-with-body --max-time 10 https://platform-api.sarj.ai/api/v1/calls \\\n  -H \"Authorization: Bearer $SARJ_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"phone_number\": \"+966512345678\",\n    \"scenario_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n    \"language\": \"ar\"\n  }'"
          },
          {
            "label": "Python (requests)",
            "lang": "Python",
            "source": "import os\nimport requests\n\nresponse = requests.post(\n    \"https://platform-api.sarj.ai/api/v1/calls\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['SARJ_API_KEY']}\",\n    },\n    json={\n        \"phone_number\": os.environ[\"TEST_PHONE_NUMBER\"],\n        \"scenario_id\": os.environ[\"SARJ_SCENARIO_ID\"],\n        \"language\": \"ar\",\n    },\n    timeout=10,\n)\nresponse.raise_for_status()\ncall = response.json()[\"data\"]\nprint(f\"Call queued: {call['id']}\")"
          },
          {
            "label": "TypeScript",
            "lang": "TypeScript",
            "source": "const response = await fetch(\"https://platform-api.sarj.ai/api/v1/calls\", {\n  method: \"POST\",\n  headers: {\n    \"Authorization\": `Bearer ${process.env.SARJ_API_KEY}`,\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    phone_number: process.env.TEST_PHONE_NUMBER,\n    scenario_id: process.env.SARJ_SCENARIO_ID,\n    language: \"ar\",\n  }),\n  signal: AbortSignal.timeout(10_000),\n});\n\nif (!response.ok) throw new Error(`HTTP ${response.status}`);\nconst { data: call } = await response.json();\nconsole.log(`Call queued: ${call.id}`);"
          }
        ]
      },
      "get": {
        "tags": [
          "Call History"
        ],
        "summary": "List calls",
        "description": "List this organization's calls, newest first. Use getCallTranscript to read one call.",
        "operationId": "listCalls",
        "parameters": [
          {
            "name": "scenario_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Scenario Id"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/CallStatus"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "created_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive lower bound.",
              "title": "Created From"
            },
            "description": "Inclusive lower bound."
          },
          {
            "name": "created_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclusive upper bound.",
              "title": "Created To"
            },
            "description": "Exclusive upper bound."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 128
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "calls:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "List calls",
            "sidebarTitle": "List calls"
          }
        }
      }
    },
    "/calls/{call_id}/cancel": {
      "post": {
        "tags": [
          "Calls"
        ],
        "summary": "Cancel a scheduled call",
        "description": "Cancel a pending call or retry, ending its retry chain.",
        "operationId": "cancelScheduledCall",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Call id (UUID), as returned in the `id` field.",
              "title": "Call Id"
            },
            "description": "Call id (UUID), as returned in the `id` field."
          }
        ],
        "responses": {
          "200": {
            "description": "The call was cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_PublicCall_"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Scheduling disabled, or no organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Call not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The call is no longer pending.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/calls/cancel-a-pending-scheduled-sarjai-call",
          "metadata": {
            "title": "Cancel a scheduled call",
            "sidebarTitle": "Cancel a scheduled call"
          }
        }
      }
    },
    "/calls/{call_id}/reschedule": {
      "post": {
        "tags": [
          "Calls"
        ],
        "summary": "Reschedule a call",
        "description": "Move a pending call to a new dial time.",
        "operationId": "rescheduleScheduledCall",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Call id (UUID), as returned in the `id` field.",
              "title": "Call Id"
            },
            "description": "Call id (UUID), as returned in the `id` field."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RescheduleCallRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The call was rescheduled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_PublicCall_"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Scheduling disabled, or no organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Call not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The call is no longer pending.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Invalid scheduled_at.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/calls/move-a-pending-scheduled-sarjai-call-to-a-new-time",
          "metadata": {
            "title": "Reschedule a call",
            "sidebarTitle": "Reschedule a call"
          }
        }
      }
    },
    "/calls/{call_id}": {
      "get": {
        "tags": [
          "Calls"
        ],
        "summary": "Get a call",
        "description": "Get a call's details and latest outcome.",
        "operationId": "getCall",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Call id (UUID), as returned in the `id` field.",
              "title": "Call Id"
            },
            "description": "Call id (UUID), as returned in the `id` field."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_PublicCallDetail_"
                },
                "example": {
                  "data": {
                    "id": "8f9b2c1e-4a5d-4f6e-8b1a-2c3d4e5f6a7b",
                    "status": "completed",
                    "phone_number": "+966512345678",
                    "scenario_id": "550e8400-e29b-41d4-a716-446655440000",
                    "language": "ar",
                    "direction": "outbound",
                    "variables": {
                      "customer_name": "Ahmad",
                      "order_id": "ORD-123"
                    },
                    "duration": 142,
                    "permanent_recording_url": "https://platform-api.sarj.ai/api/v1/calls/8f9b2c1e-4a5d-4f6e-8b1a-2c3d4e5f6a7b/recording",
                    "transcript": [
                      {
                        "role": "assistant",
                        "content": "Hello Ahmad, calling about order ORD-123."
                      },
                      {
                        "role": "user",
                        "content": "Yes, hi."
                      },
                      {
                        "role": "assistant",
                        "content": "Your order is ready for delivery tomorrow."
                      }
                    ],
                    "report": {
                      "generated_at": "2026-04-12T10:33:41Z",
                      "outcome": {
                        "status": "success",
                        "reason": "The customer confirmed the delivery appointment for tomorrow.",
                        "success_criteria": [
                          {
                            "text": "Customer confirms the delivery slot",
                            "achieved": true,
                            "is_primary": true
                          }
                        ]
                      }
                    },
                    "created_at": "2026-04-12T10:30:00Z",
                    "updated_at": "2026-04-12T10:32:22Z",
                    "started_at": "2026-04-12T10:30:05Z",
                    "ended_at": "2026-04-12T10:32:22Z"
                  },
                  "meta": {
                    "request_id": "550e8400-e29b-41d4-a716-446655440000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "type": "unauthorized",
                    "message": "Authentication required."
                  },
                  "meta": {}
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "API key not associated with an organization.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "type": "no_organization",
                    "message": "API key is not associated with an organization."
                  },
                  "meta": {
                    "request_id": "550e8400-e29b-41d4-a716-446655440000"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Call not found.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "type": "call_not_found",
                    "message": "Call 8f9b2c1e-4a5d-4f6e-8b1a-2c3d4e5f6a7b was not found.",
                    "call_id": "8f9b2c1e-4a5d-4f6e-8b1a-2c3d4e5f6a7b"
                  },
                  "meta": {
                    "request_id": "550e8400-e29b-41d4-a716-446655440000"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/calls/fetch-sarjai-voice-call-details-by-call_id",
          "metadata": {
            "title": "Get a call",
            "sidebarTitle": "Get a call"
          }
        },
        "x-codeSamples": [
          {
            "label": "Python (SDK)",
            "lang": "Python",
            "source": "import os\nfrom sarj_platform_sdk import SDK\n\nwith SDK(api_key_auth=os.environ[\"SARJ_API_KEY\"], timeout_ms=10_000) as sdk:\n    res = sdk.calls.get_call(call_id=os.environ[\"SARJ_CALL_ID\"])\n    call = res.data\n    print(f\"Status: {call.status}, duration: {call.duration}\")"
          },
          {
            "label": "curl",
            "lang": "bash",
            "source": "curl --fail-with-body --max-time 10 https://platform-api.sarj.ai/api/v1/calls/8f9b2c1e-4a5d-4f6e-8b1a-2c3d4e5f6a7b \\\n  -H \"Authorization: Bearer $SARJ_API_KEY\""
          },
          {
            "label": "Python (requests)",
            "lang": "Python",
            "source": "import os\nimport requests\n\ncall_id = \"8f9b2c1e-4a5d-4f6e-8b1a-2c3d4e5f6a7b\"\nresponse = requests.get(\n    f\"https://platform-api.sarj.ai/api/v1/calls/{call_id}\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['SARJ_API_KEY']}\",\n    },\n    timeout=10,\n)\nresponse.raise_for_status()\ncall = response.json()[\"data\"]\nprint(f\"Status: {call['status']}, duration: {call['duration']}\")"
          },
          {
            "label": "TypeScript",
            "lang": "TypeScript",
            "source": "const callId = \"8f9b2c1e-4a5d-4f6e-8b1a-2c3d4e5f6a7b\";\nconst response = await fetch(\n  `https://platform-api.sarj.ai/api/v1/calls/${callId}`,\n  {\n    headers: {\n      \"Authorization\": `Bearer ${process.env.SARJ_API_KEY}`,\n    },\n    signal: AbortSignal.timeout(10_000),\n  },\n);\n\nif (!response.ok) throw new Error(`HTTP ${response.status}`);\nconst { data: call } = await response.json();\nconsole.log(`Status: ${call.status}, duration: ${call.duration}`);"
          }
        ]
      }
    },
    "/calls/{call_id}/recording": {
      "get": {
        "tags": [
          "Calls"
        ],
        "summary": "Get a recording",
        "description": "Redirect to a fresh recording download. API keys take precedence; invalid keys never fall back to tokens.",
        "operationId": "getCallRecording",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Call id (UUID), as returned in the `id` field.",
              "title": "Call Id"
            },
            "description": "Call id (UUID), as returned in the `id` field."
          },
          {
            "name": "t",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Call-scoped token for header-less clients. Prefer the header; URLs expose credentials.",
              "title": "T"
            },
            "description": "Call-scoped token for header-less clients. Prefer the header; URLs expose credentials."
          },
          {
            "name": "x-sarj-recording-token",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Call-scoped token used when no API key is sent; overrides t.",
              "title": "X-Sarj-Recording-Token"
            },
            "description": "Call-scoped token used when no API key is sent; overrides t."
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect (Location header) to a short-lived recording download URL.",
            "headers": {
              "Location": {
                "description": "Short-lived signed recording download URL.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            },
            "content": {}
          },
          "401": {
            "description": "Invalid API key, or (token path) a missing/invalid/expired/mismatched token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "API key not associated with an organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Call not found or recording unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/calls/redirect-to-a-fresh-download-url-for-a-sarjai-call-recording",
          "metadata": {
            "title": "Get a recording",
            "sidebarTitle": "Get a recording"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          },
          {}
        ],
        "x-speakeasy-ignore": true
      }
    },
    "/schedule-configs": {
      "post": {
        "tags": [
          "Schedule Configs"
        ],
        "summary": "Create a retry policy",
        "description": "Create a reusable dial-retry policy. This API is create-only.",
        "operationId": "createScheduleConfig",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScheduleConfigRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The schedule config was created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_PublicScheduleConfig_"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Scheduling disabled, or no organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mint": {
          "href": "/api-reference/schedule-configs/create-a-sarjai-schedule-config-retry-policy-for-outbound-calls",
          "metadata": {
            "title": "Create a retry policy",
            "sidebarTitle": "Create a retry policy"
          }
        }
      }
    },
    "/scenario-tests/runs": {
      "post": {
        "tags": [
          "Scenario Tests"
        ],
        "summary": "Start a scenario test run",
        "description": "Start an automated chat test of a scenario. The real agent answers each typed turn with the scenario's configuration as of now; tools, integrations and webhooks are replaced by recorded mocks, so nothing external runs. By default (version draft) it tests the latest saved prompt, even one not yet published, so a change can be checked before it goes live; version live tests the published prompt. Real calls keep using the published prompt. Poll getScenarioTestRun for the result. Runs are typed chats with the real agent; they do not test speech recognition, voice or telephony quality.",
        "operationId": "startScenarioTestRun",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartScenarioTestRunRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioTestRunResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The scenario or test run was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The organization already has the maximum number of active test runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "test_starts",
          "permission": "scenarios:write"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Start a scenario test run",
            "sidebarTitle": "Start a scenario test run"
          }
        }
      },
      "get": {
        "tags": [
          "Scenario Tests"
        ],
        "summary": "List a scenario's test runs",
        "description": "List a scenario's test runs, newest first.",
        "operationId": "listScenarioTestRuns",
        "parameters": [
          {
            "name": "scenario_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Scenario Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioTestRunListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The scenario or test run was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "scenarios:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "List a scenario's test runs",
            "sidebarTitle": "List a scenario's test runs"
          }
        }
      }
    },
    "/scenario-tests/runs/{run_id}/rerun": {
      "post": {
        "tags": [
          "Scenario Tests"
        ],
        "summary": "Rerun a scenario test",
        "description": "Start a new run with exactly the inputs kept by an earlier run, including the prompt version it tested, even if the scenario changed since. Runs are typed chats with the real agent; they do not test speech recognition, voice or telephony quality.",
        "operationId": "rerunScenarioTestRun",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Run Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioTestRunResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The scenario or test run was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The organization already has the maximum number of active test runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "test_starts",
          "permission": "scenarios:write"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Rerun a scenario test",
            "sidebarTitle": "Rerun a scenario test"
          }
        }
      }
    },
    "/scenario-tests/runs/{run_id}": {
      "get": {
        "tags": [
          "Scenario Tests"
        ],
        "summary": "Get a scenario test run",
        "description": "Get a run's status and, once it finished, every check with pass or fail and its evidence, the conversation, the mocked tool calls and the knowledge base searches. Checks of kind judgment are model judgments and name the judge model. Runs are typed chats with the real agent; they do not test speech recognition, voice or telephony quality.",
        "operationId": "getScenarioTestRun",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Run Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioTestRunResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The scenario or test run was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "scenarios:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Get a scenario test run",
            "sidebarTitle": "Get a scenario test run"
          }
        }
      }
    },
    "/scenario-tests/runs/{run_id}/cancel": {
      "post": {
        "tags": [
          "Scenario Tests"
        ],
        "summary": "Cancel a scenario test run",
        "description": "Stop a queued or running test run. A finished run is returned unchanged.",
        "operationId": "cancelScenarioTestRun",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Run Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioTestRunResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The scenario or test run was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "scenarios:write"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Cancel a scenario test run",
            "sidebarTitle": "Cancel a scenario test run"
          }
        }
      }
    },
    "/scenarios": {
      "get": {
        "tags": [
          "Scenarios"
        ],
        "summary": "List scenarios",
        "description": "List this organization's scenarios, newest first.",
        "operationId": "listScenarios",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "scenarios:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "List scenarios",
            "sidebarTitle": "List scenarios"
          }
        }
      },
      "post": {
        "tags": [
          "Scenarios"
        ],
        "summary": "Create a scenario",
        "description": "Create a scenario with its languages, prompts, greetings, personas, variables, knowledge bases, success criteria, data extraction, retry schedule, time zone and tools. It starts active and not live. Personas default to the organization's default for each language. Tools follow the saveScenarioTool rules and carry no credentials; add those in the dashboard. Fails with 409 if the name is taken.",
        "operationId": "createScenario",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScenarioRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "A scenario with this name already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "scenario_writes",
          "permission": "scenarios:write"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Create a scenario",
            "sidebarTitle": "Create a scenario"
          }
        }
      }
    },
    "/scenarios/{scenario_id}": {
      "get": {
        "tags": [
          "Scenarios"
        ],
        "summary": "Get a scenario",
        "description": "Get a scenario's prompts, greetings, tools, knowledge bases, variables and post-call settings. Credentials, headers, endpoints and values that custom API tools send are never included. A connector action leaves out inputs whose fixed values could carry secrets and is listed in locked_connector_actions; sending it back unchanged in updateScenario keeps it.",
        "operationId": "getScenario",
        "parameters": [
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Scenario Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The scenario was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "scenarios:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Get a scenario",
            "sidebarTitle": "Get a scenario"
          }
        }
      },
      "patch": {
        "tags": [
          "Scenarios"
        ],
        "summary": "Update scenario settings",
        "description": "Change the greetings, personas, default language, variables, knowledge bases, success criteria, data extraction, retry schedule, time zone, CRM updates or recording destinations of a scenario that is not live. Omitted settings stay as they are. Prompts and tools are not changed here. CRM updates and recording destinations need the CRM integration connected in the dashboard. post_call_sync replaces every entry, connector actions included: send back the entries you read to keep them. A locked connector action leaves out inputs that could carry secrets; send it back unchanged to keep it, because it changes only in the dashboard. Fails with 409 if the scenario is live, live status is not available, a locked connector action was changed, or the scenario changed after it was read.",
        "operationId": "updateScenario",
        "parameters": [
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Scenario Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScenarioRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The scenario was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The scenario is live, or changed after it was read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "scenario_writes",
          "permission": "scenarios:write"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Update scenario settings",
            "sidebarTitle": "Update scenario settings"
          }
        }
      }
    },
    "/scenarios/{scenario_id}/quality-flags": {
      "put": {
        "tags": [
          "Scenarios"
        ],
        "summary": "Update scenario quality flags",
        "description": "Turn quality flag checks on or off and replace the flags that calls are checked for after they end, on a scenario that is not live. Flags left out of the list are removed. Fails with 409 if the scenario is live, live status is not available, or the scenario or its quality flags changed after they were read.",
        "operationId": "updateScenarioQualityFlags",
        "parameters": [
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Scenario Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScenarioQualityFlagsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The scenario was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The scenario is live, or changed after it was read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "scenario_writes",
          "permission": "scenarios:write"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Update scenario quality flags",
            "sidebarTitle": "Update scenario quality flags"
          }
        }
      }
    },
    "/scenarios/{scenario_id}/tools": {
      "get": {
        "tags": [
          "Scenario Tools"
        ],
        "summary": "Get scenario tools",
        "description": "Get every tool of a scenario with its settings. Values that could be secrets, such as fixed headers and query values, keys, tokens and encrypted values, read as null and make the tool not editable.",
        "operationId": "getScenarioTools",
        "parameters": [
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Scenario Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioToolsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The scenario was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "scenarios:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Get scenario tools",
            "sidebarTitle": "Get scenario tools"
          }
        }
      }
    },
    "/scenarios/{scenario_id}/tools/{tool_name}": {
      "put": {
        "tags": [
          "Scenario Tools"
        ],
        "summary": "Add or replace a scenario tool",
        "description": "Add a tool to a scenario that is not live, or replace the tool with this name. The name is the custom API tool's name or the built-in tool's type. Secrets cannot be set here: a custom API tool keeps only the credentials the stored tool already sends to the same host, and new credentials and other secret values are set in the dashboard. Transfers may use only the organization's own trunks and numbers.",
        "operationId": "saveScenarioTool",
        "parameters": [
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Scenario Id"
            }
          },
          {
            "name": "tool_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "title": "Tool Name"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveScenarioToolRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioToolsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The scenario or tool was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The scenario is live or changed after it was read, or the tool can only change in the dashboard.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "scenario_writes",
          "permission": "scenarios:write"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Add or replace a scenario tool",
            "sidebarTitle": "Add or replace a scenario tool"
          }
        }
      },
      "delete": {
        "tags": [
          "Scenario Tools"
        ],
        "summary": "Delete a scenario tool",
        "description": "Remove the tool with this name from a scenario that is not live. A hidden variable default that no remaining tool sends is cleared.",
        "operationId": "deleteScenarioTool",
        "parameters": [
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Scenario Id"
            }
          },
          {
            "name": "tool_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "title": "Tool Name"
            }
          },
          {
            "name": "expected_updated_at",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "The updated_at value this change is based on.",
              "title": "Expected Updated At"
            },
            "description": "The updated_at value this change is based on."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioToolsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The scenario or tool was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The scenario is live or changed after it was read, or the tool can only change in the dashboard.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "scenario_writes",
          "permission": "scenarios:write"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Delete a scenario tool",
            "sidebarTitle": "Delete a scenario tool"
          }
        }
      }
    },
    "/knowledge-bases": {
      "get": {
        "tags": [
          "Knowledge Bases"
        ],
        "summary": "List knowledge bases",
        "description": "List the knowledge bases that belong to this organization.",
        "operationId": "listKnowledgeBases",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 128
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBaseListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The knowledge base or file was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "scenarios:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "List knowledge bases",
            "sidebarTitle": "List knowledge bases"
          }
        }
      }
    },
    "/knowledge-bases/{knowledge_base_id}": {
      "get": {
        "tags": [
          "Knowledge Bases"
        ],
        "summary": "Get a knowledge base",
        "description": "Get a knowledge base and its files, without their content.",
        "operationId": "getKnowledgeBase",
        "parameters": [
          {
            "name": "knowledge_base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Knowledge Base Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBaseDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The knowledge base or file was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "scenarios:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Get a knowledge base",
            "sidebarTitle": "Get a knowledge base"
          }
        }
      }
    },
    "/knowledge-bases/{knowledge_base_id}/files/{file_id}/content": {
      "get": {
        "tags": [
          "Knowledge Bases"
        ],
        "summary": "Read a knowledge base file",
        "description": "Read the current text of a knowledge base file. Use updated_at to replace it safely.",
        "operationId": "getKnowledgeBaseFileContent",
        "parameters": [
          {
            "name": "knowledge_base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Knowledge Base Id"
            }
          },
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "File Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBaseFileContentResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The knowledge base or file was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "scenarios:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Read a knowledge base file",
            "sidebarTitle": "Read a knowledge base file"
          }
        }
      },
      "put": {
        "tags": [
          "Knowledge Bases"
        ],
        "summary": "Replace a knowledge base file",
        "description": "Replace the text of a knowledge base file. New calls use the new text as soon as this returns. Until reindexing finishes, knowledge base searches in the file's language use keyword matching. Every scenario attached to this knowledge base is affected. Fails with 409 if the file changed after it was read.",
        "operationId": "replaceKnowledgeBaseFileContent",
        "parameters": [
          {
            "name": "knowledge_base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Knowledge Base Id"
            }
          },
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "File Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceKnowledgeBaseFileContentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBaseFileContentResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The knowledge base or file was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The file changed after it was read. Read it again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "kb_writes",
          "permission": "scenarios:write"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Replace a knowledge base file",
            "sidebarTitle": "Replace a knowledge base file"
          }
        }
      }
    },
    "/knowledge-bases/{knowledge_base_id}/files/{file_id}/revisions": {
      "get": {
        "tags": [
          "Knowledge Bases"
        ],
        "summary": "List earlier versions of a knowledge base file",
        "description": "List earlier versions of a knowledge base file, newest first.",
        "operationId": "listKnowledgeBaseFileRevisions",
        "parameters": [
          {
            "name": "knowledge_base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Knowledge Base Id"
            }
          },
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "File Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBaseFileRevisionListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The knowledge base or file was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "scenarios:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "List earlier versions of a knowledge base file",
            "sidebarTitle": "List earlier versions of a knowledge base file"
          }
        }
      }
    },
    "/knowledge-bases/{knowledge_base_id}/files/{file_id}/revisions/{revision_id}/restore": {
      "post": {
        "tags": [
          "Knowledge Bases"
        ],
        "summary": "Restore an earlier version of a knowledge base file",
        "description": "Publish an earlier version again. The content it replaces is kept as a new revision.",
        "operationId": "restoreKnowledgeBaseFileRevision",
        "parameters": [
          {
            "name": "knowledge_base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Knowledge Base Id"
            }
          },
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "File Id"
            }
          },
          {
            "name": "revision_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Revision Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RestoreKnowledgeBaseFileRevisionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBaseFileSummaryResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The knowledge base or file was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The file changed after it was read. Read it again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "kb_writes",
          "permission": "scenarios:write"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Restore an earlier version of a knowledge base file",
            "sidebarTitle": "Restore an earlier version of a knowledge base file"
          }
        }
      }
    },
    "/knowledge-bases/{knowledge_base_id}/search": {
      "get": {
        "tags": [
          "Knowledge Bases"
        ],
        "summary": "Search a knowledge base",
        "description": "Find the records in a knowledge base's current text that contain the query. Matching ignores case and Arabic diacritics. A record is a block of text between blank lines, such as one spreadsheet row. Searches at most 20 files and returns at most limit records; complete is false when results were cut.",
        "operationId": "searchKnowledgeBase",
        "parameters": [
          {
            "name": "knowledge_base_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Knowledge Base Id"
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "\\S",
              "title": "Query"
            }
          },
          {
            "name": "file_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "File Id"
            }
          },
          {
            "name": "language_code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Language"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Language Code"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeBaseSearchResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The knowledge base or file was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "scenarios:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Search a knowledge base",
            "sidebarTitle": "Search a knowledge base"
          }
        }
      }
    },
    "/scenarios/{scenario_id}/prompt": {
      "get": {
        "tags": [
          "Scenario Prompts"
        ],
        "summary": "Read a scenario prompt",
        "description": "Read a scenario's prompt for each language: the text new calls use now, the latest draft that is not published yet, and updated_at, which saving needs.",
        "operationId": "getScenarioPrompt",
        "parameters": [
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Scenario Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioPromptResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The scenario was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request or the stored scenario is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "scenarios:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Read a scenario prompt",
            "sidebarTitle": "Read a scenario prompt"
          }
        }
      },
      "put": {
        "tags": [
          "Scenario Prompts"
        ],
        "summary": "Save a scenario prompt draft",
        "description": "Save new prompt text for one of the scenario's languages as a draft. The draft never reaches calls from here: new calls keep the current prompt until someone publishes the draft in the Sarj dashboard. Nothing else in the scenario changes; the other languages keep the text of the latest draft if there is one, otherwise of the current prompt. Fails with 409 if the scenario changed after it was read, or while language changes wait for publishing.",
        "operationId": "saveScenarioPrompt",
        "parameters": [
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Scenario Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveScenarioPromptRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SaveScenarioPromptResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The scenario was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request or the stored scenario is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The scenario changed after it was read, or cannot take this action now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "prompt_writes",
          "permission": "scenarios:write"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Save a scenario prompt draft",
            "sidebarTitle": "Save a scenario prompt draft"
          }
        }
      }
    },
    "/scenarios/{scenario_id}/languages": {
      "post": {
        "tags": [
          "Scenario Prompts"
        ],
        "summary": "Add a scenario language as a draft",
        "description": "Add a language to a scenario, with its prompt, greeting and persona, as a draft. New calls do not use the language until someone publishes the draft in the Sarj dashboard. The other languages keep the text of the latest draft if there is one. Fails with 409 if the scenario changed after it was read, or while language changes already wait for publishing.",
        "operationId": "addScenarioLanguage",
        "parameters": [
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Scenario Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddScenarioLanguageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioPromptResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The scenario was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request or the stored scenario is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The scenario changed after it was read, or cannot take this action now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "prompt_writes",
          "permission": "scenarios:write"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Add a scenario language as a draft",
            "sidebarTitle": "Add a scenario language as a draft"
          }
        }
      }
    },
    "/scenarios/{scenario_id}/languages/{language}": {
      "delete": {
        "tags": [
          "Scenario Prompts"
        ],
        "summary": "Remove a scenario language as a draft",
        "description": "Remove a language from a scenario as a draft. New calls keep using the language until someone publishes the draft in the Sarj dashboard. The default language and the only language cannot be removed. Fails with 409 if the scenario changed after it was read, or while language changes already wait for publishing.",
        "operationId": "removeScenarioLanguage",
        "parameters": [
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Scenario Id"
            }
          },
          {
            "name": "language",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Language"
            }
          },
          {
            "name": "expected_updated_at",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "The updated_at value from the prompt read before this.",
              "title": "Expected Updated At"
            },
            "description": "The updated_at value from the prompt read before this."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioPromptResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The scenario was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request or the stored scenario is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The scenario changed after it was read, or cannot take this action now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "prompt_writes",
          "permission": "scenarios:write"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Remove a scenario language as a draft",
            "sidebarTitle": "Remove a scenario language as a draft"
          }
        }
      }
    },
    "/integrations": {
      "get": {
        "tags": [
          "Integrations"
        ],
        "summary": "List integrations",
        "description": "List the connections and integrations this organization can use, without secrets, and the dashboard links where a person sets up new ones.",
        "operationId": "listIntegrations",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "scenarios:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "List integrations",
            "sidebarTitle": "List integrations"
          }
        }
      }
    },
    "/personas": {
      "get": {
        "tags": [
          "Personas"
        ],
        "summary": "List personas",
        "description": "List the organization's personas: voice, persona text and pronunciations.",
        "operationId": "listPersonas",
        "parameters": [
          {
            "name": "language",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Language"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Language"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "scenarios:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "List personas",
            "sidebarTitle": "List personas"
          }
        }
      },
      "post": {
        "tags": [
          "Personas"
        ],
        "summary": "Create a persona",
        "description": "Create a persona with a voice, persona text and pronunciations. Its other settings are copied from the organization's default persona in that language. A new persona is not used by any scenario until one is set to use it.",
        "operationId": "createPersona",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePersonaRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The organization has no persona in this language to copy from.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "scenario_writes",
          "permission": "scenarios:write"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Create a persona",
            "sidebarTitle": "Create a persona"
          }
        }
      }
    },
    "/voices": {
      "get": {
        "tags": [
          "Personas"
        ],
        "summary": "List voices",
        "description": "List the active voices a persona can use.",
        "operationId": "listVoices",
        "parameters": [
          {
            "name": "language",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Language"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Language"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "scenarios:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "List voices",
            "sidebarTitle": "List voices"
          }
        }
      }
    },
    "/personas/{persona_id}": {
      "patch": {
        "tags": [
          "Personas"
        ],
        "summary": "Update a persona",
        "description": "Change a persona's text, pronunciations or voice. Refused with 409 while any live scenario uses the persona, or if the persona changed after it was read.",
        "operationId": "updatePersona",
        "parameters": [
          {
            "name": "persona_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Persona Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePersonaRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonaResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The persona was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "A live scenario uses the persona, live status is unavailable, or it changed after it was read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "scenario_writes",
          "permission": "scenarios:write"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Update a persona",
            "sidebarTitle": "Update a persona"
          }
        }
      }
    },
    "/feedback": {
      "post": {
        "tags": [
          "Feedback"
        ],
        "summary": "Send feedback to Sarj",
        "description": "Send feedback to the Sarj team when these tools could not do what the user asked. Use it when no tool can do the task (missing), a tool failed or returned something wrong (broken), a tool or its result was unclear (confusing), or the user suggests an improvement or asks you to send feedback (idea). Send it at most once per task, and never to log progress or to test it. Describe what the user wanted and what was missing in general terms. Never include secrets, credentials, phone numbers, call transcripts or other customer data. Tell the user you sent feedback. Feedback goes to Sarj's team, not to the user's organization.",
        "operationId": "sendFeedbackToSarj",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendFeedbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SentFeedbackResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Only an API key with an organization can send feedback.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Feedback is not available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "This API key reached its daily feedback limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mcp-annotations": {
          "readOnlyHint": false,
          "destructiveHint": false,
          "idempotentHint": false,
          "openWorldHint": false
        },
        "x-mint": {
          "metadata": {
            "title": "Send feedback to Sarj",
            "sidebarTitle": "Send feedback to Sarj"
          }
        }
      }
    },
    "/calls/{call_id}/transcript": {
      "get": {
        "tags": [
          "Call History"
        ],
        "summary": "Get a call transcript",
        "description": "Get the turns the agent heard and spoke during a call, with UTC times and call offsets.",
        "operationId": "getCallTranscript",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Call Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallTranscriptResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The call was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "calls:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Get a call transcript",
            "sidebarTitle": "Get a call transcript"
          }
        }
      }
    },
    "/calls/{call_id}/analysis": {
      "get": {
        "tags": [
          "Call History"
        ],
        "summary": "Get a call analysis",
        "description": "Get the data a call collected, its outcome, caller experience and quality flags. Fields stay null until post-call analysis finishes.",
        "operationId": "getCallAnalysis",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Call Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallAnalysisResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "This API key or organization cannot use this action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The call was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error with a request ID for support correlation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-mcp-gate": {
          "capability": "reads",
          "permission": "calls:read"
        },
        "x-hidden": true,
        "x-speakeasy-ignore": true,
        "x-mint": {
          "metadata": {
            "title": "Get a call analysis",
            "sidebarTitle": "Get a call analysis"
          }
        }
      }
    }
  },
  "webhooks": {
    "callEnded": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Receive a call outcome",
        "description": "Sent to your webhook URL, not a Sarj API endpoint. Use its optional configured credential, not your API key. Persist and deduplicate by `call_id`, then acknowledge within 5 seconds. `complete` includes voicemail; inspect `payload.call_data.status` for its outcome.",
        "operationId": "receiveCallEnded",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookNotification"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Your receiver rejected the configured credential."
          },
          "422": {
            "description": "Your receiver rejected an invalid notification."
          },
          "500": {
            "description": "Your receiver could not durably store the notification."
          }
        },
        "security": [],
        "x-mint": {
          "metadata": {
            "title": "Receive a call outcome",
            "sidebarTitle": "Receive a call outcome"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AddScenarioLanguageRequest": {
        "properties": {
          "language": {
            "$ref": "#/components/schemas/Language"
          },
          "prompt": {
            "type": "string",
            "maxLength": 200000,
            "minLength": 1,
            "pattern": "^[^\\x00]*$",
            "title": "Prompt"
          },
          "greeting": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200000,
                "pattern": "^[^\\x00]*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Greeting",
            "description": "What the agent says first in this language; omitted or null, no greeting."
          },
          "persona_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Persona Id",
            "description": "A persona in this language; omitted, the organization's default one."
          },
          "expected_updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expected Updated At",
            "description": "The updated_at value from the prompt read before this."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "language",
          "prompt",
          "expected_updated_at"
        ],
        "title": "AddScenarioLanguageRequest"
      },
      "AgentFailureReason": {
        "type": "string",
        "enum": [
          "comprehension_failure",
          "flow_deviation",
          "handling_breakdown",
          "delivery_friction",
          "transfer_trigger_failure",
          "fallback_failure",
          "termination_failure",
          "logging_discrepancy"
        ],
        "title": "AgentFailureReason"
      },
      "AgentOutcomeStatus": {
        "type": "string",
        "enum": [
          "helpful",
          "not_helpful",
          "no_answer"
        ],
        "title": "AgentOutcomeStatus"
      },
      "ApiResponse_HealthStatus_": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HealthStatus"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "ApiResponse[HealthStatus]"
      },
      "ApiResponse_PublicCallDetail_": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PublicCallDetail"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "ApiResponse[PublicCallDetail]"
      },
      "ApiResponse_PublicCall_": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PublicCall"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "ApiResponse[PublicCall]"
      },
      "ApiResponse_PublicScheduleConfig_": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PublicScheduleConfig"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "ApiResponse[PublicScheduleConfig]"
      },
      "AuthConnectionStatus": {
        "type": "string",
        "enum": [
          "pending",
          "active",
          "failed",
          "disabled"
        ],
        "title": "AuthConnectionStatus"
      },
      "CallAnalysisAgentOutcome": {
        "properties": {
          "status": {
            "$ref": "#/components/schemas/AgentOutcomeStatus"
          },
          "reason": {
            "type": "string",
            "title": "Reason"
          },
          "failure_reasons": {
            "items": {
              "$ref": "#/components/schemas/AgentFailureReason"
            },
            "type": "array",
            "title": "Failure Reasons"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status",
          "reason",
          "failure_reasons"
        ],
        "title": "CallAnalysisAgentOutcome"
      },
      "CallAnalysisCallerExperience": {
        "properties": {
          "sentiment": {
            "$ref": "#/components/schemas/CallerSentiment"
          },
          "rating": {
            "type": "integer",
            "title": "Rating",
            "description": "Caller experience rating from 1 to 5."
          },
          "rating_rationale": {
            "type": "string",
            "title": "Rating Rationale"
          },
          "purpose": {
            "type": "string",
            "title": "Purpose"
          },
          "purpose_achieved": {
            "type": "boolean",
            "title": "Purpose Achieved"
          },
          "purpose_outcome": {
            "type": "string",
            "title": "Purpose Outcome"
          },
          "feeling_keywords": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Feeling Keywords"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "sentiment",
          "rating",
          "rating_rationale",
          "purpose",
          "purpose_achieved",
          "purpose_outcome",
          "feeling_keywords"
        ],
        "title": "CallAnalysisCallerExperience"
      },
      "CallAnalysisData": {
        "properties": {
          "call_id": {
            "type": "string",
            "title": "Call Id"
          },
          "collected_data": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Collected Data",
            "description": "Data post-call analysis collected; null until it collects data."
          },
          "outcome": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PublicCallOutcome"
              },
              {
                "type": "null"
              }
            ],
            "description": "Outcome against success criteria; null until analyzed."
          },
          "agent_outcome": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CallAnalysisAgentOutcome"
              },
              {
                "type": "null"
              }
            ]
          },
          "caller_experience": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CallAnalysisCallerExperience"
              },
              {
                "type": "null"
              }
            ]
          },
          "flags": {
            "items": {
              "$ref": "#/components/schemas/CallAnalysisFlag"
            },
            "type": "array",
            "title": "Flags",
            "description": "Quality flags detected in the call."
          },
          "analysis_state": {
            "$ref": "#/components/schemas/CallAnalysisState"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "call_id",
          "collected_data",
          "outcome",
          "agent_outcome",
          "caller_experience",
          "flags",
          "analysis_state"
        ],
        "title": "CallAnalysisData"
      },
      "CallAnalysisFlag": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "priority": {
            "$ref": "#/components/schemas/FlagPriority"
          },
          "severity": {
            "$ref": "#/components/schemas/DetectionSeverity"
          },
          "explanation": {
            "type": "string",
            "title": "Explanation"
          },
          "evidence": {
            "type": "string",
            "title": "Evidence"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "priority",
          "severity",
          "explanation",
          "evidence"
        ],
        "title": "CallAnalysisFlag"
      },
      "CallAnalysisResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/CallAnalysisData"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "CallAnalysisResponse"
      },
      "CallAnalysisState": {
        "properties": {
          "flags": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FlagsState"
              },
              {
                "type": "null"
              }
            ],
            "description": "Quality flag analysis state; null before it starts."
          },
          "caller_experience": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ExperienceState"
              },
              {
                "type": "null"
              }
            ],
            "description": "Caller experience analysis state; null before it starts."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "flags",
          "caller_experience"
        ],
        "title": "CallAnalysisState"
      },
      "CallCompletedWebhookPayload": {
        "properties": {
          "type": {
            "type": "string",
            "const": "complete",
            "title": "Type",
            "default": "complete"
          },
          "call_started": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Call Started"
          },
          "response_body": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Body"
          },
          "call_data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CallData"
              },
              {
                "type": "null"
              }
            ]
          },
          "retry_attempt_number": {
            "type": "integer",
            "exclusiveMinimum": 0.0,
            "title": "Retry Attempt Number",
            "default": 1
          },
          "root_call_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Root Call Id"
          },
          "next_retry_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Retry At"
          }
        },
        "type": "object",
        "required": [
          "response_body",
          "call_data",
          "type"
        ],
        "title": "CallCompletedWebhookPayload"
      },
      "CallData": {
        "properties": {
          "call_id": {
            "type": "string",
            "title": "Call Id"
          },
          "direction": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PhoneDirection"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Number"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CallStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "total_duration": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Duration"
          },
          "enhanced_transcript": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enhanced Transcript"
          },
          "report": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Report"
          },
          "recording_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recording Url"
          },
          "permanent_recording_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Permanent Recording Url"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "interaction_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InteractionType"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "call_id",
          "created_at"
        ],
        "title": "CallData"
      },
      "CallField": {
        "properties": {
          "source": {
            "type": "string",
            "const": "call_field",
            "title": "Source"
          },
          "field": {
            "$ref": "#/components/schemas/CallViewField"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source",
          "field"
        ],
        "title": "CallField",
        "description": "A field of the finished call's `CallView`. Only resolvable after the call ends."
      },
      "CallLimitExceededPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "call_limit_exceeded",
            "title": "Type",
            "default": "call_limit_exceeded"
          },
          "phone_number": {
            "type": "string",
            "title": "Phone Number",
            "description": "The phone number that hit the limit."
          },
          "call_limit": {
            "type": "integer",
            "title": "Call Limit",
            "description": "The per-number call limit that was reached."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "phone_number",
          "call_limit",
          "type"
        ],
        "title": "CallLimitExceededPayload"
      },
      "CallListData": {
        "properties": {
          "calls": {
            "items": {
              "$ref": "#/components/schemas/CallSummary"
            },
            "type": "array",
            "title": "Calls"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor",
            "description": "Pass as cursor to read the next page; null on the last."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "calls",
          "next_cursor"
        ],
        "title": "CallListData"
      },
      "CallListResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/CallListData"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "CallListResponse"
      },
      "CallNotCompletedType": {
        "type": "string",
        "enum": [
          "failed",
          "automation",
          "user_rejected",
          "user_unavailable",
          "no_answer",
          "rejected_by_carrier",
          "invalid_number",
          "sip_trunk_failure",
          "cancelled",
          "expired"
        ],
        "title": "CallNotCompletedType"
      },
      "CallNotCompletedWebhookPayload": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/CallNotCompletedType"
          },
          "retry_attempt_number": {
            "type": "integer",
            "exclusiveMinimum": 0.0,
            "title": "Retry Attempt Number",
            "default": 1
          },
          "root_call_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Root Call Id"
          },
          "next_retry_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Retry At"
          }
        },
        "type": "object",
        "required": [
          "type"
        ],
        "title": "CallNotCompletedWebhookPayload"
      },
      "CallNotFoundPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "call_not_found",
            "title": "Type",
            "default": "call_not_found"
          },
          "call_id": {
            "type": "string",
            "title": "Call Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "call_id",
          "type"
        ],
        "title": "CallNotFoundPayload"
      },
      "CallNotPendingPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "call_not_pending",
            "title": "Type",
            "default": "call_not_pending"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "status",
          "type"
        ],
        "title": "CallNotPendingPayload"
      },
      "CallOutcomeStatus": {
        "type": "string",
        "enum": [
          "success",
          "failure",
          "error"
        ],
        "title": "CallOutcomeStatus"
      },
      "CallStatus": {
        "type": "string",
        "enum": [
          "queued",
          "in_progress",
          "transferring",
          "transferred",
          "completed",
          "timeout",
          "user_rejected",
          "max_duration_reached",
          "failed",
          "ringing",
          "voicemail",
          "dialing",
          "cancelled",
          "expired",
          "scheduled"
        ],
        "title": "CallStatus"
      },
      "CallSummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CallStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "scenario_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scenario Id"
          },
          "direction": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PhoneDirection"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "duration": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration",
            "description": "Duration in seconds; null before the call ends."
          },
          "outcome": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CallOutcomeStatus"
              },
              {
                "type": "null"
              }
            ],
            "description": "Post-call outcome; null until the analysis is ready."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "status",
          "scenario_id",
          "direction",
          "created_at",
          "started_at",
          "ended_at",
          "duration",
          "outcome"
        ],
        "title": "CallSummary"
      },
      "CallTranscriptData": {
        "properties": {
          "call_id": {
            "type": "string",
            "title": "Call Id"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "turns": {
            "items": {
              "$ref": "#/components/schemas/CallTranscriptTurn"
            },
            "type": "array",
            "title": "Turns",
            "description": "Spoken or typed turns in order; empty until the call ends."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "call_id",
          "started_at",
          "turns"
        ],
        "title": "CallTranscriptData"
      },
      "CallTranscriptResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/CallTranscriptData"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "CallTranscriptResponse"
      },
      "CallTranscriptTurn": {
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ],
            "title": "Role"
          },
          "text": {
            "type": "string",
            "title": "Text"
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp",
            "description": "When the turn was recorded, in UTC."
          },
          "offset_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Offset Ms",
            "description": "Milliseconds from the call's started_at to timestamp."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "role",
          "text",
          "timestamp",
          "offset_ms"
        ],
        "title": "CallTranscriptTurn"
      },
      "CallViewField": {
        "type": "string",
        "enum": [
          "platform_url",
          "created_at"
        ],
        "title": "CallViewField"
      },
      "CallerSentiment": {
        "type": "string",
        "enum": [
          "positive",
          "neutral",
          "frustrated",
          "angry"
        ],
        "title": "CallerSentiment"
      },
      "CheckKind": {
        "type": "string",
        "enum": [
          "deterministic",
          "judgment"
        ],
        "title": "CheckKind"
      },
      "ConflictPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "conflict",
            "title": "Type",
            "default": "conflict"
          },
          "code": {
            "type": "string",
            "title": "Code",
            "description": "Machine-readable reason for the conflict; `conflict` when none is given."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "code",
          "type"
        ],
        "title": "ConflictPayload"
      },
      "ConnectorActionSink": {
        "properties": {
          "type": {
            "type": "string",
            "const": "connector_action",
            "title": "Type",
            "default": "connector_action"
          },
          "connector_id": {
            "type": "string",
            "minLength": 1,
            "title": "Connector Id"
          },
          "operation_id": {
            "type": "string",
            "pattern": "^[a-z][A-Za-z0-9]{2,63}$",
            "title": "Operation Id"
          },
          "on_connect": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/FieldUpdateOnCallConnect"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "On Connect",
            "description": "Inputs for the call made after a connected call. None makes no call."
          },
          "on_no_connect": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/FieldUpdateOnNoCallConnect"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "On No Connect",
            "description": "Inputs for the call made when the call did not connect. None makes no call."
          },
          "credentials": {
            "items": {
              "$ref": "#/components/schemas/ConnectorCredentialInput"
            },
            "type": "array",
            "title": "Credentials",
            "description": "Inputs filled from stored credentials, sent with whichever outcome runs.",
            "default": []
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "connector_id",
          "operation_id",
          "type"
        ],
        "title": "ConnectorActionSink",
        "description": "Calls one connector action after the call; each input is mapped like a Zoho field."
      },
      "ConnectorActionSummary": {
        "properties": {
          "operation_id": {
            "type": "string",
            "title": "Operation Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "side_effects": {
            "$ref": "#/components/schemas/SideEffects"
          },
          "requires_confirmation": {
            "type": "boolean",
            "title": "Requires Confirmation"
          },
          "inputs": {
            "items": {
              "$ref": "#/components/schemas/ConnectorInput"
            },
            "type": "array",
            "title": "Inputs"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "operation_id",
          "title",
          "description",
          "side_effects",
          "requires_confirmation",
          "inputs"
        ],
        "title": "ConnectorActionSummary"
      },
      "ConnectorCredentialInput": {
        "properties": {
          "provider_api_name": {
            "type": "string",
            "minLength": 1,
            "title": "Provider Api Name",
            "description": "Name of the action input to fill."
          },
          "credential": {
            "$ref": "#/components/schemas/CredentialValue"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "provider_api_name",
          "credential"
        ],
        "title": "ConnectorCredentialInput",
        "description": "An action input filled from a stored credential; the secret is read when the action runs."
      },
      "ConnectorInput": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "location": {
            "$ref": "#/components/schemas/ParamLocation"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          },
          "required": {
            "type": "boolean",
            "title": "Required"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "location",
          "type",
          "required"
        ],
        "title": "ConnectorInput"
      },
      "ConnectorStatus": {
        "type": "string",
        "enum": [
          "pending_verification",
          "verified",
          "failing"
        ],
        "title": "ConnectorStatus"
      },
      "ConversationEndedAssertion": {
        "properties": {
          "type": {
            "type": "string",
            "const": "conversation_ended",
            "title": "Type"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type"
        ],
        "title": "ConversationEndedAssertion"
      },
      "ConversationTurn": {
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user",
              "agent"
            ],
            "title": "Role"
          },
          "text": {
            "type": "string",
            "title": "Text"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "role",
          "text"
        ],
        "title": "ConversationTurn"
      },
      "CreateCallRequest": {
        "properties": {
          "phone_number": {
            "type": "string",
            "title": "Phone Number",
            "description": "Phone number to call in E.164 format: + and the country code, with no national trunk 0 (for example +966512345678, not +9660512345678 or 0966512345678). Undialable numbers are rejected with 422.",
            "examples": [
              "+966512345678"
            ]
          },
          "scenario_id": {
            "type": "string",
            "minLength": 1,
            "title": "Scenario Id",
            "description": "Active scenario UUID from the dashboard.",
            "examples": [
              "550e8400-e29b-41d4-a716-446655440000"
            ]
          },
          "variables": {
            "additionalProperties": true,
            "type": "object",
            "title": "Variables",
            "description": "Template variables to inject into the scenario."
          },
          "language": {
            "$ref": "#/components/schemas/Language",
            "description": "Call language.",
            "default": "ar"
          },
          "scheduled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled At",
            "description": "Future dial time with timezone, 10 minutes to 30 days ahead. Omitted or null: dial now."
          },
          "schedule_config_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule Config Id",
            "description": "Retry policy ID. Omitted: use the scenario's default policy, if configured.",
            "examples": [
              "01890000-0000-7000-8000-000000000000"
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "phone_number",
          "scenario_id"
        ],
        "title": "CreateCallRequest"
      },
      "CreatePersonaRequest": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Name"
          },
          "language": {
            "$ref": "#/components/schemas/Language"
          },
          "voice_id": {
            "type": "string",
            "format": "uuid",
            "title": "Voice Id",
            "description": "An active voice in this language, from listVoices."
          },
          "persona_text": {
            "type": "string",
            "maxLength": 200000,
            "title": "Persona Text",
            "default": ""
          },
          "pronunciations": {
            "items": {
              "$ref": "#/components/schemas/PronunciationTerm"
            },
            "type": "array",
            "maxItems": 500,
            "title": "Pronunciations"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "language",
          "voice_id"
        ],
        "title": "CreatePersonaRequest"
      },
      "CreateScenarioRequest": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 1024,
            "minLength": 1,
            "title": "Name"
          },
          "languages": {
            "items": {
              "$ref": "#/components/schemas/ScenarioLanguageCreate"
            },
            "type": "array",
            "minItems": 1,
            "title": "Languages"
          },
          "variables": {
            "items": {
              "$ref": "#/components/schemas/ScenarioVariableDefinition"
            },
            "type": "array",
            "title": "Variables",
            "default": []
          },
          "knowledge_bases": {
            "items": {
              "$ref": "#/components/schemas/ScenarioKnowledgeBaseAttachment"
            },
            "type": "array",
            "title": "Knowledge Bases",
            "default": []
          },
          "success_criteria": {
            "items": {
              "$ref": "#/components/schemas/ScenarioSuccessCriterionInput"
            },
            "type": "array",
            "title": "Success Criteria",
            "default": []
          },
          "data_extraction_schema": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data Extraction Schema"
          },
          "schedule_config_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule Config Id"
          },
          "time_zone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Time Zone"
          },
          "tools": {
            "items": {
              "additionalProperties": {
                "$ref": "#/components/schemas/JsonValue"
              },
              "type": "object"
            },
            "type": "array",
            "title": "Tools",
            "description": "Tools in the shape getScenarioTools returns as config, without secret values or credentials.",
            "default": []
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "languages"
        ],
        "title": "CreateScenarioRequest"
      },
      "CreateScheduleConfigRequest": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "description": "Enable policy retries.",
            "default": true
          },
          "max_retries": {
            "type": "integer",
            "maximum": 10.0,
            "minimum": 1.0,
            "title": "Max Retries",
            "description": "Maximum additional policy retries; infrastructure failure redials do not count.",
            "examples": [
              2
            ]
          },
          "wait_between": {
            "type": "string",
            "format": "duration",
            "title": "Wait Between",
            "description": "Delay from the terminal-status update (60 seconds to 30 days).",
            "examples": [
              "PT2H"
            ]
          },
          "retry_window": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TimeWindow"
              },
              {
                "type": "null"
              }
            ],
            "description": "Daily policy retry window in `timezone`; edges must differ and may span midnight. Omitted: any hour."
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone",
            "description": "IANA zone for `retry_window`; omitted: scenario timezone.",
            "examples": [
              "Asia/Riyadh"
            ]
          },
          "expire_after": {
            "anyOf": [
              {
                "type": "string",
                "format": "duration"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expire After",
            "description": "Policy retry lifetime from the first call's end (1 hour to 7 days). Omitted: 7-day ceiling. `max_retries` may stop retries earlier.",
            "examples": [
              "P3D"
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "max_retries",
          "wait_between"
        ],
        "title": "CreateScheduleConfigRequest",
        "description": "Policy retries after eligible unsuccessful calls.\n\nInfrastructure failure redials use separate rules; the 7-day platform expiry applies to both.",
        "examples": [
          {
            "expire_after": "P3D",
            "max_retries": 2,
            "retry_window": {
              "end_edge": {
                "hour": 17,
                "minute": 0
              },
              "start_edge": {
                "hour": 9,
                "minute": 0
              }
            },
            "timezone": "Asia/Riyadh",
            "wait_between": "PT2H"
          }
        ]
      },
      "CredentialValue": {
        "properties": {
          "source": {
            "type": "string",
            "const": "credential",
            "title": "Source"
          },
          "kind": {
            "type": "string",
            "enum": [
              "auth_connection",
              "integration"
            ],
            "title": "Kind"
          },
          "auth_connection_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Auth Connection Id"
          },
          "provider": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IntegrationProvider"
              },
              {
                "type": "null"
              }
            ]
          },
          "provider_org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Org Id"
          },
          "scheme_prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheme Prefix",
            "default": "Bearer"
          }
        },
        "type": "object",
        "required": [
          "source",
          "kind"
        ],
        "title": "CredentialValue",
        "description": "A third-party credential, referenced by its owner rather than by a stored row.\n\n`kind` picks the owner: an organization's own `auth_connection`, or a native\n`integration` whose `provider_org_id` pins one account when it holds several.\n`scheme_prefix` is sent before the secret; None sends the bare secret."
      },
      "CustomScenarioStatus": {
        "type": "string",
        "enum": [
          "active",
          "draft",
          "archived"
        ],
        "title": "CustomScenarioStatus"
      },
      "DetectionSeverity": {
        "type": "string",
        "enum": [
          "mild",
          "moderate",
          "severe"
        ],
        "title": "DetectionSeverity"
      },
      "ErrorResponse": {
        "properties": {
          "error": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ValidationErrorPayload"
              },
              {
                "$ref": "#/components/schemas/UnauthorizedPayload"
              },
              {
                "$ref": "#/components/schemas/ForbiddenPayload"
              },
              {
                "$ref": "#/components/schemas/NotFoundPayload"
              },
              {
                "$ref": "#/components/schemas/InternalErrorPayload"
              },
              {
                "$ref": "#/components/schemas/PhoneNumberBlockedPayload"
              },
              {
                "$ref": "#/components/schemas/CallLimitExceededPayload"
              },
              {
                "$ref": "#/components/schemas/OutboundCallFailedPayload"
              },
              {
                "$ref": "#/components/schemas/ScenarioNotFoundPayload"
              },
              {
                "$ref": "#/components/schemas/ScenarioForbiddenPayload"
              },
              {
                "$ref": "#/components/schemas/ScenarioInvalidConfigPayload"
              },
              {
                "$ref": "#/components/schemas/NoOrganizationPayload"
              },
              {
                "$ref": "#/components/schemas/CallNotFoundPayload"
              },
              {
                "$ref": "#/components/schemas/OauthInvalidRedirectUriPayload"
              },
              {
                "$ref": "#/components/schemas/SchedulingDisabledPayload"
              },
              {
                "$ref": "#/components/schemas/InvalidScheduleTimePayload"
              },
              {
                "$ref": "#/components/schemas/ScheduleConfigNotFoundPayload"
              },
              {
                "$ref": "#/components/schemas/CallNotPendingPayload"
              },
              {
                "$ref": "#/components/schemas/ConflictPayload"
              }
            ],
            "title": "Error",
            "discriminator": {
              "propertyName": "type",
              "mapping": {
                "call_limit_exceeded": "#/components/schemas/CallLimitExceededPayload",
                "call_not_found": "#/components/schemas/CallNotFoundPayload",
                "call_not_pending": "#/components/schemas/CallNotPendingPayload",
                "conflict": "#/components/schemas/ConflictPayload",
                "forbidden": "#/components/schemas/ForbiddenPayload",
                "internal_error": "#/components/schemas/InternalErrorPayload",
                "invalid_schedule_time": "#/components/schemas/InvalidScheduleTimePayload",
                "no_organization": "#/components/schemas/NoOrganizationPayload",
                "not_found": "#/components/schemas/NotFoundPayload",
                "oauth_invalid_redirect_uri": "#/components/schemas/OauthInvalidRedirectUriPayload",
                "outbound_call_failed": "#/components/schemas/OutboundCallFailedPayload",
                "phone_number_blocked": "#/components/schemas/PhoneNumberBlockedPayload",
                "scenario_forbidden": "#/components/schemas/ScenarioForbiddenPayload",
                "scenario_invalid_config": "#/components/schemas/ScenarioInvalidConfigPayload",
                "scenario_not_found": "#/components/schemas/ScenarioNotFoundPayload",
                "schedule_config_not_found": "#/components/schemas/ScheduleConfigNotFoundPayload",
                "scheduling_disabled": "#/components/schemas/SchedulingDisabledPayload",
                "unauthorized": "#/components/schemas/UnauthorizedPayload",
                "validation_error": "#/components/schemas/ValidationErrorPayload"
              }
            }
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "error",
          "meta"
        ],
        "title": "ErrorResponse",
        "description": "Public API error. Branch on `error.type`; SDKs preserve raw payloads for unknown variants."
      },
      "ExpectedQualityFlags": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "flags": {
            "items": {
              "$ref": "#/components/schemas/ScenarioQualityFlagInput"
            },
            "type": "array",
            "maxItems": 10,
            "title": "Flags"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "enabled",
          "flags"
        ],
        "title": "ExpectedQualityFlags"
      },
      "ExperienceState": {
        "type": "string",
        "enum": [
          "pending",
          "assessed",
          "insufficient_evidence",
          "failed"
        ],
        "title": "ExperienceState"
      },
      "ExtractedData": {
        "properties": {
          "source": {
            "type": "string",
            "const": "extracted_data",
            "title": "Source"
          },
          "field": {
            "type": "string",
            "minLength": 1,
            "title": "Field"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source",
          "field"
        ],
        "title": "ExtractedData",
        "description": "A field of the post-call data extraction. Only resolvable when the call connected."
      },
      "FieldUpdateOnCallConnect": {
        "properties": {
          "provider_api_name": {
            "type": "string",
            "minLength": 1,
            "title": "Provider Api Name",
            "description": "API name of the provider field to write."
          },
          "source": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FixedScalarValue"
              },
              {
                "$ref": "#/components/schemas/ScenarioVariable"
              },
              {
                "$ref": "#/components/schemas/CallField"
              },
              {
                "$ref": "#/components/schemas/ExtractedData"
              }
            ],
            "title": "Source",
            "discriminator": {
              "propertyName": "source",
              "mapping": {
                "call_field": "#/components/schemas/CallField",
                "extracted_data": "#/components/schemas/ExtractedData",
                "fixed": "#/components/schemas/FixedScalarValue",
                "scenario_variable": "#/components/schemas/ScenarioVariable"
              }
            }
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "provider_api_name",
          "source"
        ],
        "title": "FieldUpdateOnCallConnect"
      },
      "FieldUpdateOnNoCallConnect": {
        "properties": {
          "provider_api_name": {
            "type": "string",
            "minLength": 1,
            "title": "Provider Api Name",
            "description": "API name of the provider field to write."
          },
          "source": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FixedScalarValue"
              },
              {
                "$ref": "#/components/schemas/ScenarioVariable"
              },
              {
                "$ref": "#/components/schemas/CallField"
              }
            ],
            "title": "Source",
            "discriminator": {
              "propertyName": "source",
              "mapping": {
                "call_field": "#/components/schemas/CallField",
                "fixed": "#/components/schemas/FixedScalarValue",
                "scenario_variable": "#/components/schemas/ScenarioVariable"
              }
            }
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "provider_api_name",
          "source"
        ],
        "title": "FieldUpdateOnNoCallConnect"
      },
      "FieldViolation": {
        "properties": {
          "field": {
            "type": "string",
            "title": "Field",
            "description": "Dot-separated invalid-field path.",
            "examples": [
              "phone_number.country_code"
            ]
          },
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Validation message.",
            "examples": [
              "Must start with +"
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "field",
          "message"
        ],
        "title": "FieldViolation"
      },
      "FixedScalar": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "integer"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          }
        ]
      },
      "FixedScalarValue": {
        "properties": {
          "source": {
            "type": "string",
            "const": "fixed",
            "title": "Source"
          },
          "value": {
            "$ref": "#/components/schemas/FixedScalar"
          },
          "is_encrypted": {
            "type": "boolean",
            "title": "Is Encrypted",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "source",
          "value"
        ],
        "title": "FixedScalarValue"
      },
      "FlagPriority": {
        "type": "string",
        "enum": [
          "low",
          "medium",
          "high"
        ],
        "title": "FlagPriority"
      },
      "FlagsState": {
        "type": "string",
        "enum": [
          "pending",
          "evaluated",
          "insufficient_evidence",
          "failed",
          "not_configured",
          "switched_off",
          "scenario_moved"
        ],
        "title": "FlagsState"
      },
      "ForbiddenPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "forbidden",
            "title": "Type",
            "default": "forbidden"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "type"
        ],
        "title": "ForbiddenPayload"
      },
      "Gender": {
        "type": "string",
        "enum": [
          "male",
          "female"
        ],
        "title": "Gender"
      },
      "HealthStatus": {
        "properties": {
          "status": {
            "type": "string",
            "const": "ok",
            "title": "Status",
            "description": "Health status of the API. Always `ok` when this endpoint responds successfully.",
            "examples": [
              "ok"
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "HealthStatus",
        "description": "Represents the operational status of the API."
      },
      "IntegrationConnection": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "status": {
            "$ref": "#/components/schemas/AuthConnectionStatus"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "name",
          "status"
        ],
        "title": "IntegrationConnection"
      },
      "IntegrationConnector": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "status": {
            "$ref": "#/components/schemas/ConnectorStatus"
          },
          "actions": {
            "items": {
              "$ref": "#/components/schemas/ConnectorActionSummary"
            },
            "type": "array",
            "title": "Actions"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "status",
          "actions"
        ],
        "title": "IntegrationConnector"
      },
      "IntegrationListData": {
        "properties": {
          "connections": {
            "items": {
              "$ref": "#/components/schemas/IntegrationConnection"
            },
            "type": "array",
            "title": "Connections"
          },
          "integrations": {
            "items": {
              "$ref": "#/components/schemas/NativeIntegration"
            },
            "type": "array",
            "title": "Integrations"
          },
          "connectors": {
            "items": {
              "$ref": "#/components/schemas/IntegrationConnector"
            },
            "type": "array",
            "title": "Connectors",
            "description": "Custom integrations registered on the integrations page. Empty where connectors are off."
          },
          "setup_links": {
            "$ref": "#/components/schemas/IntegrationSetupLinks"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "connections",
          "integrations",
          "connectors",
          "setup_links"
        ],
        "title": "IntegrationListData"
      },
      "IntegrationListResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/IntegrationListData"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "IntegrationListResponse"
      },
      "IntegrationProvider": {
        "type": "string",
        "enum": [
          "zoho",
          "salla",
          "salesforce"
        ],
        "title": "IntegrationProvider",
        "description": "Available integration providers.\n\n`salla-tools` and `zoho-desk-create-ticket` require external OAuth setup and are\nNEVER auto-generated in the output tool config, connected or not - suggest them\ninstead (see `Suggestion Categorization for Integration Tools` below).\n\n**Suggestion Categorization for Integration Tools:**\n\n   **Use `verification_needed`** (shows in \"Action Required\" section):\n   - When user EXPLICITLY mentions needing Salla/Zoho in their business requirements\n   - Example: User says \"We use Salla for orders\" but Salla not in active integrations\n   - This is a REQUIREMENT the user stated - they need to set it up\n\n   **Use `resource_linking`** (shows in \"Opportunities\" section):\n   - When LLM SUGGESTS an integration that could enhance the scenario\n   - User did NOT ask for this; LLM thinks it would be helpful\n   - Example: For a restaurant scenario, LLM suggests Salla could help with order tracking\n\n**Examples:**\n\nUser prompt: \"We need Salla for order management\"\nActive integrations: None connected\n→ DO NOT add a salla-tools entry to the tool config\n→ ADD `verification_needed` suggestion: \"Connect Salla Store\" with action_url=\"/integrations\"\n\nUser prompt: \"Restaurant delivery agent\" (no mention of Salla/Zoho)\nActive integrations: zoho\n→ DO NOT add a zoho-desk-create-ticket entry to the tool config\n→ Can suggest salla as `resource_linking` (optional enhancement)"
      },
      "IntegrationSetupLinks": {
        "properties": {
          "connections": {
            "type": "string",
            "title": "Connections",
            "description": "Dashboard page where a person adds a connection and enters its secret."
          },
          "integrations": {
            "type": "string",
            "title": "Integrations",
            "description": "Dashboard page where a person connects an integration."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "connections",
          "integrations"
        ],
        "title": "IntegrationSetupLinks"
      },
      "InteractionType": {
        "type": "string",
        "enum": [
          "voice",
          "chat"
        ],
        "title": "InteractionType"
      },
      "InternalErrorPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "internal_error",
            "title": "Type",
            "default": "internal_error"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "type"
        ],
        "title": "InternalErrorPayload"
      },
      "InvalidScheduleTimePayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "invalid_schedule_time",
            "title": "Type",
            "default": "invalid_schedule_time"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "type"
        ],
        "title": "InvalidScheduleTimePayload"
      },
      "JsonValue": {},
      "JudgeAssertion": {
        "properties": {
          "type": {
            "type": "string",
            "const": "judge",
            "title": "Type"
          },
          "rubric": {
            "type": "string",
            "maxLength": 2000,
            "minLength": 1,
            "title": "Rubric"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "rubric"
        ],
        "title": "JudgeAssertion"
      },
      "KnowledgeBaseDetail": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "files": {
            "items": {
              "$ref": "#/components/schemas/KnowledgeBaseFileSummary"
            },
            "type": "array",
            "title": "Files"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "title",
          "description",
          "updated_at",
          "files"
        ],
        "title": "KnowledgeBaseDetail"
      },
      "KnowledgeBaseDetailResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/KnowledgeBaseDetail"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "KnowledgeBaseDetailResponse"
      },
      "KnowledgeBaseFileContent": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "filename": {
            "type": "string",
            "title": "Filename"
          },
          "language_code": {
            "$ref": "#/components/schemas/Language"
          },
          "text": {
            "type": "string",
            "title": "Text"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "description": "Send this value as expected_updated_at when replacing the content."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "filename",
          "language_code",
          "text",
          "updated_at"
        ],
        "title": "KnowledgeBaseFileContent"
      },
      "KnowledgeBaseFileContentResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/KnowledgeBaseFileContent"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "KnowledgeBaseFileContentResponse"
      },
      "KnowledgeBaseFileRevisionListData": {
        "properties": {
          "revisions": {
            "items": {
              "$ref": "#/components/schemas/KnowledgeBaseFileRevisionSummary"
            },
            "type": "array",
            "title": "Revisions"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "revisions"
        ],
        "title": "KnowledgeBaseFileRevisionListData"
      },
      "KnowledgeBaseFileRevisionListResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/KnowledgeBaseFileRevisionListData"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "KnowledgeBaseFileRevisionListResponse"
      },
      "KnowledgeBaseFileRevisionSummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "byte_size": {
            "type": "integer",
            "title": "Byte Size"
          },
          "character_count": {
            "type": "integer",
            "title": "Character Count"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "byte_size",
          "character_count",
          "created_at"
        ],
        "title": "KnowledgeBaseFileRevisionSummary"
      },
      "KnowledgeBaseFileSummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "filename": {
            "type": "string",
            "title": "Filename"
          },
          "language_code": {
            "$ref": "#/components/schemas/Language"
          },
          "byte_size": {
            "type": "integer",
            "title": "Byte Size"
          },
          "character_count": {
            "type": "integer",
            "title": "Character Count"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "filename",
          "language_code",
          "byte_size",
          "character_count",
          "updated_at"
        ],
        "title": "KnowledgeBaseFileSummary"
      },
      "KnowledgeBaseFileSummaryResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/KnowledgeBaseFileSummary"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "KnowledgeBaseFileSummaryResponse"
      },
      "KnowledgeBaseListData": {
        "properties": {
          "knowledge_bases": {
            "items": {
              "$ref": "#/components/schemas/KnowledgeBaseSummary"
            },
            "type": "array",
            "title": "Knowledge Bases"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "knowledge_bases",
          "next_cursor"
        ],
        "title": "KnowledgeBaseListData"
      },
      "KnowledgeBaseListResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/KnowledgeBaseListData"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "KnowledgeBaseListResponse"
      },
      "KnowledgeBaseReturnedAssertion": {
        "properties": {
          "type": {
            "type": "string",
            "const": "knowledge_base_returned",
            "title": "Type"
          },
          "filename": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Filename"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "filename"
        ],
        "title": "KnowledgeBaseReturnedAssertion"
      },
      "KnowledgeBaseSearchData": {
        "properties": {
          "matches": {
            "items": {
              "$ref": "#/components/schemas/KnowledgeBaseSearchMatch"
            },
            "type": "array",
            "title": "Matches"
          },
          "complete": {
            "type": "boolean",
            "title": "Complete",
            "description": "False when more records matched than were returned, or files were left unsearched."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "matches",
          "complete"
        ],
        "title": "KnowledgeBaseSearchData"
      },
      "KnowledgeBaseSearchMatch": {
        "properties": {
          "file_id": {
            "type": "string",
            "title": "File Id"
          },
          "record": {
            "type": "string",
            "title": "Record"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "description": "The file's updated_at. Send it as expected_updated_at to replace the file."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "file_id",
          "record",
          "updated_at"
        ],
        "title": "KnowledgeBaseSearchMatch"
      },
      "KnowledgeBaseSearchResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/KnowledgeBaseSearchData"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "KnowledgeBaseSearchResponse"
      },
      "KnowledgeBaseSummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "title",
          "description",
          "updated_at"
        ],
        "title": "KnowledgeBaseSummary"
      },
      "Language": {
        "type": "string",
        "enum": [
          "en",
          "ar",
          "ur"
        ],
        "title": "Language",
        "description": "Language codes in ISO 639-1"
      },
      "LockedConnectorAction": {
        "properties": {
          "connector_id": {
            "type": "string",
            "title": "Connector Id"
          },
          "operation_id": {
            "type": "string",
            "title": "Operation Id"
          },
          "hidden_inputs": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Hidden Inputs"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "connector_id",
          "operation_id",
          "hidden_inputs"
        ],
        "title": "LockedConnectorAction"
      },
      "McpFeedbackKind": {
        "type": "string",
        "enum": [
          "missing",
          "broken",
          "confusing",
          "idea"
        ],
        "title": "McpFeedbackKind"
      },
      "NativeIntegration": {
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/IntegrationProvider"
          },
          "account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "provider",
          "account_id"
        ],
        "title": "NativeIntegration"
      },
      "NoOrganizationPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "no_organization",
            "title": "Type",
            "default": "no_organization"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "type"
        ],
        "title": "NoOrganizationPayload"
      },
      "NotFoundPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "not_found",
            "title": "Type",
            "default": "not_found"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "type"
        ],
        "title": "NotFoundPayload"
      },
      "OauthInvalidRedirectUriPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "oauth_invalid_redirect_uri",
            "title": "Type",
            "default": "oauth_invalid_redirect_uri"
          },
          "redirect_uri": {
            "type": "string",
            "title": "Redirect Uri"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "redirect_uri",
          "type"
        ],
        "title": "OauthInvalidRedirectUriPayload"
      },
      "OutboundCallFailedPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "outbound_call_failed",
            "title": "Type",
            "default": "outbound_call_failed"
          },
          "reason": {
            "type": "string",
            "title": "Reason",
            "description": "Call-service failure reason; for diagnostics."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "reason",
          "type"
        ],
        "title": "OutboundCallFailedPayload"
      },
      "ParamLocation": {
        "type": "string",
        "enum": [
          "path",
          "query",
          "body",
          "header",
          "cookie"
        ],
        "title": "ParamLocation"
      },
      "PendingLanguages": {
        "properties": {
          "added": {
            "items": {
              "$ref": "#/components/schemas/Language"
            },
            "type": "array",
            "title": "Added"
          },
          "removed": {
            "items": {
              "$ref": "#/components/schemas/Language"
            },
            "type": "array",
            "title": "Removed"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "added",
          "removed"
        ],
        "title": "PendingLanguages"
      },
      "Persona": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "language": {
            "$ref": "#/components/schemas/Language"
          },
          "voice_id": {
            "type": "string",
            "title": "Voice Id"
          },
          "voice_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice Name"
          },
          "persona_text": {
            "type": "string",
            "title": "Persona Text"
          },
          "pronunciations": {
            "items": {
              "$ref": "#/components/schemas/PronunciationTerm"
            },
            "type": "array",
            "title": "Pronunciations"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "description": "Send this value as expected_updated_at when updating the persona."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "name",
          "language",
          "voice_id",
          "voice_name",
          "persona_text",
          "pronunciations",
          "is_default",
          "updated_at"
        ],
        "title": "Persona"
      },
      "PersonaListData": {
        "properties": {
          "personas": {
            "items": {
              "$ref": "#/components/schemas/Persona"
            },
            "type": "array",
            "title": "Personas"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "personas"
        ],
        "title": "PersonaListData"
      },
      "PersonaListResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PersonaListData"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "PersonaListResponse"
      },
      "PersonaResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Persona"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "PersonaResponse"
      },
      "PhoneDirection": {
        "type": "string",
        "enum": [
          "inbound",
          "outbound"
        ],
        "title": "PhoneDirection"
      },
      "PhoneNumberBlockedPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "phone_number_blocked",
            "title": "Type",
            "default": "phone_number_blocked"
          },
          "phone_number": {
            "type": "string",
            "title": "Phone Number",
            "description": "The phone number that is blocked."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "phone_number",
          "type"
        ],
        "title": "PhoneNumberBlockedPayload"
      },
      "PostCallSyncSettings": {
        "properties": {
          "sinks": {
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ZohoRecordUpdateSink"
                },
                {
                  "$ref": "#/components/schemas/ConnectorActionSink"
                }
              ],
              "discriminator": {
                "propertyName": "type",
                "mapping": {
                  "connector_action": "#/components/schemas/ConnectorActionSink",
                  "zoho_record_update": "#/components/schemas/ZohoRecordUpdateSink"
                }
              }
            },
            "type": "array",
            "title": "Sinks"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PostCallSyncSettings"
      },
      "PronunciationTerm": {
        "properties": {
          "words": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 25,
            "minItems": 1,
            "title": "Words"
          },
          "replacement": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Replacement"
          }
        },
        "type": "object",
        "required": [
          "words",
          "replacement"
        ],
        "title": "PronunciationTerm"
      },
      "PublicCall": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Call ID.",
            "examples": [
              "550e8400-e29b-41d4-a716-446655440000"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/CallStatus",
            "description": "Call status.",
            "examples": [
              "queued"
            ]
          },
          "phone_number": {
            "type": "string",
            "title": "Phone Number",
            "description": "Destination phone number."
          },
          "scenario_id": {
            "type": "string",
            "title": "Scenario Id",
            "description": "Call scenario ID."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Created at; booking time for scheduled calls."
          },
          "scheduled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled At",
            "description": "Booked dial time; null for immediate calls."
          },
          "booking_outcome": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "created",
                  "rescheduled_existing",
                  "kept_existing"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Booking Outcome",
            "description": "Set on 202 booking responses; null otherwise. `created` adds a booking. `rescheduled_existing` or `kept_existing` reuses a pending call for the same scenario and phone; use its returned ID and time."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "status",
          "phone_number",
          "scenario_id",
          "created_at"
        ],
        "title": "PublicCall"
      },
      "PublicCallDetail": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Call ID.",
            "examples": [
              "550e8400-e29b-41d4-a716-446655440000"
            ]
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CallStatus"
              },
              {
                "type": "null"
              }
            ],
            "description": "Call status.",
            "examples": [
              "in_progress"
            ]
          },
          "phone_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Number",
            "description": "Call phone number."
          },
          "scenario_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scenario Id",
            "description": "Call scenario ID."
          },
          "language": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Language"
              },
              {
                "type": "null"
              }
            ],
            "description": "Call language."
          },
          "direction": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PhoneDirection"
              },
              {
                "type": "null"
              }
            ],
            "description": "Call direction."
          },
          "variables": {
            "additionalProperties": true,
            "type": "object",
            "title": "Variables",
            "description": "Stored scenario variables; empty when unavailable."
          },
          "duration": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration",
            "description": "Duration in seconds; null before the call ends or if unavailable."
          },
          "recording_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recording Url",
            "description": "Signed download URL; prefer `permanent_recording_url` when available. Expires 24h after issue when recording endpoints are enabled, otherwise 7d. Null before the call ends or when no recording exists.",
            "deprecated": true
          },
          "permanent_recording_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Permanent Recording Url",
            "description": "Stable recording link; requires your API key and does not expire. Null before the call ends, without a recording, or while recording endpoints are disabled (use `recording_url` during rollout)."
          },
          "transcript": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/PublicTranscriptMessage"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transcript",
            "description": "Spoken messages in order; null before the call ends or when unavailable."
          },
          "report": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PublicCallReport"
              },
              {
                "type": "null"
              }
            ],
            "description": "Async post-call assessment for `completed` or `max_duration_reached` calls. Null until ready, for other terminal statuses, or permanently if analysis fails or is skipped. Bound polling; webhooks carry the final available outcome."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Created at; booking time for scheduled calls."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "description": "Last updated."
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At",
            "description": "Answered at."
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At",
            "description": "Ended at."
          },
          "scheduled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled At",
            "description": "Booked dial time for a scheduled call or platform retry; null for immediate calls."
          },
          "is_retry": {
            "type": "boolean",
            "title": "Is Retry",
            "description": "Whether this is a platform-booked retry.",
            "default": false
          },
          "retry_attempt_number": {
            "type": "integer",
            "title": "Retry Attempt Number",
            "description": "Dial attempt number, starting at 1.",
            "default": 1
          },
          "root_call_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Root Call Id",
            "description": "First attempt's call ID; null on the first or only attempt."
          },
          "next_retry_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Retry At",
            "description": "Next pending dial time in this retry group; null if none."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "created_at",
          "updated_at"
        ],
        "title": "PublicCallDetail"
      },
      "PublicCallOutcome": {
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "success",
              "failure",
              "error"
            ],
            "title": "Status",
            "description": "Outcome against scenario criteria; `error` means assessment failed.",
            "examples": [
              "success"
            ]
          },
          "reason": {
            "type": "string",
            "title": "Reason",
            "description": "Outcome explanation."
          },
          "success_criteria": {
            "items": {
              "$ref": "#/components/schemas/PublicSuccessCriteriaResult"
            },
            "type": "array",
            "title": "Success Criteria",
            "description": "Per-criterion results."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status",
          "reason",
          "success_criteria"
        ],
        "title": "PublicCallOutcome"
      },
      "PublicCallReport": {
        "properties": {
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At",
            "description": "Report generated at."
          },
          "outcome": {
            "$ref": "#/components/schemas/PublicCallOutcome",
            "description": "Call outcome assessment."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "generated_at",
          "outcome"
        ],
        "title": "PublicCallReport"
      },
      "PublicScheduleConfig": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Retry policy ID; pass as `schedule_config_id` when creating calls.",
            "examples": [
              "01890000-0000-7000-8000-000000000000"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Created at."
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "description": "Whether policy retries are enabled."
          },
          "max_retries": {
            "type": "integer",
            "title": "Max Retries",
            "description": "Maximum policy retries; infrastructure failure redials do not count."
          },
          "wait_between": {
            "type": "string",
            "format": "duration",
            "title": "Wait Between",
            "description": "Delay from the terminal-status update (ISO 8601 duration)."
          },
          "retry_window": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TimeWindow"
              },
              {
                "type": "null"
              }
            ],
            "description": "Daily policy retry window."
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone",
            "description": "IANA zone for the retry window."
          },
          "expire_after": {
            "anyOf": [
              {
                "type": "string",
                "format": "duration"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expire After",
            "description": "Policy retry lifetime from the first call's end."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "created_at",
          "enabled",
          "max_retries",
          "wait_between"
        ],
        "title": "PublicScheduleConfig",
        "description": "Policy retries after eligible unsuccessful calls.\n\nInfrastructure failure redials use separate rules; the 7-day platform expiry applies to both."
      },
      "PublicSuccessCriteriaResult": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Configured scenario criterion."
          },
          "achieved": {
            "type": "boolean",
            "title": "Achieved",
            "description": "Whether the criterion was met."
          },
          "is_primary": {
            "type": "boolean",
            "title": "Is Primary",
            "description": "Whether this is the primary scenario criterion."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "text",
          "achieved",
          "is_primary"
        ],
        "title": "PublicSuccessCriteriaResult"
      },
      "PublicTranscriptMessage": {
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ],
            "title": "Role",
            "description": "Speaker: `user` (customer) or `assistant` (AI)."
          },
          "content": {
            "type": "string",
            "title": "Content",
            "description": "Spoken text."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "title": "PublicTranscriptMessage"
      },
      "RecordedKnowledgeBaseSearch": {
        "properties": {
          "query": {
            "type": "string",
            "title": "Query"
          },
          "files": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Files"
          },
          "result": {
            "type": "string",
            "title": "Result"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "query",
          "files",
          "result"
        ],
        "title": "RecordedKnowledgeBaseSearch"
      },
      "RecordedToolCall": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "arguments": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "result": {
            "type": "string",
            "title": "Result"
          },
          "mocked": {
            "type": "boolean",
            "title": "Mocked"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "arguments",
          "result",
          "mocked"
        ],
        "title": "RecordedToolCall"
      },
      "RecordingDestination": {
        "properties": {
          "type": {
            "type": "string",
            "const": "zoho_crm_call_activity",
            "title": "Type",
            "default": "zoho_crm_call_activity"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "RecordingDestination",
        "required": [
          "type"
        ]
      },
      "ReplaceKnowledgeBaseFileContentRequest": {
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 1000000,
            "minLength": 1,
            "title": "Text"
          },
          "expected_updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expected Updated At",
            "description": "The updated_at value from the content this edit is based on."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "text",
          "expected_updated_at"
        ],
        "title": "ReplaceKnowledgeBaseFileContentRequest"
      },
      "ReplyContainsAssertion": {
        "properties": {
          "type": {
            "type": "string",
            "const": "reply_contains",
            "title": "Type"
          },
          "text": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1,
            "title": "Text"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "text"
        ],
        "title": "ReplyContainsAssertion"
      },
      "ReplyNotContainsAssertion": {
        "properties": {
          "type": {
            "type": "string",
            "const": "reply_not_contains",
            "title": "Type"
          },
          "text": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1,
            "title": "Text"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "text"
        ],
        "title": "ReplyNotContainsAssertion"
      },
      "RescheduleCallRequest": {
        "properties": {
          "scheduled_at": {
            "type": "string",
            "format": "date-time",
            "title": "Scheduled At",
            "description": "New dial time with timezone, 10 minutes to 30 days ahead."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "scheduled_at"
        ],
        "title": "RescheduleCallRequest"
      },
      "ResponseMeta": {
        "properties": {
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id",
            "description": "Opaque correlation ID, also in `X-Request-ID`. Reuses that request header when non-empty, otherwise generates an ID. If null, use the response header.",
            "examples": [
              "550e8400-e29b-41d4-a716-446655440000"
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ResponseMeta",
        "description": "Request metadata."
      },
      "RestoreKnowledgeBaseFileRevisionRequest": {
        "properties": {
          "expected_updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expected Updated At",
            "description": "The updated_at value of the file's current content."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "expected_updated_at"
        ],
        "title": "RestoreKnowledgeBaseFileRevisionRequest"
      },
      "SaveScenarioPromptRequest": {
        "properties": {
          "language": {
            "$ref": "#/components/schemas/Language",
            "description": "One of the scenario's languages."
          },
          "text": {
            "type": "string",
            "maxLength": 200000,
            "minLength": 1,
            "pattern": "^[^\\x00]*$",
            "title": "Text"
          },
          "expected_updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expected Updated At",
            "description": "The updated_at value from the prompt this edit is based on."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "language",
          "text",
          "expected_updated_at"
        ],
        "title": "SaveScenarioPromptRequest"
      },
      "SaveScenarioPromptResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/SaveScenarioPromptResult"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "SaveScenarioPromptResponse"
      },
      "SaveScenarioPromptResult": {
        "properties": {
          "outcome": {
            "type": "string",
            "enum": [
              "draft_saved",
              "unchanged"
            ],
            "title": "Outcome",
            "description": "draft_saved: a new draft waits for someone to publish it in the Sarj dashboard; new calls keep the current prompt until then. unchanged: the text matched the prompt it would replace."
          },
          "prompt": {
            "$ref": "#/components/schemas/ScenarioPrompt"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "outcome",
          "prompt"
        ],
        "title": "SaveScenarioPromptResult"
      },
      "SaveScenarioToolRequest": {
        "properties": {
          "tool": {
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            },
            "type": "object",
            "title": "Tool",
            "description": "The whole tool, in the shape getScenarioTools returns as config. A credential stays only where the stored tool already sends it to the same host."
          },
          "expected_updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expected Updated At",
            "description": "The updated_at value this change is based on."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "tool",
          "expected_updated_at"
        ],
        "title": "SaveScenarioToolRequest"
      },
      "ScenarioDetail": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "status": {
            "$ref": "#/components/schemas/CustomScenarioStatus"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "live": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Live",
            "description": "Null when live status is not available."
          },
          "languages": {
            "items": {
              "$ref": "#/components/schemas/ScenarioLanguage"
            },
            "type": "array",
            "title": "Languages"
          },
          "tools": {
            "items": {
              "$ref": "#/components/schemas/ScenarioTool"
            },
            "type": "array",
            "title": "Tools"
          },
          "knowledge_bases": {
            "items": {
              "$ref": "#/components/schemas/ScenarioKnowledgeBase"
            },
            "type": "array",
            "title": "Knowledge Bases"
          },
          "variables": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Variables",
            "description": "Names of the variables a call can set."
          },
          "variable_definitions": {
            "items": {
              "$ref": "#/components/schemas/ScenarioVariableDefinition"
            },
            "type": "array",
            "title": "Variable Definitions"
          },
          "success_criteria": {
            "items": {
              "$ref": "#/components/schemas/ScenarioSuccessCriterion"
            },
            "type": "array",
            "title": "Success Criteria"
          },
          "data_extraction_schema": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data Extraction Schema",
            "description": "JSON Schema of the data extracted after each call. Null when extraction is off."
          },
          "time_zone": {
            "type": "string",
            "title": "Time Zone"
          },
          "schedule_config_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule Config Id",
            "description": "The retry schedule used for this scenario's calls."
          },
          "post_call_sync": {
            "$ref": "#/components/schemas/PostCallSyncSettings",
            "description": "Post-call sync entries. A connector action leaves out inputs whose fixed values could carry secrets."
          },
          "recording_destinations": {
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ZohoCallActivitySink"
                }
              ],
              "discriminator": {
                "propertyName": "type",
                "mapping": {
                  "zoho_crm_call_activity": "#/components/schemas/ZohoCallActivitySink"
                }
              }
            },
            "type": "array",
            "title": "Recording Destinations",
            "description": "Where each call's recording is sent."
          },
          "locked_connector_actions": {
            "items": {
              "$ref": "#/components/schemas/LockedConnectorAction"
            },
            "type": "array",
            "title": "Locked Connector Actions",
            "description": "Connector actions whose hidden_inputs are left out of post_call_sync. They change only in the dashboard; sending one back unchanged keeps it as stored."
          },
          "quality_flags": {
            "$ref": "#/components/schemas/ScenarioQualityFlags"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "updated_at",
          "live",
          "languages",
          "tools",
          "knowledge_bases",
          "variables",
          "variable_definitions",
          "success_criteria",
          "data_extraction_schema",
          "time_zone",
          "schedule_config_id",
          "post_call_sync",
          "recording_destinations",
          "locked_connector_actions",
          "quality_flags"
        ],
        "title": "ScenarioDetail"
      },
      "ScenarioDetailResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ScenarioDetail"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "ScenarioDetailResponse"
      },
      "ScenarioForbiddenPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "scenario_forbidden",
            "title": "Type",
            "default": "scenario_forbidden"
          },
          "scenario_id": {
            "type": "string",
            "title": "Scenario Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "scenario_id",
          "type"
        ],
        "title": "ScenarioForbiddenPayload"
      },
      "ScenarioInvalidConfigPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "scenario_invalid_config",
            "title": "Type",
            "default": "scenario_invalid_config"
          },
          "scenario_id": {
            "type": "string",
            "title": "Scenario Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "scenario_id",
          "type"
        ],
        "title": "ScenarioInvalidConfigPayload"
      },
      "ScenarioKnowledgeBase": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "use_case": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Use Case",
            "description": "When the agent should search this knowledge base."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "name",
          "use_case"
        ],
        "title": "ScenarioKnowledgeBase"
      },
      "ScenarioKnowledgeBaseAttachment": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "use_case": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Use Case"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id"
        ],
        "title": "ScenarioKnowledgeBaseAttachment"
      },
      "ScenarioLanguage": {
        "properties": {
          "language": {
            "$ref": "#/components/schemas/Language"
          },
          "default": {
            "type": "boolean",
            "title": "Default"
          },
          "greeting": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Greeting",
            "description": "What the agent says first. Null when the agent waits for the caller."
          },
          "prompt": {
            "type": "string",
            "title": "Prompt",
            "description": "The scenario prompt that calls receive now."
          },
          "unpublished_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unpublished Prompt",
            "description": "A newer saved prompt that calls do not receive until it is published. Null when there is none."
          },
          "voice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice"
          },
          "persona_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Persona Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "language",
          "default",
          "greeting",
          "prompt",
          "unpublished_prompt",
          "voice",
          "persona_id"
        ],
        "title": "ScenarioLanguage"
      },
      "ScenarioLanguageCreate": {
        "properties": {
          "language": {
            "$ref": "#/components/schemas/Language"
          },
          "default": {
            "type": "boolean",
            "title": "Default",
            "default": false
          },
          "greeting": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Greeting",
            "description": "Null makes the agent wait for the caller."
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "title": "Prompt"
          },
          "persona_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Persona Id",
            "description": "Omit to use the organization's default persona."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "language",
          "greeting",
          "prompt"
        ],
        "title": "ScenarioLanguageCreate"
      },
      "ScenarioLanguageUpdate": {
        "properties": {
          "language": {
            "$ref": "#/components/schemas/Language"
          },
          "default": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default"
          },
          "greeting": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Greeting",
            "description": "Null makes the agent wait for the caller."
          },
          "persona_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Persona Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "language"
        ],
        "title": "ScenarioLanguageUpdate"
      },
      "ScenarioListData": {
        "properties": {
          "scenarios": {
            "items": {
              "$ref": "#/components/schemas/ScenarioSummary"
            },
            "type": "array",
            "title": "Scenarios"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor",
            "description": "Send as cursor to read the next page. Null on the last page."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "scenarios",
          "next_cursor"
        ],
        "title": "ScenarioListData"
      },
      "ScenarioListResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ScenarioListData"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "ScenarioListResponse"
      },
      "ScenarioNotFoundPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "scenario_not_found",
            "title": "Type",
            "default": "scenario_not_found"
          },
          "scenario_id": {
            "type": "string",
            "title": "Scenario Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "scenario_id",
          "type"
        ],
        "title": "ScenarioNotFoundPayload"
      },
      "ScenarioPrompt": {
        "properties": {
          "scenario_id": {
            "type": "string",
            "title": "Scenario Id"
          },
          "prompts": {
            "items": {
              "$ref": "#/components/schemas/ScenarioPromptText"
            },
            "type": "array",
            "title": "Prompts",
            "description": "The prompt new calls use now, for each language."
          },
          "draft_prompt": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ScenarioPromptText"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Draft Prompt",
            "description": "The latest draft, which new calls do not use until someone publishes it in the Sarj dashboard, or null when there is none."
          },
          "pending_languages": {
            "$ref": "#/components/schemas/PendingLanguages",
            "description": "Languages the latest draft adds or removes; they change only when the draft is published."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "description": "Send this value as expected_updated_at when saving."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "scenario_id",
          "prompts",
          "draft_prompt",
          "pending_languages",
          "updated_at"
        ],
        "title": "ScenarioPrompt"
      },
      "ScenarioPromptResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ScenarioPrompt"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "ScenarioPromptResponse"
      },
      "ScenarioPromptText": {
        "properties": {
          "language": {
            "$ref": "#/components/schemas/Language"
          },
          "text": {
            "type": "string",
            "title": "Text"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "language",
          "text"
        ],
        "title": "ScenarioPromptText"
      },
      "ScenarioQualityFlag": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "priority": {
            "$ref": "#/components/schemas/FlagPriority"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "priority",
          "enabled"
        ],
        "title": "ScenarioQualityFlag"
      },
      "ScenarioQualityFlagInput": {
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id",
            "description": "An existing flag to keep. Omit to add a flag."
          },
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name"
          },
          "description": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1,
            "title": "Description"
          },
          "priority": {
            "$ref": "#/components/schemas/FlagPriority",
            "default": "medium"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "description"
        ],
        "title": "ScenarioQualityFlagInput"
      },
      "ScenarioQualityFlags": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "description": "Whether calls are checked for these flags after they end."
          },
          "flags": {
            "items": {
              "$ref": "#/components/schemas/ScenarioQualityFlag"
            },
            "type": "array",
            "title": "Flags"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "enabled",
          "flags"
        ],
        "title": "ScenarioQualityFlags"
      },
      "ScenarioSuccessCriterion": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          },
          "is_primary": {
            "type": "boolean",
            "title": "Is Primary"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "text",
          "is_primary"
        ],
        "title": "ScenarioSuccessCriterion"
      },
      "ScenarioSuccessCriterionInput": {
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 5000,
            "title": "Text"
          },
          "is_primary": {
            "type": "boolean",
            "title": "Is Primary"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "text",
          "is_primary"
        ],
        "title": "ScenarioSuccessCriterionInput"
      },
      "ScenarioSummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "status": {
            "$ref": "#/components/schemas/CustomScenarioStatus"
          },
          "languages": {
            "items": {
              "$ref": "#/components/schemas/Language"
            },
            "type": "array",
            "title": "Languages"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "languages",
          "updated_at"
        ],
        "title": "ScenarioSummary"
      },
      "ScenarioTestCheck": {
        "properties": {
          "index": {
            "type": "integer",
            "title": "Index"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "kind": {
            "$ref": "#/components/schemas/CheckKind"
          },
          "passed": {
            "type": "boolean",
            "title": "Passed"
          },
          "evidence": {
            "type": "string",
            "title": "Evidence"
          },
          "judge_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Judge Model"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "index",
          "type",
          "kind",
          "passed",
          "evidence"
        ],
        "title": "ScenarioTestCheck"
      },
      "ScenarioTestProvenance": {
        "properties": {
          "version": {
            "$ref": "#/components/schemas/ScenarioTestVersion",
            "description": "The prompt that ran: draft (the latest saved version, not yet published) or live. A draft request runs live when the scenario has no unpublished draft."
          },
          "prompt_version_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Version Id",
            "description": "The scenario version whose prompt ran; null when the scenario has no saved version."
          },
          "scenario_updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scenario Updated At"
          },
          "knowledge_base_files": {
            "items": {
              "$ref": "#/components/schemas/SnapshotKnowledgeBaseFile"
            },
            "type": "array",
            "title": "Knowledge Base Files"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "version",
          "prompt_version_id",
          "scenario_updated_at",
          "knowledge_base_files"
        ],
        "title": "ScenarioTestProvenance"
      },
      "ScenarioTestRequest": {
        "properties": {
          "language": {
            "$ref": "#/components/schemas/Language"
          },
          "turns": {
            "items": {
              "type": "string",
              "maxLength": 2000,
              "minLength": 1
            },
            "type": "array",
            "maxItems": 20,
            "minItems": 1,
            "title": "Turns",
            "description": "Typed user messages, sent one at a time."
          },
          "assertions": {
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ToolCalledAssertion"
                },
                {
                  "$ref": "#/components/schemas/ReplyContainsAssertion"
                },
                {
                  "$ref": "#/components/schemas/ReplyNotContainsAssertion"
                },
                {
                  "$ref": "#/components/schemas/KnowledgeBaseReturnedAssertion"
                },
                {
                  "$ref": "#/components/schemas/ConversationEndedAssertion"
                },
                {
                  "$ref": "#/components/schemas/JudgeAssertion"
                }
              ],
              "discriminator": {
                "propertyName": "type",
                "mapping": {
                  "conversation_ended": "#/components/schemas/ConversationEndedAssertion",
                  "judge": "#/components/schemas/JudgeAssertion",
                  "knowledge_base_returned": "#/components/schemas/KnowledgeBaseReturnedAssertion",
                  "reply_contains": "#/components/schemas/ReplyContainsAssertion",
                  "reply_not_contains": "#/components/schemas/ReplyNotContainsAssertion",
                  "tool_called": "#/components/schemas/ToolCalledAssertion"
                }
              }
            },
            "type": "array",
            "maxItems": 20,
            "title": "Assertions"
          },
          "tool_mocks": {
            "$ref": "#/components/schemas/ScenarioTestToolMocks"
          },
          "score": {
            "type": "boolean",
            "title": "Score",
            "description": "true (default): the test call gets post-call analysis: collected data, the outcome against the success criteria, caller experience and quality flags. false: no analysis. A test call never sends webhooks or CRM syncs and never books callbacks.",
            "default": true
          },
          "max_duration_seconds": {
            "type": "integer",
            "maximum": 300.0,
            "minimum": 10.0,
            "title": "Max Duration Seconds",
            "default": 120
          },
          "version": {
            "$ref": "#/components/schemas/ScenarioTestVersion",
            "description": "draft (default): the latest saved prompt, including one not yet published. live: the published prompt.",
            "default": "draft"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "language",
          "turns"
        ],
        "title": "ScenarioTestRequest"
      },
      "ScenarioTestResult": {
        "properties": {
          "conversation": {
            "items": {
              "$ref": "#/components/schemas/ConversationTurn"
            },
            "type": "array",
            "title": "Conversation"
          },
          "tool_calls": {
            "items": {
              "$ref": "#/components/schemas/RecordedToolCall"
            },
            "type": "array",
            "title": "Tool Calls"
          },
          "knowledge_base_searches": {
            "items": {
              "$ref": "#/components/schemas/RecordedKnowledgeBaseSearch"
            },
            "type": "array",
            "title": "Knowledge Base Searches"
          },
          "failure": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failure"
          },
          "checks": {
            "items": {
              "$ref": "#/components/schemas/ScenarioTestCheck"
            },
            "type": "array",
            "title": "Checks"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ScenarioTestResult"
      },
      "ScenarioTestRunDetail": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "scenario_id": {
            "type": "string",
            "title": "Scenario Id"
          },
          "status": {
            "$ref": "#/components/schemas/ScenarioTestRunStatus"
          },
          "call_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Call Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "score": {
            "type": "boolean",
            "title": "Score",
            "description": "Whether the run's test call gets post-call analysis."
          },
          "request": {
            "$ref": "#/components/schemas/ScenarioTestRequest"
          },
          "provenance": {
            "$ref": "#/components/schemas/ScenarioTestProvenance"
          },
          "result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScenarioTestResult"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "scenario_id",
          "status",
          "call_id",
          "created_at",
          "started_at",
          "finished_at",
          "score",
          "request",
          "provenance",
          "result"
        ],
        "title": "ScenarioTestRunDetail"
      },
      "ScenarioTestRunItem": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "scenario_id": {
            "type": "string",
            "title": "Scenario Id"
          },
          "status": {
            "$ref": "#/components/schemas/ScenarioTestRunStatus"
          },
          "call_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Call Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "score": {
            "type": "boolean",
            "title": "Score",
            "description": "Whether the run's test call gets post-call analysis."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "scenario_id",
          "status",
          "call_id",
          "created_at",
          "started_at",
          "finished_at",
          "score"
        ],
        "title": "ScenarioTestRunItem"
      },
      "ScenarioTestRunListData": {
        "properties": {
          "runs": {
            "items": {
              "$ref": "#/components/schemas/ScenarioTestRunItem"
            },
            "type": "array",
            "title": "Runs"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "runs",
          "next_cursor"
        ],
        "title": "ScenarioTestRunListData"
      },
      "ScenarioTestRunListResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ScenarioTestRunListData"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "ScenarioTestRunListResponse"
      },
      "ScenarioTestRunResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ScenarioTestRunDetail"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "ScenarioTestRunResponse"
      },
      "ScenarioTestRunStatus": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "passed",
          "failed",
          "error",
          "canceled"
        ],
        "title": "ScenarioTestRunStatus"
      },
      "ScenarioTestToolMocks": {
        "properties": {
          "default_result": {
            "type": "string",
            "maxLength": 4000,
            "title": "Default Result",
            "description": "Returned by every mocked tool without its own result.",
            "default": "{\"status\": \"success\"}"
          },
          "results": {
            "additionalProperties": {
              "type": "string",
              "maxLength": 4000
            },
            "propertyNames": {
              "maxLength": 64,
              "minLength": 1
            },
            "type": "object",
            "maxProperties": 50,
            "title": "Results",
            "description": "Result per tool name."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ScenarioTestToolMocks"
      },
      "ScenarioTestVersion": {
        "type": "string",
        "enum": [
          "draft",
          "live"
        ],
        "title": "ScenarioTestVersion"
      },
      "ScenarioTool": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "parameters": {
            "items": {
              "$ref": "#/components/schemas/ScenarioToolParameter"
            },
            "type": "array",
            "title": "Parameters",
            "description": "Arguments the agent supplies when it uses the tool."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "description",
          "parameters"
        ],
        "title": "ScenarioTool"
      },
      "ScenarioToolConfig": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "The custom API tool's name, a connected app tool's connector_id.operation_id, or the built-in tool's type."
          },
          "type": {
            "$ref": "#/components/schemas/ToolTypeSlug"
          },
          "editable": {
            "type": "boolean",
            "title": "Editable",
            "description": "False when the tool holds a value that could be a secret. Such values read as null, and only the dashboard can change the tool."
          },
          "config": {
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            },
            "type": "object",
            "title": "Config",
            "description": "The tool's settings. Connections appear by id, never as secrets."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "type",
          "editable",
          "config"
        ],
        "title": "ScenarioToolConfig"
      },
      "ScenarioToolParameter": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "type": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "boolean",
              "array"
            ],
            "title": "Type"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "required": {
            "type": "boolean",
            "title": "Required"
          },
          "allowed_values": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Values"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "type",
          "description",
          "required",
          "allowed_values"
        ],
        "title": "ScenarioToolParameter"
      },
      "ScenarioToolsData": {
        "properties": {
          "tools": {
            "items": {
              "$ref": "#/components/schemas/ScenarioToolConfig"
            },
            "type": "array",
            "title": "Tools"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "tools",
          "updated_at"
        ],
        "title": "ScenarioToolsData"
      },
      "ScenarioToolsResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ScenarioToolsData"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "ScenarioToolsResponse"
      },
      "ScenarioVariable": {
        "properties": {
          "source": {
            "type": "string",
            "const": "scenario_variable",
            "title": "Source"
          },
          "variable_id": {
            "type": "string",
            "minLength": 1,
            "title": "Variable Id"
          }
        },
        "type": "object",
        "required": [
          "source",
          "variable_id"
        ],
        "title": "ScenarioVariable"
      },
      "ScenarioVariableDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "number",
              "boolean"
            ],
            "title": "Type"
          },
          "required": {
            "type": "boolean",
            "title": "Required"
          },
          "default": {
            "$ref": "#/components/schemas/JsonValue",
            "description": "Null when unset or private: a custom API tool sends the variable, or its name looks like a credential."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "type",
          "required"
        ],
        "title": "ScenarioVariableDefinition"
      },
      "ScheduleConfigNotFoundPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "schedule_config_not_found",
            "title": "Type",
            "default": "schedule_config_not_found"
          },
          "schedule_config_id": {
            "type": "string",
            "title": "Schedule Config Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "schedule_config_id",
          "type"
        ],
        "title": "ScheduleConfigNotFoundPayload"
      },
      "SchedulingDisabledPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "scheduling_disabled",
            "title": "Type",
            "default": "scheduling_disabled"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "type"
        ],
        "title": "SchedulingDisabledPayload"
      },
      "SendFeedbackRequest": {
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/McpFeedbackKind"
          },
          "description": {
            "type": "string",
            "maxLength": 2000,
            "minLength": 1,
            "pattern": "^\\s*[^\\s\\x00][^\\x00]*$",
            "title": "Description",
            "description": "What the user wanted and what was missing, in general terms."
          },
          "tool_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100,
                "pattern": "^[^\\x00]*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Name",
            "description": "The tool this feedback is about, if any."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind",
          "description"
        ],
        "title": "SendFeedbackRequest"
      },
      "SentFeedback": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id"
        ],
        "title": "SentFeedback"
      },
      "SentFeedbackResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/SentFeedback"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "SentFeedbackResponse"
      },
      "SideEffects": {
        "type": "string",
        "enum": [
          "read",
          "write",
          "destructive"
        ],
        "title": "SideEffects"
      },
      "SnapshotKnowledgeBaseFile": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "knowledge_base_id": {
            "type": "string",
            "title": "Knowledge Base Id"
          },
          "filename": {
            "type": "string",
            "title": "Filename"
          },
          "language_code": {
            "$ref": "#/components/schemas/Language"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "description": "When this file's content last changed; the revision the run saw."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "knowledge_base_id",
          "filename",
          "language_code",
          "updated_at"
        ],
        "title": "SnapshotKnowledgeBaseFile"
      },
      "StartScenarioTestRunRequest": {
        "properties": {
          "language": {
            "$ref": "#/components/schemas/Language"
          },
          "turns": {
            "items": {
              "type": "string",
              "maxLength": 2000,
              "minLength": 1
            },
            "type": "array",
            "maxItems": 20,
            "minItems": 1,
            "title": "Turns",
            "description": "Typed user messages, sent one at a time."
          },
          "assertions": {
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ToolCalledAssertion"
                },
                {
                  "$ref": "#/components/schemas/ReplyContainsAssertion"
                },
                {
                  "$ref": "#/components/schemas/ReplyNotContainsAssertion"
                },
                {
                  "$ref": "#/components/schemas/KnowledgeBaseReturnedAssertion"
                },
                {
                  "$ref": "#/components/schemas/ConversationEndedAssertion"
                },
                {
                  "$ref": "#/components/schemas/JudgeAssertion"
                }
              ],
              "discriminator": {
                "propertyName": "type",
                "mapping": {
                  "conversation_ended": "#/components/schemas/ConversationEndedAssertion",
                  "judge": "#/components/schemas/JudgeAssertion",
                  "knowledge_base_returned": "#/components/schemas/KnowledgeBaseReturnedAssertion",
                  "reply_contains": "#/components/schemas/ReplyContainsAssertion",
                  "reply_not_contains": "#/components/schemas/ReplyNotContainsAssertion",
                  "tool_called": "#/components/schemas/ToolCalledAssertion"
                }
              }
            },
            "type": "array",
            "maxItems": 20,
            "title": "Assertions"
          },
          "tool_mocks": {
            "$ref": "#/components/schemas/ScenarioTestToolMocks"
          },
          "score": {
            "type": "boolean",
            "title": "Score",
            "description": "true (default): the test call gets post-call analysis: collected data, the outcome against the success criteria, caller experience and quality flags. false: no analysis. A test call never sends webhooks or CRM syncs and never books callbacks.",
            "default": true
          },
          "max_duration_seconds": {
            "type": "integer",
            "maximum": 300.0,
            "minimum": 10.0,
            "title": "Max Duration Seconds",
            "default": 120
          },
          "version": {
            "$ref": "#/components/schemas/ScenarioTestVersion",
            "description": "draft (default): the latest saved prompt, including one not yet published. live: the published prompt.",
            "default": "draft"
          },
          "scenario_id": {
            "type": "string",
            "format": "uuid",
            "title": "Scenario Id"
          },
          "variables": {
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            },
            "type": "object",
            "title": "Variables",
            "description": "Values for the scenario's template variables."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "language",
          "turns",
          "scenario_id"
        ],
        "title": "StartScenarioTestRunRequest"
      },
      "TimeEdge": {
        "properties": {
          "hour": {
            "type": "integer",
            "maximum": 23.0,
            "minimum": 0.0,
            "title": "Hour"
          },
          "minute": {
            "type": "integer",
            "maximum": 59.0,
            "minimum": 0.0,
            "title": "Minute"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "hour",
          "minute"
        ],
        "title": "TimeEdge"
      },
      "TimeWindow": {
        "properties": {
          "start_edge": {
            "$ref": "#/components/schemas/TimeEdge"
          },
          "end_edge": {
            "$ref": "#/components/schemas/TimeEdge"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "start_edge",
          "end_edge"
        ],
        "title": "TimeWindow"
      },
      "ToolCalledAssertion": {
        "properties": {
          "type": {
            "type": "string",
            "const": "tool_called",
            "title": "Type"
          },
          "tool": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "title": "Tool"
          },
          "arguments": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Arguments",
            "description": "Argument values the call must include; other arguments are ignored."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "tool"
        ],
        "title": "ToolCalledAssertion"
      },
      "ToolTypeSlug": {
        "type": "string",
        "enum": [
          "code-switching",
          "collect-digits",
          "transfer-to-human",
          "end-call",
          "zoho-desk-create-ticket",
          "custom-api",
          "salla-tools",
          "ivr-navigation",
          "voicemail-detection",
          "schedule-callback",
          "connector-action"
        ],
        "title": "ToolTypeSlug"
      },
      "UnauthorizedPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "unauthorized",
            "title": "Type",
            "default": "unauthorized"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "type"
        ],
        "title": "UnauthorizedPayload"
      },
      "UpdatePersonaRequest": {
        "properties": {
          "expected_updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expected Updated At",
            "description": "The updated_at value this change is based on."
          },
          "persona_text": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200000
              },
              {
                "type": "null"
              }
            ],
            "title": "Persona Text"
          },
          "pronunciations": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/PronunciationTerm"
                },
                "type": "array",
                "maxItems": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Pronunciations",
            "description": "Replaces the pronunciations."
          },
          "voice_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice Id",
            "description": "An active voice in the persona's language."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "expected_updated_at"
        ],
        "title": "UpdatePersonaRequest"
      },
      "UpdateScenarioQualityFlagsRequest": {
        "properties": {
          "expected_updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expected Updated At",
            "description": "The updated_at value this change is based on."
          },
          "expected_quality_flags": {
            "$ref": "#/components/schemas/ExpectedQualityFlags",
            "description": "The quality_flags value this change is based on, as getScenario returned it."
          },
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          },
          "flags": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ScenarioQualityFlagInput"
                },
                "type": "array",
                "maxItems": 10
              },
              {
                "type": "null"
              }
            ],
            "title": "Flags",
            "description": "Replaces the flags. Flags left out are removed."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "expected_updated_at",
          "expected_quality_flags"
        ],
        "title": "UpdateScenarioQualityFlagsRequest"
      },
      "UpdateScenarioRequest": {
        "properties": {
          "expected_updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expected Updated At",
            "description": "The updated_at value this change is based on."
          },
          "languages": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ScenarioLanguageUpdate"
                },
                "type": "array",
                "minItems": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Languages"
          },
          "variables": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ScenarioVariableDefinition"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variables",
            "description": "Replaces the scenario's own variables."
          },
          "knowledge_bases": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ScenarioKnowledgeBaseAttachment"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Knowledge Bases",
            "description": "Replaces the attached knowledge bases."
          },
          "success_criteria": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ScenarioSuccessCriterionInput"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Success Criteria"
          },
          "data_extraction_schema": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data Extraction Schema",
            "description": "Null turns extraction off."
          },
          "schedule_config_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule Config Id",
            "description": "Null removes the retry schedule."
          },
          "time_zone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Time Zone"
          },
          "post_call_sync": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PostCallSyncSettings"
              },
              {
                "type": "null"
              }
            ],
            "description": "Replaces every post-call sync entry, connector actions included: send back the entries you read to keep them, and an entry left out is removed. Zoho entries need Zoho connected. A new or changed connector action must use a connector, action and inputs listed by listIntegrations, and fills credentials only from the organization's connections. An action listed in locked_connector_actions changes only in the dashboard: send it back unchanged to keep it."
          },
          "recording_destinations": {
            "anyOf": [
              {
                "items": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/RecordingDestination"
                    }
                  ],
                  "discriminator": {
                    "propertyName": "type",
                    "mapping": {
                      "zoho_crm_call_activity": "#/components/schemas/RecordingDestination"
                    }
                  }
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recording Destinations",
            "description": "Replaces where each call's recording is sent. Needs the CRM integration connected."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "expected_updated_at"
        ],
        "title": "UpdateScenarioRequest"
      },
      "ValidationErrorPayload": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "For display; branch on `type`, not this text."
          },
          "type": {
            "type": "string",
            "const": "validation_error",
            "title": "Type",
            "default": "validation_error"
          },
          "field_violations": {
            "items": {
              "$ref": "#/components/schemas/FieldViolation"
            },
            "type": "array",
            "title": "Field Violations",
            "description": "Per-field validation details."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message",
          "field_violations",
          "type"
        ],
        "title": "ValidationErrorPayload"
      },
      "Voice": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "language": {
            "$ref": "#/components/schemas/Language"
          },
          "gender": {
            "$ref": "#/components/schemas/Gender"
          },
          "vibe": {
            "type": "string",
            "title": "Vibe"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "name",
          "language",
          "gender",
          "vibe"
        ],
        "title": "Voice"
      },
      "VoiceListData": {
        "properties": {
          "voices": {
            "items": {
              "$ref": "#/components/schemas/Voice"
            },
            "type": "array",
            "title": "Voices"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "voices"
        ],
        "title": "VoiceListData"
      },
      "VoiceListResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/VoiceListData"
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "title": "VoiceListResponse"
      },
      "WebhookNotification": {
        "properties": {
          "call_id": {
            "type": "string",
            "title": "Call Id"
          },
          "payload": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CallCompletedWebhookPayload"
              },
              {
                "$ref": "#/components/schemas/CallNotCompletedWebhookPayload"
              }
            ],
            "title": "Payload"
          }
        },
        "type": "object",
        "required": [
          "call_id",
          "payload"
        ],
        "title": "WebhookNotification",
        "x-speakeasy-include": true
      },
      "ZohoCallActivitySink": {
        "properties": {
          "type": {
            "type": "string",
            "const": "zoho_crm_call_activity",
            "title": "Type",
            "default": "zoho_crm_call_activity"
          }
        },
        "type": "object",
        "title": "ZohoCallActivitySink",
        "required": [
          "type"
        ]
      },
      "ZohoNoteOnCallConnect": {
        "properties": {
          "title": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FixedScalarValue"
              },
              {
                "$ref": "#/components/schemas/ScenarioVariable"
              },
              {
                "$ref": "#/components/schemas/CallField"
              },
              {
                "$ref": "#/components/schemas/ExtractedData"
              }
            ],
            "title": "Title",
            "discriminator": {
              "propertyName": "source",
              "mapping": {
                "call_field": "#/components/schemas/CallField",
                "extracted_data": "#/components/schemas/ExtractedData",
                "fixed": "#/components/schemas/FixedScalarValue",
                "scenario_variable": "#/components/schemas/ScenarioVariable"
              }
            }
          },
          "content": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FixedScalarValue"
              },
              {
                "$ref": "#/components/schemas/ScenarioVariable"
              },
              {
                "$ref": "#/components/schemas/CallField"
              },
              {
                "$ref": "#/components/schemas/ExtractedData"
              }
            ],
            "title": "Content",
            "discriminator": {
              "propertyName": "source",
              "mapping": {
                "call_field": "#/components/schemas/CallField",
                "extracted_data": "#/components/schemas/ExtractedData",
                "fixed": "#/components/schemas/FixedScalarValue",
                "scenario_variable": "#/components/schemas/ScenarioVariable"
              }
            }
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "title",
          "content"
        ],
        "title": "ZohoNoteOnCallConnect"
      },
      "ZohoNoteOnNoCallConnect": {
        "properties": {
          "title": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FixedScalarValue"
              },
              {
                "$ref": "#/components/schemas/ScenarioVariable"
              },
              {
                "$ref": "#/components/schemas/CallField"
              }
            ],
            "title": "Title",
            "discriminator": {
              "propertyName": "source",
              "mapping": {
                "call_field": "#/components/schemas/CallField",
                "fixed": "#/components/schemas/FixedScalarValue",
                "scenario_variable": "#/components/schemas/ScenarioVariable"
              }
            }
          },
          "content": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FixedScalarValue"
              },
              {
                "$ref": "#/components/schemas/ScenarioVariable"
              },
              {
                "$ref": "#/components/schemas/CallField"
              }
            ],
            "title": "Content",
            "discriminator": {
              "propertyName": "source",
              "mapping": {
                "call_field": "#/components/schemas/CallField",
                "fixed": "#/components/schemas/FixedScalarValue",
                "scenario_variable": "#/components/schemas/ScenarioVariable"
              }
            }
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "title",
          "content"
        ],
        "title": "ZohoNoteOnNoCallConnect"
      },
      "ZohoRecordUpdateSink": {
        "properties": {
          "type": {
            "type": "string",
            "const": "zoho_record_update",
            "title": "Type",
            "default": "zoho_record_update"
          },
          "module": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z][A-Za-z0-9_]{0,79}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Module",
            "description": "Module the updates were set up for. Writes go to each call's zoho_module; a mismatch logs a warning."
          },
          "on_connect": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ZohoUpdatesOnCallConnect"
              },
              {
                "type": "null"
              }
            ],
            "description": "Written after a connected call's analysis. None writes nothing."
          },
          "on_no_connect": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ZohoUpdatesOnNoCallConnect"
              },
              {
                "type": "null"
              }
            ],
            "description": "Written when the call did not connect. None writes nothing."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ZohoRecordUpdateSink",
        "required": [
          "type"
        ]
      },
      "ZohoUpdatesOnCallConnect": {
        "properties": {
          "fields": {
            "items": {
              "$ref": "#/components/schemas/FieldUpdateOnCallConnect"
            },
            "type": "array",
            "title": "Fields",
            "default": []
          },
          "note": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ZohoNoteOnCallConnect"
              },
              {
                "type": "null"
              }
            ],
            "description": "None writes no note."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ZohoUpdatesOnCallConnect"
      },
      "ZohoUpdatesOnNoCallConnect": {
        "properties": {
          "fields": {
            "items": {
              "$ref": "#/components/schemas/FieldUpdateOnNoCallConnect"
            },
            "type": "array",
            "title": "Fields",
            "default": []
          },
          "note": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ZohoNoteOnNoCallConnect"
              },
              {
                "type": "null"
              }
            ],
            "description": "None writes no note."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ZohoUpdatesOnNoCallConnect"
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key from your Sarj.ai dashboard."
      }
    }
  },
  "tags": [
    {
      "name": "System",
      "description": "Service health and status."
    },
    {
      "name": "Calls",
      "description": "Create outbound voice calls and retrieve call details and transcripts."
    },
    {
      "name": "Call History",
      "description": "List calls and read call transcripts with timestamps."
    },
    {
      "name": "Schedule Configs",
      "description": "Create and manage retry policies for scheduled outbound calls."
    },
    {
      "name": "Scenarios",
      "description": "Read scenario configuration."
    },
    {
      "name": "Knowledge Bases",
      "description": "Read and replace knowledge base content."
    },
    {
      "name": "Scenario Tests",
      "description": "Run automated chat tests against a scenario with mocked tools and read their results."
    },
    {
      "name": "Scenario Prompts",
      "description": "Read scenario prompts and save prompt drafts."
    },
    {
      "name": "Integrations",
      "description": "List the connections and integrations an organization can use, without secrets."
    },
    {
      "name": "Scenario Tools",
      "description": "Read and change a scenario's tools without values that could be secrets."
    },
    {
      "name": "Personas",
      "description": "Read, create and update personas, and read voices."
    },
    {
      "name": "Feedback",
      "description": "Send feedback about these tools to the Sarj team."
    },
    {
      "name": "Webhooks",
      "description": "Receive call outcomes at your configured endpoint."
    }
  ],
  "externalDocs": {
    "description": "Sarj.ai Documentation",
    "url": "https://platform-docs.sarj.ai"
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ]
}
