{"id":80,"library":"vonage","title":"Vonage Application API (via Vonage Python SDK)","description":"The `vonage` Python SDK (currently v4.x.x) provides a streamlined interface to interact with various Vonage APIs, including the Application API. Vonage Applications are a core concept for configuring security and capabilities (like Voice, Messages, RTC) for your Vonage services. This SDK is actively maintained with a regular release cadence, with version 4.x.x being a significant rewrite of previous major versions. While a `vonage-application` PyPI package exists (v2.0.1), the recommended and actively supported way to manage Vonage Applications programmatically in Python is through the main `vonage` SDK.","status":"active","version":"4.7.2","language":"python","source_language":"en","source_url":"https://github.com/Vonage/vonage-python-sdk","tags":["communications","API","vonage","application management","voice","messages","RTC"],"install":[{"cmd":"pip install vonage","lang":"bash","label":"Install latest Vonage SDK"},{"cmd":"pip install 'vonage<4'","lang":"bash","label":"Install Vonage SDK v3.x.x (Legacy)"}],"dependencies":[],"imports":[{"note":"As of v4.0.0, the primary client class is `Vonage` and `Auth` is used for credentials, replacing the old `vonage.Client`.","wrong":"import vonage\nclient = vonage.Client(key=api_key, secret=api_secret)","symbol":"Vonage","correct":"from vonage import Vonage, Auth"},{"note":"Data models like ApplicationConfig are now imported from their specific API sub-packages within the monorepo structure introduced in v4.x.x.","symbol":"ApplicationConfig","correct":"from vonage_application import ApplicationConfig"},{"note":"In v4.x.x, API functionalities are accessed via lowercase attributes on the `Vonage` client instance (e.g., `client.application`), not directly as capitalized classes on the client.","wrong":"vonage_client.Application","symbol":"Application","correct":"vonage_client.application"}],"quickstart":{"code":"import os\nfrom vonage import Vonage, Auth\nfrom vonage_application import ApplicationConfig\n\nVONAGE_API_KEY = os.environ.get('VONAGE_API_KEY', 'YOUR_API_KEY')\nVONAGE_API_SECRET = os.environ.get('VONAGE_API_SECRET', 'YOUR_API_SECRET')\n\n# Initialize Vonage client with API key and secret\nauth = Auth(api_key=VONAGE_API_KEY, api_secret=VONAGE_API_SECRET)\nvonage_client = Vonage(auth=auth)\n\n# Create a new Vonage Application\ntry:\n    application_data = vonage_client.application.create_application(\n        ApplicationConfig(name='MyTestPythonApp', capabilities={'voice': {'webhooks': {'answer_url': {'address': 'https://example.com/answer', 'http_method': 'GET'}}}}) # Example with voice capability\n    )\n    print(f\"Application created successfully: {application_data.name} (ID: {application_data.id})\")\n    \n    # List applications (demonstrates another API call)\n    applications = vonage_client.application.list_applications()\n    print(\"\\nAll Applications:\")\n    for app in applications.embedded.applications:\n        print(f\"- {app.name} (ID: {app.id})\")\n\nexcept Exception as e:\n    print(f\"Error creating or listing application: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize the Vonage client using API key and secret, then create a new Vonage Application with voice capabilities, and finally list all existing applications. It uses the `vonage` SDK (v4.x.x) which is the current recommended approach for interacting with the Application API. Ensure `VONAGE_API_KEY` and `VONAGE_API_SECRET` environment variables are set or replaced."},"warnings":[{"fix":"Refer to the official v3 to v4 migration guide. Update client initialization, method calls, and data model imports. For example, `client = vonage.Vonage(auth=Auth(api_key=..., api_secret=...))` and `from vonage_application import ApplicationConfig`.","message":"Vonage Python SDK v4.x.x is a complete rewrite of v3.x.x. The main client class changed from `vonage.Client` to `vonage.Vonage`, and API methods are now accessed via attributes (e.g., `client.application.create_application()` instead of `client.create_application()`). Data models are now Pydantic-based and imported from specific sub-packages (e.g., `vonage_application.ApplicationConfig`).","severity":"breaking","affected_versions":"v3.x.x to v4.x.x"},{"fix":"Always install and use the `vonage` package (e.g., `pip install vonage`) for general Vonage API interactions, including application management. Consult the official Vonage Developer documentation for Python SDK usage, which focuses on the `vonage` package.","message":"Confusing 'vonage-application' PyPI package with the main SDK. The `vonage-application` package (v2.0.1) is likely an older or highly specialized component, and the primary way to manage Vonage Applications is through the comprehensive `vonage` Python SDK (v4.x.x).","severity":"gotcha","affected_versions":"All versions"},{"fix":"When creating the `Auth` object for `vonage.Vonage`, use `Auth(application_id='your_app_id', private_key='path/to/private.key')` for application-specific APIs requiring JWT authentication. Ensure the private key file exists and the path is correct.","message":"Authentication for certain APIs (like Voice) requires an Application ID and its private key, not just API Key and Secret. Mixing these can lead to authentication errors.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-05-12T07:51:08.132Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure you are using `vonage.Vonage` for v4.x.x, and access application methods via `vonage_client.application.method_name()`. If on v3, the methods were often directly on the client (e.g., `client.create_application()`), but upgrading to v4 is recommended.","cause":"Attempting to use v4.x.x application API methods on a v3.x.x `vonage.Client` instance or trying to access the application functionality incorrectly in v4.","error":"AttributeError: 'Client' object has no attribute 'application'"},{"fix":"Ensure `pip install vonage` has been run. The `vonage` package in v4 is a monorepo that includes `vonage_application` as a dependency. If running in an isolated environment, verify the virtual environment is activated and dependencies are correctly installed. Also, check for typos in the import path.","cause":"Attempting to import data models from `vonage_application` but the main `vonage` SDK (v4.x.x) or its sub-packages are not correctly installed or accessible.","error":"ModuleNotFoundError: No module named 'vonage_application'"},{"fix":"Verify `VONAGE_API_KEY` and `VONAGE_API_SECRET` are correct from your Vonage Dashboard. If using application-based authentication (e.g., for Voice), ensure `VONAGE_APPLICATION_ID` and the path to `VONAGE_PRIVATE_KEY` are correct, and use the `Auth` object appropriately for JWT authentication.","cause":"Incorrect API Key/Secret or Application ID/Private Key provided, or using the wrong authentication type for the specific API endpoint being called.","error":"Error: Invalid credentials for API request"}],"ecosystem":"pypi","meta_description":null,"install_score":95,"install_tag":"verified","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.1,"mem_mb":22.9,"disk_size":"48.6M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.43,"mem_mb":22.9,"disk_size":"48M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.6,"mem_mb":24.9,"disk_size":"52.1M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.24,"mem_mb":24.9,"disk_size":"52M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.46,"mem_mb":24.2,"disk_size":"43.6M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.38,"mem_mb":24.2,"disk_size":"43M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2,"mem_mb":23.4,"disk_size":"43.3M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.99,"mem_mb":23.4,"disk_size":"43M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.88,"mem_mb":23.1,"disk_size":"48.7M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.68,"mem_mb":23.1,"disk_size":"48M"}]},"quickstart_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}