{"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,"search_vec":"'4':59 'activ':50,81 'api':3,23,27,98 'applic':2,26,29,73,87,100 'cadenc':56 'capabl':38 'communic':97 'concept':33 'configur':35 'core':32 'current':12 'exist':76 'includ':24 'interact':19 'interfac':17 'like':39 'main':94 'maintain':51 'major':67 'manag':85,101 'messag':41,103 'packag':75 'previous':66 'programmat':88 'provid':14 'pypi':74 'python':6,10,90 'recommend':79 'regular':54 'releas':55 'rewrit':64 'rtc':42,104 'sdk':7,11,48,96 'secur':36 'servic':46 'signific':63 'streamlin':16 'support':82 'v2.0.1':77 'v4.x.x':13 'various':21 'version':58,68 'via':4 'voic':40,102 'vonag':1,5,9,22,28,45,72,86,95,99 'vonage-appl':71 'way':83 'x.x':60","created_at":"2026-03-16T04:39:09.011572+00:00","updated_at":"2026-04-16T18:49:58.738896+00:00","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,"quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"4.8.2","cli_name":"","cli_version":null,"type":"library","homepage":"https://developer.vonage.com","github":"https://github.com/Vonage/vonage-python-sdk","docs":null,"changelog":null,"pypi":"https://pypi.org/project/vonage/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["communication"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-26","next_check":"2026-07-28","install_tag":"verified"}}