{"id":10163,"library":"python-intercom","title":"Intercom Python SDK","description":"The Python Intercom SDK (PyPI project name `python-intercom`, installs `intercom_python_sdk`) provides a convenient way to interact with the Intercom API. It allows developers to manage users, conversations, events, and more. The SDK is currently at version 5.0.1 and is regularly updated through automated API specification regenerations.","status":"active","version":"5.0.1","language":"en","source_language":"en","source_url":"https://github.com/intercom/python-intercom","tags":["api-client","sdk","intercom","customer-messaging"],"install":[{"cmd":"pip install python-intercom","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"HTTP client for API requests.","package":"httpx","optional":false},{"reason":"Used for data validation and models (Fern-generated SDKs).","package":"pydantic","optional":false},{"reason":"Date/time parsing and manipulation.","package":"python-dateutil","optional":false},{"reason":"Backports and additions to the typing module.","package":"typing-extensions","optional":false}],"imports":[{"note":"The PyPI project name is 'python-intercom', but the installed package and import name is 'intercom_python_sdk'.","wrong":"from python_intercom import IntercomClient","symbol":"IntercomClient","correct":"from intercom_python_sdk import IntercomClient"}],"quickstart":{"code":"import os\nfrom intercom_python_sdk import IntercomClient\n\n# Initialize the client with your Personal Access Token\n# Recommended: Store token in an environment variable named INTERCOM_ACCESS_TOKEN\nclient = IntercomClient(personal_access_token=os.environ.get(\"INTERCOM_ACCESS_TOKEN\", \"\"))\n\nif not client.personal_access_token:\n    print(\"Error: INTERCOM_ACCESS_TOKEN environment variable not set.\")\n    print(\"Please set it or pass your token directly to IntercomClient(personal_access_token='YOUR_TOKEN')\")\nelse:\n    try:\n        # Example: List all users\n        users_list = client.users.list_all(per_page=1)\n        if users_list and users_list.data:\n            print(f\"Successfully retrieved {len(users_list.data)} user(s).\")\n            for user in users_list.data:\n                print(f\"  User ID: {user.id}, Email: {user.email}\")\n        else:\n            print(\"No users found or an empty list was returned.\")\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to initialize the IntercomClient using an environment variable for security and then fetch a list of users. Ensure `INTERCOM_ACCESS_TOKEN` is set in your environment."},"warnings":[{"fix":"Always install using `pip install python-intercom`. Always import using `from intercom_python_sdk import ...`.","message":"The PyPI project name is `python-intercom`, but the actual Python package/module name you import is `intercom_python_sdk`. Attempting to `pip install intercom_python_sdk` or `pip install python_intercom` will fail.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Refer to the official GitHub repository's README and examples for the new client structure and API call patterns. Re-evaluate how you initialize the client and make API requests.","message":"Version 4.0.0 introduced a complete rewrite of the SDK using Fern, leading to significant breaking changes in client initialization, class names, method signatures, and return types. Code written for v3 is incompatible with v4/v5.","severity":"breaking","affected_versions":"4.0.0 and above"},{"fix":"Always use environment variables (e.g., `os.environ.get('INTERCOM_ACCESS_TOKEN')`) to store and retrieve your API token securely.","message":"The client requires a `personal_access_token` for authentication. Direct inclusion in code is discouraged.","severity":"gotcha","affected_versions":"4.0.0 and above"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Ensure you install the package using `pip install python-intercom`. The installed package name is `intercom_python_sdk`, which is what you should import.","cause":"The package was installed using an incorrect name (e.g., `pip install intercom_python_sdk`) or not installed at all, preventing the correct module from being found.","error":"ModuleNotFoundError: No module named 'intercom_python_sdk'"},{"fix":"Initialize the client with `personal_access_token=os.environ.get('INTERCOM_ACCESS_TOKEN')` or `personal_access_token='YOUR_TOKEN'`.","cause":"Attempting to initialize the Intercom client using `api_key`, which was a parameter in older versions (pre-v4). The current client expects `personal_access_token`.","error":"TypeError: IntercomClient.__init__() got an unexpected keyword argument 'api_key'"},{"fix":"Ensure you are using the correct client initialization and resource access patterns for v4/v5. For example, `client.users.list_all()` is the correct way to access user-related methods.","cause":"This error often occurs when migrating from older SDK versions (pre-v4) to the newer v4/v5 client, or if the client object is not correctly initialized. The way resources are accessed changed in the Fern-generated SDK.","error":"AttributeError: 'IntercomClient' object has no attribute 'users'"}]}